- Joined
- Nov 9, 2006
- Messages
- 25
I'm writing a creep respawn system which basically works like this.
Map Initialization - Stores all of the creeps to separate unit groups. There is a different unit group for each level of creeps. So a CreepsLevel1 unit group with all of those lvl 1 units in it, CreepsLevel2, with all of the lvl 2's, ect.
A unit dies - Get which unit group it belongs to, and then start a timer which expires in (2x level of dying unit) seconds. After it expires, spawn a random creep from the next unit group.
The problems I'm having.
1) How do i store a unit thats not placed on the map. to a unit array (or unit group). I want to make a unit group with all of the lvl 1 creeps, but i can only add units that are already on the map to the unit group. Is there anyway to get around this, besides creating 1 of each the units, adding them to the unit array, and then removing them?
2) For respawning, is there more efficient way to write the system then masive if/then/else's (without JASS)? I was thinking of writing the respawn trigger to be something like:
If a unit is a member of unit group 1, then spawn a random unit from unit group 2 at dying units posistion, if it is a member of unit group 2, then spawn a random unit from unit group 3, ect.
Thanks in advance
Map Initialization - Stores all of the creeps to separate unit groups. There is a different unit group for each level of creeps. So a CreepsLevel1 unit group with all of those lvl 1 units in it, CreepsLevel2, with all of the lvl 2's, ect.
A unit dies - Get which unit group it belongs to, and then start a timer which expires in (2x level of dying unit) seconds. After it expires, spawn a random creep from the next unit group.
The problems I'm having.
1) How do i store a unit thats not placed on the map. to a unit array (or unit group). I want to make a unit group with all of the lvl 1 creeps, but i can only add units that are already on the map to the unit group. Is there anyway to get around this, besides creating 1 of each the units, adding them to the unit array, and then removing them?
2) For respawning, is there more efficient way to write the system then masive if/then/else's (without JASS)? I was thinking of writing the respawn trigger to be something like:
If a unit is a member of unit group 1, then spawn a random unit from unit group 2 at dying units posistion, if it is a member of unit group 2, then spawn a random unit from unit group 3, ect.
Thanks in advance