Advanced building menu creating unique actors
Picture "red alert" building a warfactory which spawns tanks.
My problem right now is - Iam having trouble with the controls of multiple tanks
Ive tried building them up with self.attributes but when i spawn tank nr 2 it reacts with tank 1 aswell
I really dont want to create 50 similar tank actors to overcome this issue.
I have some thoughs, if i could Use writable tables - but thats not yet an option
Any good idears???
My problem right now is - Iam having trouble with the controls of multiple tanks
Ive tried building them up with self.attributes but when i spawn tank nr 2 it reacts with tank 1 aswell
I really dont want to create 50 similar tank actors to overcome this issue.
I have some thoughs, if i could Use writable tables - but thats not yet an option
Any good idears???
Best Answer
-
tatiang Posts: 11,949
Why are your tanks reacting with each other? Are they targeting each other, moving towards each other, ...?
You can give each tank actor a self.ID (index) and have a counter variable game.nextTankID that starts at 1 and increases after each spawn. Then in the tank actor, have a rule that does something different based on the self.ID number.New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Answers
I think that you'll have to go with self attributes or make a bunch of different actors. There is no other way that I know of that you help you.