- Joined
- Mar 16, 2008
- Messages
- 824
EDIT: SOLVED SORRY I JUST DIDN'T HAVE GLOBAL VARIABLES SET CORRECTLY / OBJECT EDITOR
The script seems to get hung up on building guard towers. It was working before. IDK why it has a problem now. This player starts out with two guard towers. So the intended action is to upgrade them and not build two more base level guard towers, unless they get destroyed then build two more base level ones then upgrade them. Here are the relevant segments of the script:
It just seems to give up on life when it gets to the point with the guard tower conditions. I swear it was working in other iterations. Any ideas?
The script seems to get hung up on building guard towers. It was working before. IDK why it has a problem now. This player starts out with two guard towers. So the intended action is to upgrade them and not build two more base level guard towers, unless they get destroyed then build two more base level ones then upgrade them. Here are the relevant segments of the script:
JASS:
globals
boolean gCond_Need_Guard_Tower = false
constant integer GUARD_TOWER_1 = 'h00R'
constant integer GUARD_TOWER_2 = 'h00Q'
endglobals
JASS:
function UpdateConditions takes nothing returns nothing
set gCond_Need_Guard_Tower = ( ( GetUnitCount( GUARD_TOWER_1 ) + GetUnitCount( GUARD_TOWER_2 ) ) < 2 )
endfunction
JASS:
function BuildPriorities takes nothing returns nothing
local integer mine = TownWithMine()
if (gCond_Need_Guard_Tower) then
call SetBuildAll( BUILD_UNIT, 1, GUARD_TOWER_1, -1 )
call SetBuildAll( BUILD_UNIT, 2, GUARD_TOWER_1, -1 )
endif
call SetBuildAll( BUILD_UNIT, 1, GUARD_TOWER_2, -1 )
call SetBuildAll( BUILD_UNIT, 2, GUARD_TOWER_2, -1 )
endfunction
It just seems to give up on life when it gets to the point with the guard tower conditions. I swear it was working in other iterations. Any ideas?
Last edited: