Warcraft III resources & community, 2003–2006 · archived

keep getting an error message wit this jass function

8 posts
#1

keep getting an error message wit this jass function

Ok i dont get it, this is a very basic jass function but whenever i try to enable it i get an error message saying that it "expected 'set'". Heres the trigger:

function Trig_Spawns_Conditions takes nothing returns boolean
    if ( not ( IsUnitAliveBJ(gg_unit_hkee_0059) == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Spawns_Actions takes nothing returns nothing
    local location a = GetRectCenter(gg_rct_HumanTop)
    local location b = GetRectCenter(gg_rct_Top_1)
    bj_lastCreatedUnit = CreateUnit(Player(10),'hfoo',GetLocationX(a),GetLocationY(a),270)
    call IssuePointOrderLocBJ( GetLastCreatedUnit(), "attack", GetLocation(b) )
    bj_lastCreatedUnit = CreateUnit(Player(10),'hfoo',GetLocationX(a),GetLocationY(a),270)
    call IssuePointOrderLocBJ( GetLastCreatedUnit(), "attack", GetLocation(b) )
    bj_lastCreatedUnit = CreateUnit(Player(10),'hmpr',GetLocationX(a),GetLocationY(a),270)
    call IssuePointOrderLocBJ( GetLastCreatedUnit(), "attack", GetLocation(b) )
    bj_lastCreatedUnit = CreateUnit(Player(10),'hrif',GetLocationX(a),GetLocationY(a),270)
    call IssuePointOrderLocBJ( GetLastCreatedUnit(), "attack", GetLocation(b) )
    call RemoveLocation(a)
    call RemoveLocation(b)
endfunction

//===========================================================================
function InitTrig_Spawns takes nothing returns nothing
    set gg_trg_Spawns = CreateTrigger(  )
    call DisableTrigger( gg_trg_Spawns )
    call TriggerRegisterTimerExpireEventBJ( gg_trg_Spawns, udg_SpawnBasicForces )
    call TriggerAddCondition( gg_trg_Spawns, Condition( function Trig_Spawns_Conditions ) )
    call TriggerAddAction( gg_trg_Spawns, function Trig_Spawns_Actions )
endfunction


the line that "required 'set'" was
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "attack", GetLocation(b) )

any ideas as to what could be causing this error?
#2
yes, you are missing the set statement...

bj_lastCreatedUnit = CreateUnit(Player(10),'hfoo',GetLocationX(a),GetLocationY(a),270)

notice, you are trying to assign a variable yet you use no set
#3
ah i see. ok i did that and now its the same except for with the 'set' of course, but now it tells me theres another problem where it requires a 'name'... wtf?! plz help... :cry:
#4
DurotarLordah i see. ok i did that and now its the same except for with the 'set' of course, but now it tells me theres another problem where it requires a 'name'... wtf?! plz help... :cry:


where is it asking for a name?
#5
on the call IssuePointOrderLocBJ( GetLastCreatedUnit(), "attack", GetLocation(b) ) lines
#6
DurotarLordon the call IssuePointOrderLocBJ( GetLastCreatedUnit(), "attack", GetLocation(b) ) lines


not sure, i don't know the syntax of IssuePointOrderLocBJ nor whether those are the right functions, but apparently you used a variable name that doesn't exist or one thats a preset variable or a function wrongly...

why did you turn it into a text trigger anyways? you can do local stuff with 'custom script action'
#7
i cant call the local variable with a gui function otherwise i would have. but ya ill probably just redo it with most of the stuff as custom scripts mixed wit gui.
#8
DurotarLordi cant call the local variable with a gui function otherwise i would have. but ya ill probably just redo it with most of the stuff as custom scripts mixed wit gui.


however you can define a global variable as say local1

and then define a local variable as udg_local1 and that instance will replace the global variable within that trigger

so using local1 in gui functions will actually use the local version