First of all, Hi guys! I'm new to the forum and this of triggers, I'm trying to make my firts map but I have some problems so... let's go to the point.
I'm making a trigger that limit a type of building (in this case the gold mine) and raise the limit every time the town hall is upgraded (this is a custom town hall), every time the town hall is upgraded one level, a new gold mine is available to build, the problem is that I can't build a new gold mine til I upgrade some of them, for example: I have the town hall lv.2 and one gold mine lv.1, its supposed that I can build one more gold mine but I can't til I upgrade the existing one to lv.2.
This is the trigger:
I'm making a trigger that limit a type of building (in this case the gold mine) and raise the limit every time the town hall is upgraded (this is a custom town hall), every time the town hall is upgraded one level, a new gold mine is available to build, the problem is that I can't build a new gold mine til I upgrade some of them, for example: I have the town hall lv.2 and one gold mine lv.1, its supposed that I can build one more gold mine but I can't til I upgrade the existing one to lv.2.
This is the trigger:
-
Gold mine limiter
-
Events
-
Unit - A unit Finishes construction
-
Unit - A unit Finishes an upgrade
-
-
Conditions
-
Actions
-
If ((Unit-type of (Constructed structure)) Equal to Gold Mine Lv.1) then do (Set Numberofgmines[(Player number of (Owner of (Triggering unit)))] = (Numberofgmines[(Player number of (Owner of (Triggering unit)))] + 1)) else do (Do nothing)
-
If ((Unit-type of (Constructed structure)) Equal to Town Hall Lv.1) then do (Set Limitofgmines[(Player number of (Owner of (Triggering unit)))] = (Limitofgmines[(Player number of (Owner of (Triggering unit)))] + 1)) else do (Do nothing)
-
If ((Unit-type of (Triggering unit)) Equal to Town Hall Lv.2) then do (Set Limitofgmines[(Player number of (Owner of (Triggering unit)))] = (Limitofgmines[(Player number of (Owner of (Triggering unit)))] + 1)) else do (Do nothing)
-
If ((Unit-type of (Triggering unit)) Equal to Town Hall Lv.3) then do (Set Limitofgmines[(Player number of (Owner of (Triggering unit)))] = (Limitofgmines[(Player number of (Owner of (Triggering unit)))] + 1)) else do (Do nothing)
-
If ((Unit-type of (Triggering unit)) Equal to Town Hall Lv.4) then do (Set Limitofgmines[(Player number of (Owner of (Triggering unit)))] = (Limitofgmines[(Player number of (Owner of (Triggering unit)))] + 1)) else do (Do nothing)
-
If ((Unit-type of (Triggering unit)) Equal to Town Hall Lv.5) then do (Set Limitofgmines[(Player number of (Owner of (Triggering unit)))] = (Limitofgmines[(Player number of (Owner of (Triggering unit)))] + 1)) else do (Do nothing)
-
If ((Unit-type of (Triggering unit)) Equal to Town Hall Lv.6) then do (Set Limitofgmines[(Player number of (Owner of (Triggering unit)))] = (Limitofgmines[(Player number of (Owner of (Triggering unit)))] + 1)) else do (Do nothing)
-
Player - Limit training of Gold Mine Lv.1 to (Limitofgmines[(Player number of (Owner of (Triggering unit)))] - Numberofgmines[(Player number of (Owner of (Triggering unit)))]) for (Owner of (Triggering unit))
-
-
Last edited: