• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] player 1 slot status problem!

Status
Not open for further replies.
Level 3
Joined
Jun 23, 2007
Messages
32
in one of my initialization triggers, it checks for if the player is playing for players 1-7, and if he isn't, it kills a specific unit. how come everytime it kills the unit for player 1, but not other players? ie i tihnk it is not counting player one as playing. thanks for help, here is the action part of the trigger, which is turned on by another trig

Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 1 (Red) slot status) Equal to Is playing
Then - Actions
Player Group - Add Player 1 (Red) to playergroup
Else - Actions
Unit - Kill Golem Chooser 0128 <gen>
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 2 (Blue) slot status) Equal to Is playing
Then - Actions
Player Group - Add Player 2 (Blue) to playergroup
Else - Actions
Unit - Kill Golem Chooser 0130 <gen>
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 3 (Teal) slot status) Equal to Is playing
Then - Actions
Player Group - Add Player 3 (Teal) to playergroup
Else - Actions
Unit - Kill Golem Chooser 0131 <gen>
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 4 (Purple) slot status) Equal to Is playing
Then - Actions
Player Group - Add Player 4 (Purple) to playergroup
Else - Actions
Unit - Kill Golem Chooser 0132 <gen>
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 5 (Yellow) slot status) Equal to Is playing
Then - Actions
Player Group - Add Player 1 (Red) to playergroup
Else - Actions
Unit - Kill Golem Chooser 0133 <gen>
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 6 (Orange) slot status) Equal to Is playing
Then - Actions
Player Group - Add Player 6 (Orange) to playergroup
Else - Actions
Unit - Kill Golem Chooser 0139 <gen>
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 7 (Green) slot status) Equal to Is playing
Then - Actions
Player Group - Add Player 7 (Green) to playergroup
Else - Actions
Unit - Kill Golem Chooser 0170 <gen>
 
if u want it so like, if player 1 is not playing and kills his unit, then heres a Really easy way to do it

  • check for playing
  • Events
    • Map Initialization (I would rather use elapsed game time 1 so that loading is faster)
  • Conditions
    • Player - (Player X(color) slot status) Equal to Is unused
  • Action
    • Unit - Kill (What ever unit u need)
    • Player Group - Remove Player(x) from playergroup
and make one for each player
 
Level 6
Joined
Mar 2, 2006
Messages
306
2 pbnjamma: the code (as lengthy as it is) seems fine. next time use .
  • tag so that we can see whether one of your "if" is within previous else or not (which might be the cause of your error). just go to trigger editor, right click the trigger name (above the "events" line and click "copy as text". then return to hive and paste it between [trig.ger] and [/t.rigger] (no dots);
  • meanwhile, try this:
  • [trigger]
  • RemovingUnusedGolems
    • Events
      • Map Initialization
    • Actions
      • Player Group - Pick every player in All Players and do Actions
        • If Player Status of (Picked Player) not equal to Is Playing
          • Then Actions
            • Set SomeUnitGroup = (All units of type Chooser Golem owned by Picked Player)
            • Unit Group - Pick every unit in SomeUnitGroup and do Remove Picked Unnit from the game
            • Custom Script call DestroyGroup( udg_SomeUnitGroup )
before making a trigger like that, you create a variable of type unit group called "SomeUnitGroup"....
 
Level 3
Joined
Jun 23, 2007
Messages
32
both yall were very helpful thanks, the problem was somehwere else, but i laearned from both posts so tahnks again
 
Level 4
Joined
Jul 30, 2007
Messages
79
  • Starting units
  • StartingUnits
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) slot status) Equal to Is playing
              • ((Player((Integer A))) controller) Equal to User
            • Then - Actions
              • Unit - Do Stuff
            • Else - Actions
This should work
Edit: Just change the number of integer to that players who can play the game
 
Last edited:
Status
Not open for further replies.
Top