• 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.

[Trigger] Pick Units & Destroy Group

Status
Not open for further replies.

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
I was making some triggers using:
  • Unit Group - Pick every unit in (Units currently selected by (Triggering player)) and do (Unit - Remove (Picked unit) from the game)
I mean, I'm using lots of Pick every Unit in blablabla, and I was using the Custom Script set bj_wantDestroyGroup = true. I was wondering, however, if I need to place that custom script above EVERY Pick Every Unit, and I was expecting someone to tell me:emote_razz:
 
Level 8
Joined
Feb 4, 2007
Messages
389
I think so. I think that after every reference, it sets it back to false.
Also, you'll want to take into consideration that some actions may fire before others. So if you only have it on one, the other action may fire before that, thus defeating the purpose.
 
  • Like
Reactions: Rui

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
Alright. Thanks.

  • Events
    • Player - Player 1 (Red) types a chat message containing color as A substring
    • Player - Player 2 (Blue) types a chat message containing color as A substring
    • Player - Player 3 (Teal) types a chat message containing color as A substring
    • Player - Player 4 (Purple) types a chat message containing color as A substring
    • Player - Player 5 (Yellow) types a chat message containing color as A substring
    • Player - Player 6 (Orange) types a chat message containing color as A substring
    • Player - Player 7 (Green) types a chat message containing color as A substring
    • Player - Player 8 (Pink) types a chat message containing color as A substring
    • Player - Player 9 (Gray) types a chat message containing color as A substring
    • Player - Player 10 (Light Blue) types a chat message containing color as A substring
  • Actions
    • If ((Substring((Entered chat string), 7, 9)) Equal to red) then do (Unit Group - Pick every unit in (Units currently selected by (Triggering player)) and do (Unit - Change color of (Picked unit) to Red)) else do (Do nothing)
    • If ((Substring((Entered chat string), 7, 10)) Equal to blue) then do (Unit Group - Pick every unit in (Units currently selected by (Triggering player)) and do (Unit - Change color of (Picked unit) to Blue)) else do (Do nothing)
    • If ((Substring((Entered chat string), 7, 10)) Equal to teal) then do (Unit Group - Pick every unit in (Units currently selected by (Triggering player)) and do (Unit - Change color of (Picked unit) to Teal)) else do (Do nothing)
    • If ((Substring((Entered chat string), 7, 12)) Equal to purple) then do (Unit Group - Pick every unit in (Units currently selected by (Triggering player)) and do (Unit - Change color of (Picked unit) to Purple)) else do (Do nothing)
    • If ((Substring((Entered chat string), 7, 12)) Equal to yellow) then do (Unit Group - Pick every unit in (Units currently selected by (Triggering player)) and do (Unit - Change color of (Picked unit) to Yellow)) else do (Do nothing)
    • If ((Substring((Entered chat string), 7, 12)) Equal to orange) then do (Unit Group - Pick every unit in (Units currently selected by (Triggering player)) and do (Unit - Change color of (Picked unit) to Orange)) else do (Do nothing)
    • If ((Substring((Entered chat string), 7, 11)) Equal to green) then do (Unit Group - Pick every unit in (Units currently selected by (Triggering player)) and do (Unit - Change color of (Picked unit) to Green)) else do (Do nothing)
    • If ((Substring((Entered chat string), 7, 10)) Equal to pink) then do (Unit Group - Pick every unit in (Units currently selected by (Triggering player)) and do (Unit - Change color of (Picked unit) to Pink)) else do (Do nothing)
    • If ((Substring((Entered chat string), 7, 10)) Equal to grey) then do (Unit Group - Pick every unit in (Units currently selected by (Triggering player)) and do (Unit - Change color of (Picked unit) to Gray)) else do (Do nothing)
    • If ((Substring((Entered chat string), 7, 15)) Equal to lightblue) then do (Unit Group - Pick every unit in (Units currently selected by (Triggering player)) and do (Unit - Change color of (Picked unit) to Light Blue)) else do (Do nothing)
    • If ((Substring((Entered chat string), 7, 15)) Equal to darkgreen) then do (Unit Group - Pick every unit in (Units currently selected by (Triggering player)) and do (Unit - Change color of (Picked unit) to Dark Green)) else do (Do nothing)
    • If ((Substring((Entered chat string), 7, 11)) Equal to brown) then do (Unit Group - Pick every unit in (Units currently selected by (Triggering player)) and do (Unit - Change color of (Picked unit) to Brown)) else do (Do nothing)
    • If ((Substring((Entered chat string), 7, 11)) Equal to black) then do (Unit Group - Pick every unit in (Units currently selected by (Triggering player)) and do (Unit - Change color of (Picked unit) to Black)) else do (Do nothing)
In this trigger, I doubt I need all those bj_wantDestroyGroup = True, since only 1 of the actions will fire. What do you recommend?
 
Level 8
Joined
Feb 4, 2007
Messages
389
Have a "and Skip Remaining Actions" if the condition is true. That will reduce the amount of actions that are being run.

Also, since it's only going to run one of them, I'm sure it will work if you simply put it at the top.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Well, rui, if it answers your question --

The next ForGroupBJ (Unit Group in GUI) run will check if bj_wantDestroyGroup is true. If so, it will set bj_wantDestroyGroup to false, then run through the group, then destroy the group. Otherwise, it will just run through the group, and not destroy it afterwards.
 
  • Like
Reactions: Rui
Status
Not open for further replies.
Top