- Joined
- Mar 24, 2020
- Messages
- 80
Hi guys,
The below triggers are supposed to add/remove dummy units that are used for tech-tree requirements.
I'm having an issue where a variable doesn't seem to want to reset. When the building begins construction the dummy unit is removed from the game, so that the player cannot build a second.
The second trigger is for if the construction is cancelled. The dummy unit is created again, but the variable doesn't seem to set so when trigger 1 occurs again, the dummy unit doesn't get removed. Meaning the building can be built however times the player wishes.
Can anyone spot the issue or suggest an alternative?
Thank you!
The below triggers are supposed to add/remove dummy units that are used for tech-tree requirements.
I'm having an issue where a variable doesn't seem to want to reset. When the building begins construction the dummy unit is removed from the game, so that the player cannot build a second.
The second trigger is for if the construction is cancelled. The dummy unit is created again, but the variable doesn't seem to set so when trigger 1 occurs again, the dummy unit doesn't get removed. Meaning the building can be built however times the player wishes.
Can anyone spot the issue or suggest an alternative?
Thank you!
-
Tavern 1
-
Events
- Unit - A unit Begins construction
-
Conditions
- (Unit-type of (Constructing structure)) Equal to Tavern Hero
-
Actions
- Unit - Remove DummyTavern[(Player number of (Owner of (Constructing structure)))] from the game
-
Events
-
Tavern 2
-
Events
- Unit - A unit Cancels construction
-
Conditions
- (Unit-type of (Cancelled structure)) Equal to Tavern Hero
-
Actions
- Set VariableSet SpawnLocation = (Random point in Boolean <gen>)
- Unit - Create 1 You can only have one Tavern. for (Owner of (Cancelled structure)) at SpawnLocation facing (Random angle) degrees
- Set VariableSet DummyTavern[(Player number of (Owner of (Cancelled structure)))] = (Last created unit)
- Custom script: call RemoveLocation(udg_SpawnLocation)
-
Events