HERO WARS - UPGRADING YOUR TROOPS
By Jack.K
Hello, This is the way I create the upgrade troops function like you see in Hero Wars. This may not be the best way to create this but it works.
Your going to need:
A trigger to control buying the upgrade.
A unit that your men will upgrade to.
A unit to train as the upgrade (I'll explain in a moment)
Go into your object editor and make a new custom unit. Make the base anything and call it something like "Upgrade Troops" Now go through all the stats and change the Resource side of things. Make sure to change the food down to 0.
Now create your unit to be produced. I just made a custom footman and changed his stats down. (Eg. Health and Damage)
Now just add the "Upgrade Troops" unit to a building under units trained.
Triggers:
Ok..Now for the trigger part.
First create a new trigger called "Control" or something. The trigger should be as follows:
Trigger:
- Event
- Unit - (Your Unit) Finishes training a unit
Trigger:
- Condition
- (Unit-Type of (Trained Unit)) Equal to (Your Upgrade Unit)
This means that only do the actions if these are true. So don't continue unless the Trained Unit is you Upgrade Unit
Trigger:
- Action
- Unit - Remove (trained unit) from the game.
That way you won't see the "Upgrade Troops unit come out of the building"
Followup Trigger:
For the Attacking trigger (This would be for the herowars part) Just put:
Trigger:
- Event
- Time - Every (Your Time) seconds of game time
- Actions
- Unit - Create (Number of Units)(Your Unit) at (Your Region)
- Unit - Order (Last Created Unit) to attack move to (Enemy Region)
Now the trigger above would be turned off on a trigger initalized at the start of the game so it only comes on when the ability has been baught.
Thanks for reading. If you have any questions feel free to ask.
Jack