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

[JASS] custom script in remove action not working...

Status
Not open for further replies.
Level 5
Joined
May 10, 2009
Messages
88
So i have this:

Peasent Defeat_triggeraction(CustomDefeatBJ( Player(0), "TRIGSTR_436" ))

and this wont work...


  • Trigger - Take Peasent Defeat <gen> and remove the action (Peasent Defeat_triggeraction(CustomDefeatBJ( Player(0), "TRIGSTR_436" )))

JASS:
function Trig_Peasent_Defeat_Conditions takes nothing returns boolean
    if ( not ( udg_Peasents == 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Peasent_Defeat_Actions takes nothing returns nothing
    call CustomDefeatBJ( Player(0), "TRIGSTR_436" )
    call CustomDefeatBJ( Player(1), "TRIGSTR_437" )
    call CustomDefeatBJ( Player(2), "TRIGSTR_438" )
    call CustomDefeatBJ( Player(3), "TRIGSTR_439" )
    call CustomDefeatBJ( Player(4), "TRIGSTR_440" )
    call CustomDefeatBJ( Player(5), "TRIGSTR_441" )
    call CustomDefeatBJ( Player(6), "TRIGSTR_442" )
    call CustomDefeatBJ( Player(7), "TRIGSTR_443" )
    call CustomVictoryBJ( Player(8), true, true )
    call CustomVictoryBJ( Player(9), true, true )
endfunction

//===========================================================================
function InitTrig_Peasent_Defeat takes nothing returns nothing
    set gg_trg_Peasent_Defeat = CreateTrigger(  )
    call DisableTrigger( gg_trg_Peasent_Defeat )
    call TriggerRegisterTimerEventPeriodic( gg_trg_Peasent_Defeat, 2.00 )
    call TriggerAddCondition( gg_trg_Peasent_Defeat, Condition( function Trig_Peasent_Defeat_Conditions ) )
    call TriggerAddAction( gg_trg_Peasent_Defeat, function Trig_Peasent_Defeat_Actions )
endfunction
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
JASS:
call TriggerAddAction( gg_trg_Peasent_Defeat, function Trig_Peasent_Defeat_Actions )

That's the action. Only an action assigned with TriggerAddAction can be removed. You cannot remove a line of code using this method.

You can make a boolean enabled/disabled... if enabled, call the custom victory for that player, if disabled, don't call that custom victory.

When you use features that aren't in basic World Editor, you're getting involved with JASS and you should be prepared to change you entire thinking of the code you're working with.

Though GUI converts to JASS, the understanding of JASS is far superior to the understanding of its GUI.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
  • Trigger - Take Peasent Defeat <gen> and remove the action (Peasent Defeat_triggeraction(CustomDefeatBJ( Player(0), "TRIGSTR_436" )))
Where do you find this? It is not in the GUI as you're showing it.
 
Level 5
Joined
May 10, 2009
Messages
88
WEU integrated in NewGen...

What I want to do, is when a player types something and moves forces, it removes them from their previous force's victory trigger.
 
Status
Not open for further replies.
Top