• 🏆 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 Doubt - Two Simple Questions

Status
Not open for further replies.
Level 3
Joined
Apr 23, 2009
Messages
51
Hello, everyone! :D


So I have two questions:

In my map, the players (Red-Gray, 9 in total) will have to choose a hero. However, I have two questions that may sound simple, but it is something that is breaking my head:

1 - The heroes that will be chosen are in a certain
area. Are 4 heroes. When all players
choose your heroes, I would like the heroes of that
"certain area" be removed from the game, along with all
others units present in that area. But... How I do
that?


2 - This is related to the "1". If one or more of the 9
players are not playing or leave the game before
choose a hero, how should be the trigger for
it does not interfere in the game?


I hope someone can help me clarify these
questions. :)


Thanks :D


PS. 1: If you do not understand something, let me know that I try to explain better my question

PS. 2 : Sorry by my bad english xD
 
Level 8
Joined
Dec 9, 2009
Messages
397
1.Set unit group to the units in the area you want removed
Loop actions for units in that unit group
Remove picked unit from the game.
 
Level 16
Joined
May 1, 2008
Messages
1,605
Seas =)

maybe this works. First of all you need this trigger:
  • Test
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • ((Picked player) controller) Equal to User
                  • ((Picked player) slot status) Equal to Is playing
            • Then - Actions
              • Set COUNT = (Player number of (Picked player))
              • Game - Display to (All players) for 30.00 seconds the text: (String(COUNT))
              • Trigger - Add to Leaving <gen> the event (Player - (Picked player) leaves the game)
            • Else - Actions
+
  • Leaving
    • Events
    • Conditions
    • Actions
      • Set COUNT = (COUNT - 1)
(Count is an Integer variable)

Now if a player choose a hero ( I don't know what's your way for hero choosing ) you just use ( in the choose trigger ):
  • Set COUNT = (COUNT - 1)
Now lets remove the units that can be chosen. For that use something with:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • COUNT Equal to 0
    • Then - Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Your area )) and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked Unit)
    • Else - Actions
 
Status
Not open for further replies.
Top