| 08-08-2003, 01:10 AM | #1 |
i made a trigger that when a unit enters a region it changes it for 10 seconds to a different unit, but for some reason it creates alot more of the changed unit. why? unit enters region unit type of triggering unit type equals unit A unit group-pick every unit in playable map area and do unit replace triggering unit with unit B using new units default settings. set variable - unit B wait 10 seconds unit group-pick every unit in units in playable map area and do unit replace variable with a unit A using new units default settings. |
| 08-08-2003, 01:16 AM | #2 |
Event: - Unit enters region Condition: - Unit(Triggering Unit) is equal to (xxxx) unit Action: - Kill Triggering Unit - Create 1 of (xxxx) unit at (xxxx) area facing some angle - Set Variable(xxxx) to last created unit - Turn on Trigger 2 Trigger 2 Event: - 10 seconds has elapsed Condition: - Action: - Kill variable(xxxx) - Create 1 of (original) unit at (xxxx) area facing some angle. - Turn off this trigger |
| 08-08-2003, 01:22 AM | #3 |
but the trigger has to work on all unit A's in the game. |
| 08-08-2003, 02:47 AM | #4 |
should be as simple as this Code:
Untitled Trigger 002
Events
Unit - A unit enters (Region X)
Conditions
(Unit-type of (Entering unit)) Equal to Soldier
Actions
Unit Group - Pick every unit in (Units of type Soldier) and do (Actions)
Loop - Actions
Unit - Replace (Picked unit) with a Knight using The old unit's relative life and mana
Set unitVarX = Knight
Countdown Timer - Start (timerZ) as a One-shot timer that will expire in 10.00 seconds
Untitled Trigger 002
Events
Time - timerZ expires
Conditions
Actions
Unit Group - Pick every unit in (Units of type unitVarX) and do (Actions)
Loop - Actions
Unit - Replace (Picked unit) with a Soldier using The old unit's relative life and mana
|
