- Joined
- Sep 21, 2007
- Messages
- 9
Ok so basically I'm setting up a unit merger system, where they load up into a building, I hit an ability called merge units, and they merge based on what I set the combination to be, for example fire elemental + water elemental = steam manifest. This part below works, which keeps track of which units are loaded into the building, in this case archers. What doesn't work is that when you click on their icons in the loaded building they unload and the number remains the same, so I could unload them and load them back up and the number would jump above the maximum units which I set to be 2 units for merging at this point, which is quite a problem! I used a similar trigger to this one to try and lower the number when you release the unit based on the ability cargo hold being cast to reduce this archer variable in the same fashion as it is increased, but couldn't quite get it. Assistance would be great!
Here's what I've got for the entry trigger, which raises the integer variable for the specific unit entering the building
Soul Absorb
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Absorb Soul (Goblin Zeppelin)
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Target unit of ability being cast)) Equal to Archer
Then - Actions
Set SFArchers[(Player number of (Owner of (Casting unit)))] = (SFArchers[(Player number of (Owner of (Casting unit)))] + 1)
What I need is a trigger which lowers the same integer variables when a unit leaves the building.
Here's what I've got for the entry trigger, which raises the integer variable for the specific unit entering the building
Soul Absorb
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Absorb Soul (Goblin Zeppelin)
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Target unit of ability being cast)) Equal to Archer
Then - Actions
Set SFArchers[(Player number of (Owner of (Casting unit)))] = (SFArchers[(Player number of (Owner of (Casting unit)))] + 1)
What I need is a trigger which lowers the same integer variables when a unit leaves the building.