I've run across a problem that I've developed a brute force solution to, but have to believe there is a simpler way. While my project is too convoluted at this point to post, the basic concepts can be easily described and recreated...
Step 1) Create 2 sprite objects.
Step 2) Add them to a Family called Characters
Step 3) Give Characters a number of Instance Variables (Type, Name, Armor, Weapon, Shield, Strength, Dexterity, so on...)
Step 4) Assign different values to each object, for example: Obj1.Type = "Player", Obj2.Type = "Enemy", Obj1.Name = "Doug the Invincible Conqueror" Obj2.Name = "Misfit Toy", etc.
Step 5) Create a text object for each Instance Variable in Characters. (Example: txtType, txtName, txtArmor, etc.)
The challenge is then displaying BOTH the player instance variables AND the Enemy instance variables at the same time without having to recreate individual text objects for each type, which is the brute force method I've got working now. In other words, rather than txtType, txtName, txtArmor, etc., I have txtPlayerType, txtPlayerName, txtPlayerArmor,... AND txtEnemyType, txtEnemyName, txtEnemyArmor,...
What I would like to do, but haven't found a way, is to have some routine which uses instances of the text objects themselves...
1) Checks the Character.Type.
2) IF "Player", use txtType(0), txtName(0), txtArmor(0), etc.
3) ELSE, use txtType(1), txtName(1), txtArmor(1), etc.
Obviously, with a lot of Character variables to display for each object, the brute force method creates long and tedious code. But I can't seem to tell the engine to use Instance 0 for all text objects if Character.Type = "Player", otherwise use Instance 1 for all text objects.
Any ideas would be appreciated!