Hello a few others and myself been having issues figuring out how to fix this issue where later in the game the trigger causes massive lag spikes at income. I have tried to add Waits but seem to only break the income not sure if i was placing them correctly but if some one could take a look and improve it would be helpful.
Code:
Give Income
Events
Time - Every 60.00 seconds of game time
Conditions
Actions
For each (Integer B) from 1 to 24, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Race of (Player((Integer B)))) Equal to Human
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Current research level of Hero Mode for (Player((Integer B)))) Equal to 0
Then - Actions
Custom script: set bj_wantDestroyGroup = true
Set BuildingAmount = (Number of units in (Units owned by (Player((Integer B))) matching (((Matching unit) is A sapper) Equal to True)))
Player - Add (((BuildingAmount + 1) x CapitalIncome) x ((CivilWarMode x 2) + 1)) to (Player((Integer B))) Current gold
Player - Add (((BuildingAmount + 1) x CapitalIncome) x ((CivilWarMode x 2) + 1)) to (Player((Integer B))) Current lumber
For each (Integer A) from 1 to 9, do (Actions)
Loop - Actions
Custom script: set bj_wantDestroyGroup = true
Set BuildingAmount = (Number of units in (Units owned by (Player((Integer B))) of type IncomeBuildingType[(Integer A)]))
Player - Add (BuildingAmount x BuildingIncomeAmount[(Integer A)]) to (Player((Integer B))) Current gold
For each (Integer A) from 14 to 22, do (Actions)
Loop - Actions
Custom script: set bj_wantDestroyGroup = true
Set BuildingAmount = (Number of units in (Units owned by (Player((Integer B))) of type IncomeBuildingType[(Integer A)]))
Player - Add (BuildingAmount x BuildingIncomeAmount[(Integer A)]) to (Player((Integer B))) Current lumber
Else - Actions
Set BuildingAmount = (Number of units in (Units owned by (Player((Integer B))) matching (((Matching unit) is A sapper) Equal to True)))
Custom script: set bj_wantDestroyGroup = true
Player - Add (CapitalIncome x ((CivilWarMode x 2) + 1)) to (Player((Integer B))) Current gold
Player - Add (CapitalIncome x ((CivilWarMode x 2) + 1)) to (Player((Integer B))) Current lumber
Player - Add (HeroIncome x HeroModeAlive[(Integer B)]) to (Player((Integer B))) Current gold
Player - Add (HeroIncome x HeroModeAlive[(Integer B)]) to (Player((Integer B))) Current lumber
Else - Actions
For each (Integer A) from 10 to 13, do (Actions)
Loop - Actions
Custom script: set bj_wantDestroyGroup = true
Set BuildingAmount = (Number of units in (Units owned by (Player((Integer B))) of type IncomeBuildingType[(Integer A)]))
Player - Add (BuildingAmount x BuildingIncomeAmount[(Integer A)]) to (Player((Integer B))) Current gold