Syntax Error Trackables

Status
Not open for further replies.
Level 6
Joined
Sep 11, 2006
Messages
172
I'm trying to make a script that creates trackables for player 1 across the map area at map initialization. I'm getting a syntax error on line 11.

JASS:
function Trig_Init_Trackables_Actions takes nothing returns nothing
    local real x
    local real y = GetRectMinY(gg_rct_fog) + 64
    local real maxY = GetRectMaxY(gg_rct_fog)
    local real maxX = GetRectMaxX(gg_rct_fog)
    loop
        exitwhen y > maxY - 64
        set x = GetRectMinX(gg_rct_fog) + 64
        loop
            exitwhen x > maxX - 64
            createForPlayer(0)(units\\human\\peasant\\peasant.mdl, x, y, 0, 270)
            set x = x + 128
        endloop
        set y = y + 128
    endloop
    
endfunction

//===========================================================================
function InitTrig_Init_Trackables takes nothing returns nothing
    set gg_trg_Init_Trackables = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Init_Trackables, function Trig_Init_Trackables_Actions )
endfunction

I'm attempting to recreate the script that Kattana uses on his demo map http://www.wc3jass.com/viewtopic.php?t=1997 My map is 192x192.
 
Level 8
Joined
Oct 3, 2008
Messages
367
You're using it wrong, but at least you're using the right system. I can't tell you how many people are still trying to use that ancient wc3jass one...

You should create the trackables in the init function, and then register them to some trigger. There doesn't seem to be any trigger, global or otherwise, accessible here. You should probably check out the demos that come with the system for an idea of how to use it properly.
 
Status
Not open for further replies.
Top