- Joined
- Jul 30, 2018
- Messages
- 445
Hey!
There must be a very simple solution to this, but for some reason I don't get it. So, the idea is that there can only be one Capital (a research at level 4), thus when you research it, it should set all other research levels (i.e. the last Capital) back to level 3, so the new researched research is the new Capital. It works fine this far, but when I try to research the old Capital back, it just runs the Finish Research trigger right away and doesn't increase the research level for it.
Here's the trigger:
I also uploaded the whole map, if you want to play around. You can test this by first upgrading one city to Capital, and then upgrading another to replace the first Capital. Again, works this far, but when trying to upgrade the old city back to Capital, it doesn't work.
Thanks for the answers in advance!
There must be a very simple solution to this, but for some reason I don't get it. So, the idea is that there can only be one Capital (a research at level 4), thus when you research it, it should set all other research levels (i.e. the last Capital) back to level 3, so the new researched research is the new Capital. It works fine this far, but when I try to research the old Capital back, it just runs the Finish Research trigger right away and doesn't increase the research level for it.
Here's the trigger:
-
Finish Research
-
Events
-
Unit - A unit Finishes research
-
-
Conditions
-
Actions
-
Game - Display to DebugPlayers the text: (Running Trigger: + (Name of the current trigger))
-
For each (Integer LoopIntFinishResearch[0]) from 1 to PlayerCount, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Owner of (Triggering unit)) Equal to Player[LoopIntFinishResearch[0]]
-
-
Then - Actions
-
Set PlayerIndex = LoopIntFinishResearch[0]
-
Set CityIndex = (Unit: (Triggering unit)'s Integer Field: Gold Bounty Awarded - Base ('ubba'))
-
-------- Check if Capital is being built --------
-
Set TempResearch[0] = ResearchTownHall[CityIndex]
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Researched tech-type) Equal to TempResearch[0]
-
(Current research level of TempResearch[0] for Player[PlayerIndex]) Equal to 4
-
-
Then - Actions
-
Player - Set the current research level of ResearchCurrentCapital[PlayerIndex] to 3 for Player[PlayerIndex]
-
Set ResearchCurrentCapital[PlayerIndex] = (Researched tech-type)
-
-
Else - Actions
-
-
-
Else - Actions
-
-
-
-
-
Thanks for the answers in advance!