• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

Does this leak?

Status
Not open for further replies.
Level 37
Joined
Aug 14, 2006
Messages
7,614
Does this leak?

Does this work properly?

  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units owned by Player 1 (Red)) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked unit) has an item of type Healing Salve) Equal to True
          • (Charges remaining in (Item carried by (Picked unit) of type Healing Salve)) Greater than 0
        • Then - Actions
          • Item - Set charges remaining in (Item carried by (Picked unit) of type Healing Salve) to ((Charges remaining in (Item carried by (Picked unit) of type Healing Salve)) - 1)
          • Skip remaining actions
        • Else - Actions
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,243
It might bug, depending on what you're trying to do.

In a trigger like this, the skip remaining actions isn't actually doing anything:
  • Untitled Trigger 063
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units owned by Player 1 (Red) matching (((Matching unit) is A structure) Equal to False)) and do (Actions)
        • Loop - Actions
          • Game - Display to Player Group - Player 1 (Red) the text: Text 1
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Footman
            • Then - Actions
              • Game - Display to Player Group - Player 1 (Red) the text: Footman found
              • Skip remaining actions
            • Else - Actions
      • Game - Display to Player Group - Player 1 (Red) the text: Text 2
It will still loop through all remaining units even though a footman is found. It will display Text 1 for all units in the group and also Text 2 will be displayed.

Look at the trigger conveted to JASS:
JASS:
function Trig_Trigger_064_Func001001002 takes nothing returns boolean
    return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false )
endfunction

function Trig_Trigger_064_Func001Func002C takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetEnumUnit()) == 'hfoo' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Trigger_064_Func001A takes nothing returns nothing
    call DisplayTextToForce( bj_FORCE_PLAYER[0], "TRIGSTR_064" )
    if ( Trig_Trigger_064_Func001Func002C() ) then
        call DisplayTextToForce( bj_FORCE_PLAYER[0], "TRIGSTR_065" )
        return // This is "skip remaining actions"
    else
    endif
endfunction

function Trig_Trigger_064_Actions takes nothing returns nothing
    call ForGroupBJ( GetUnitsOfPlayerMatching(Player(0), Condition(function Trig_Trigger_064_Func001001002)), function Trig_Trigger_064_Func001A )
    call DisplayTextToForce( bj_FORCE_PLAYER[0], "TRIGSTR_066" )
endfunction

//===========================================================================
function InitTrig_Trigger_064 takes nothing returns nothing
    set gg_trg_Trigger_064 = CreateTrigger(  )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Trigger_064, Player(0) )
    call TriggerAddAction( gg_trg_Trigger_064, function Trig_Trigger_064_Actions )
endfunction

So it only skips out of the function that deals with that single unit, not the one that deals with the loop.
 
Status
Not open for further replies.
Top