Making a game where players buy units and upgrade them to eventually fight each other in a battleground. When players buy units a building is made for that unit which contains its upgrades.
After every battle i need the upgrades to be reset.
So I made this trigger so that when the unit dies, its upgrades for that player are supposed to reset to 0. A player can only have 1 type of unit at a time.
Here is an example of one of the triggers:
However, this does not work. The units still have the upgrades when they are recreated, and they are not in the upgrade building. Is there a way to reset upgrades?
After every battle i need the upgrades to be reset.
So I made this trigger so that when the unit dies, its upgrades for that player are supposed to reset to 0. A player can only have 1 type of unit at a time.
Here is an example of one of the triggers:
Trigger:
- Demon reset
- Events
- Unit - A unit Dies
- Conditions
- (Unit-type of (Triggering unit)) Equal to Demon Lord
- Actions
- Player - Set the current research level of Demon Armor to 0 for (Owner of (Triggering unit))
- Player - Set the current research level of Hit Point Bonus Demon to 0 for (Owner of (Triggering unit))
- Player - Set the current research level of Speed Bonus Demon to 0 for (Owner of (Triggering unit))
- Player - Set the current research level of Vampirism to 0 for (Owner of (Triggering unit))
- Player - Set the current research level of Demon Rake +1 to 0 for (Owner of (Triggering unit))
- Events
However, this does not work. The units still have the upgrades when they are recreated, and they are not in the upgrade building. Is there a way to reset upgrades?