[AI] Something Wrong with JASS Condition...

Status
Not open for further replies.
Level 21
Joined
Mar 16, 2008
Messages
955
This was working previously. I didn't change anything (i think) now it just stops when it gets to this part. Attacking function still works. I double checked tech requirements, that the workers can build lumber mills. Not sure what's preventing it from building a lumber mill... any ideas?

EDIT: so the -1 effectively means "any base". so when a lumber mill is -1 OUTSIDE of the condition, then it builds one, but INSIDE the condition then it doesn't. So something must be wrong with the condition???

UPDATE: IT SEEMS SOMEONE CHANGED THE WAY TOWNS ARE INDEXED :ogre_rage:

JASS:
function UpdateConditions takes nothing returns nothing
    ...
    set gCond_Need_LM = ( ( GetUnitCount( LUMBER_MILL ) ) < 1 )
    ...
endfunction

function BuildPriorities takes nothing returns nothing
...
/// Build Lumbermill
    if gCond_Need_LM then
        if TownHasHall(1) then
            call SetBuildAll( BUILD_UNIT, 1, LUMBER_MILL, 1 )
        elseif TownHasHall(2) then
            call SetBuildAll( BUILD_UNIT, 1, LUMBER_MILL, 2 )
        else
            call SetBuildAll( BUILD_UNIT, 1, LUMBER_MILL, -1 )
        endif
    endif
...
endfunction
 

Attachments

  • insane_script_v27.ai
    50.1 KB · Views: 2
Last edited:
Status
Not open for further replies.
Top