I've been mulling this over for a day or two. The idea is to give each enemy container a unique ID number. This allows me to selectively activate individual containers for predetermined actions and movements.
For instance, for my game I have each level broken down into "encounters." Instead of everything being time critical, encounters allow me to set up challenges for the player and seamlessly string them together no matter how quickly the player completes his task. If, say, encounter 24 spawns two enemy containers I need to have full control over each to give them individual movement waypoints and firing instructions.
The way I'm considering doing this is using a global variable to create unique IDs, and assign them to each container on creation, then ++ the value.
[Begin Encounter]
+ Encounter == ##
- Spawn Enemy at (location)
- Set Enemy.ID to 'UniqueID'
(above will be more precise than simple add 1)
- Spawn Enemy at (location)
- Set Enemy.ID to 'UniqueID'
+ Value Enemy.ID == specific number A
- Set location of Waypoint to X.Y
- Set angle of movement toward Waypoint
...rinse and repeat for other instances.
So, does anybody have a better way of doing this that I might be overlooking? Is there a function of containers like this that is yet undocumented?
Thanks again, guys, gals.