Mr.Tutorial
Hard in the Paint.
- Reaction score
- 42
So pretend a footman get's 5 kills. Then I want that footman to get replaced by a stronger unit but only if he has gotten 5 kills.
Couldn't I just move the condition down to the If/then/else condition and use an "And Multiple Conditions" and put both those under it for footman only.
Like this
Trigger:
- Upgrade Surf to Swordsmen
- Events
- Unit - A unit Dies
- Conditions
- Actions
- Set Integer = (Integer + 1)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- And - All (Conditions) are true
- Conditions
- Integer Equal to 5
- ((Dying unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
- (Unit-type of (Killing unit)) Equal to |c0000ccffSurf
- Then - Actions
- Unit - Replace (Killing unit) with a |c0000ccffSwordsman|r using The new unit's default life and mana
- Else - Actions
What you just do is use the unit's custom value for tracking the number of kills. (That is, if you're not using custom value for something else yet.)
what hopy wrote is not MUI, if you do not want this trigger to work for more units than a single footman in your map it wont work this way.
the best way would be to use a hashtable. also okay but not as good as the hashtable would be to use the custom value.
- Check if the Killing unit is a |c0000ccffSurf.
- Set Intreger +1
- If Intreger = 5
- Replace unit.