• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

keep getting an error message wit this jass function

Status
Not open for further replies.
Level 7
Joined
Oct 8, 2005
Messages
298
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:

JASS:
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
JASS:
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "attack", GetLocation(b) )
any ideas as to what could be causing this error?
 
Level 7
Joined
Jul 30, 2004
Messages
451
DurotarLord said:
on 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'
 
Level 7
Joined
Jul 30, 2004
Messages
451
DurotarLord said:
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.

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
 
Status
Not open for further replies.
Top