Basicaly what i'm trying to do is this.
CITY has gold food soldiers and heroes.
HERO has skills like smithing and attack.
What I did:
Created the variables NAME, GOLD, FOOD, SOLDIERS, SMITHING, ATTACK all as actor variable.
Created a packmanguy actor for every city and every hero. Lets say I have 2 cities and 2 heroes.
- Code: Select all
//actor city1
NAME = "Nice City";
GOLD = 1000;
FOOD = 2000;
SOLDIERS = 5000;
//actor city2
NAME = "Good City";
GOLD = 1500;
FOOD = 2500;
SOLDIERS = 15000;
//actor hero1
NAME = "Chuck Norris";
SMITHING = 100;
ATTACK = 100;
//actor hero2
NAME = "Bruce Lee";
SMITHING = 200;
ATTACK = 200;
I can imagine lots of things with this but I get into trouble when I have to associate things. How do I say Bruce Lee is located in city2 for example so I can show on the user interface "You have 1 hero" and give him a button so he can press and see the list of heroes. Let alone see all other attributes the hero has.
I thought of a variable with the location, or use the NAME variable and make a LOCATION variable in the hero actor that would match with the text in the NAME variable. But this way I would have to check every hero in the world or every city in the world so if I have like 100 of each it would be a pain. Also I don't know how I'd do this without specifying each individual actor. A function like "check all actors".
Another solution I thought was when I create the actors and whenever I move the actor or something like that, I would manually update the hero list in the city. I think this is really error prone.
Another solution maybe would to have an array in each city called HEROLIST with the values of the array matching the NAME values of the heroes. A similar "solution" like the other one. Still I don't know how I would use this association to show the rest of the heroes attributes based on this list.
Dang, this stuff is so simple in SQL lol. I'm lost here any help please?