• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[AI] Something Wrong with JASS Condition...

Level 18
Joined
Mar 16, 2008
Messages
721
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: 0
Last edited:
Top