| 03-28-2004, 06:34 AM | #1 |
Greetings. I wrote a mock-supply trigger in order to keep track of how many spawned units a player in my footman wars map has. I thought it worked perfectly. However, just once, it has turned out to be bugged. Upon investigating the trigger, I realized that I didn' have any provision for a situation wherein a player uses an ability (like Entrance, or "Charm") to gain control of a unit. So I wrote one. I haven't tried it out yet. However, the instance in which the trigger failed did not involve the use of that spell, so I have not yet solved my problem. I'd like to post the triggers that I'm using to re-create the spawn system here. If anyone can point out something that I'm missing, I'd appreciate it. In the triggers, intArraySpawned[x] is an integer Array which holds the total number of the units that these triggers count for player #x. The units in the Or Condition set are the 8 kinds of units that can be spawned. The reason that I have a "Unit is summoned" trigger is to acount for the Resurrection ability being used. Here are the triggers: Code:
Supply add Enters
Events
Unit - A unit enters (Playable map area)
Conditions
Or - Any (Conditions) are true
Conditions
(Unit-type of (Entering unit)) Equal to Reaper
(Unit-type of (Entering unit)) Equal to Infantry
(Unit-type of (Entering unit)) Equal to Footman
(Unit-type of (Entering unit)) Equal to Footman
(Unit-type of (Entering unit)) Equal to Ranger
(Unit-type of (Entering unit)) Equal to Spinner
(Unit-type of (Entering unit)) Equal to Archer
(Unit-type of (Entering unit)) Equal to Archer
Actions
Set intArraySpawned[(Player number of (Owner of (Entering unit)))] = (intArraySpawned[(Player number of (Owner of (Entering unit)))] + 1)Code:
Supply add Is Summoned
Events
Unit - A unit Spawns a summoned unit
Conditions
Or - Any (Conditions) are true
Conditions
(Unit-type of (Summoned unit)) Equal to Reaper
(Unit-type of (Summoned unit)) Equal to Infantry
(Unit-type of (Summoned unit)) Equal to Footman
(Unit-type of (Summoned unit)) Equal to Footman
(Unit-type of (Summoned unit)) Equal to Ranger
(Unit-type of (Summoned unit)) Equal to Spinner
(Unit-type of (Summoned unit)) Equal to Archer
(Unit-type of (Summoned unit)) Equal to Archer
Actions
Set intArraySpawned[(Player number of (Owner of (Summoned unit)))] = (intArraySpawned[(Player number of (Owner of (Summoned unit)))] + 1)Code:
Supply subtract
Events
Unit - A unit Dies
Conditions
Or - Any (Conditions) are true
Conditions
(Unit-type of (Dying unit)) Equal to Reaper
(Unit-type of (Dying unit)) Equal to Infantry
(Unit-type of (Dying unit)) Equal to Footman
(Unit-type of (Dying unit)) Equal to Footman
(Unit-type of (Dying unit)) Equal to Ranger
(Unit-type of (Dying unit)) Equal to Spinner
(Unit-type of (Dying unit)) Equal to Archer
(Unit-type of (Dying unit)) Equal to Archer
Actions
Set intArraySpawned[(Player number of (Owner of (Dying unit)))] = (intArraySpawned[(Player number of (Owner of (Dying unit)))] - 1)Code:
Supply entrance
Events
Unit - A unit Finishes casting an ability
Conditions
(Ability being cast) Equal to Entrance (Piper)
Actions
Set intArraySpawned[(Player number of (Owner of (Casting unit)))] = (intArraySpawned[(Player number of (Owner of (Casting unit)))] + 1)
Set intArraySpawned[(Player number of (Owner of (Target unit of ability being cast)))] = (intArraySpawned[(Player number of (Owner of (Target unit of ability being cast)))] - 1)Any help is greatly, greatly appreciated. |
| 03-28-2004, 06:58 AM | #2 |
"Unit finishes casting an ability" doesn't fire if the unit is cancelled mid-cast, even if the effect has already happened, also I'm not sure if "Target unit of ability being cast" works for "Finishes casting...". Use "Starts the effect of an ability" instead. |
| 03-28-2004, 07:00 AM | #3 |
Okay, I'll make those changes; thanks. However, the Entrance ability wasn't being used when the trigger went awry, so that's not the root of the problem. However, when using "Starts the Effect of an Ability", is the targeted unit or the ability-using unit considered to be the one who starts the effect? |
| 03-28-2004, 07:31 AM | #4 |
The unit who casts the abillity. |
