• 🏆 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!

[Trigger] GUI generating trigger compile error

Status
Not open for further replies.
Level 3
Joined
May 3, 2008
Messages
29
Need to know whats wrong this trigger because GUI wasnt supossed to generate compiling errors, since i didnt write the code and its all auto.
Im using the all players matching condition function...and get this error.
I dont know any jass but just by looking at the trigger in text u can see the code is normal at all points except the one causing the error, the code created is a mess, its a calling a function that doesnt exist.
I created this
  • Events
    • Unit - A unit enters finalwavespawn <gen>
  • Conditions
    • ((Triggering unit) belongs to an enemy of Player 1 (Red)) Equal to True
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Random integer number between 1 and 5) Equal to 2
      • Then - Actions
        • Unit - Order (Entering unit) to Attack Castle 1489 <gen>
      • Else - Actions
        • Unit - Order (Entering unit) to Attack-Move To (Center of finalpatroling[(Player number of (Random player from (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)))))])
and get this error

Expected a function name
and here is the trigger converted to text

JASS:
function Trig_movefinalspawn_Copy_Conditions takes nothing returns boolean
    if ( not ( IsUnitEnemy(GetTriggerUnit(), Player(0)) == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_movefinalspawn_Copy_Func001C takes nothing returns boolean
    if ( not ( GetRandomInt(1, 5) == 2 ) ) then
        return false
    endif
    return true
endfunction

function Trig_movefinalspawn_Copy_Actions takes nothing returns nothing
    if ( Trig_movefinalspawn_Copy_Func001C() ) then
        call IssueTargetOrderBJ( GetEnteringUnit(), "attack", gg_unit_hcas_1489 )
    else
        call IssuePointOrderLocBJ( GetEnteringUnit(), "attack", GetRectCenter(udg_finalpatroling[GetConvertedPlayerId(ForcePickRandomPlayer(GetPlayersMatching(Condition(function Trig_movefinalspawn_Copy_Func001Func001003001001001001))))]) )
    endif
endfunction

//===========================================================================
function InitTrig_movefinalspawn_Copy takes nothing returns nothing
    set gg_trg_movefinalspawn_Copy = CreateTrigger(  )
    call DisableTrigger( gg_trg_movefinalspawn_Copy )
    call TriggerRegisterEnterRectSimple( gg_trg_movefinalspawn_Copy, gg_rct_finalwavespawn )
    call TriggerAddCondition( gg_trg_movefinalspawn_Copy, Condition( function Trig_movefinalspawn_Copy_Conditions ) )
    call TriggerAddAction( gg_trg_movefinalspawn_Copy, function Trig_movefinalspawn_Copy_Actions )
endfunction

the error line is clearly

(GetPlayersMatching(Condition(function Trig_movefinalspawn_Copy_Func001Func001003001001001001))))]) )

HELP PLZ!
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
  • Unit - Order (Entering unit) to Attack-Move To (Center of finalpatroling[(Player number of (Random player from (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)))))])
Turn that one into:
  • Set tempplayer = (Random player from (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)
  • Set tempinteger = Player Number of tempplayer
  • Set temppoint = (Center of finalpatroling[tempinteger])
  • Unit - Order (Entering Unit) to Attack-Move temppoint
 
Status
Not open for further replies.
Top