• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Trigger Help Please

Status
Not open for further replies.
Level 11
Joined
May 10, 2008
Messages
1,001
Me and a fellow comrade of mine are making this Alterac Valley map and were trying to figure out how to control the reinforcements directions... and what i mean is:

Theres a unit called "The General" and we want to give him abilities which will change the direction of the spawning troops (troops spawn in front of him periodiclly)

Please help
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
Wheres the problem?

You have a few statements there and no actual problem you have doing them.

What I would do is create a spawn system which gives a type, rate, owner and desternation for each spawn on the map. I would use 4 parralel arrays with an integer for the number of spawns.. When a new spawn is made, I simply add it to the array in a clean index (using the number to find that). When a spawn is killed or stopped, you remove it from the array by getting the far top spawn (last added) and overwriting the removed one and reducing the number stored by 1. As the order does not mater, there would be no problems in doing this

As for your ability. As this is not often used (only once every few seconds on average). I would use an O(n) itteration through all spawn objects and find the ones who are owned by the general (how that is done is up to you can can be done in many ways). When a spawn belonging to the general is found, simply change the desternation point to the target point of the spell being cast.
 
Status
Not open for further replies.
Top