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

GUI trigger help needed!

Status
Not open for further replies.
Level 2
Joined
Apr 12, 2009
Messages
16
Okay people, i know i ask for alot of help with triggers, but i need help once again ( ++ Rep for helpers :wink: ).

SO! I need a trigger that when a player finishes building a necropolis, it limits him to only having one, help please :)! And the second trigger i need help with is, a trigger to check if there is a player in a playerslot and if not it removes all his units. Thanks in advance!

-TerranUpYourMom
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Merge this with any other init trigger you have (solves both):

  • Map Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All Players) and do Actions
        • Loop - Actions
          • Player - Limit training of Necropolis to 1 for (Picked Player)
          • If (All Conditions are True) Then do (Then actions) Else do (Else actions)
            • If - Conditions
              • ((Picked player) slot status) Not equal to Is playing
            • Then - Actions
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units owned by (Picked Player)) and do Actions
                • Loop - Actions
                  • Unit - Remove (Picked Unit) from the game
            • Else - Actions
 
Level 2
Joined
Mar 13, 2008
Messages
24
Alright, this should work for you...


Events
Unit - A unit Begins construction
Conditions
(Unit-type of (Constructing structure)) Equal to Necropolis
Actions
Unit - Remove (Constructing structure) from the game
Game - Display to (All players controlled by a ((Owner of (Constructing structure)) controller) player) the text: You can only have one Necropolis.
Player - Add 255 to (Owner of (Constructing structure)) Current gold

It doesn't remove the option to build a necropolis, but if you do, it is removed, you're told that you can't build more than one, and you get your gold back 100%.

Hope this helps. ^^
 
Level 2
Joined
Apr 12, 2009
Messages
16
Oh, the necropolis limit PurplePoot showed me works fine, its just the removing heroes that aren't in the game doesn't work. Sorry that i did specify that xD. +Rep for the help anyway, since you went to the trouble of making that trigger :D. Could someone please help with me a trigger that would get rid of heroes if the player slot is unused?
 
Level 9
Joined
Jul 11, 2009
Messages
294
Player Leaves or Player is Unused?
  • Player Unused
    • Events
      • Map initialization
    • Conditions
      • Player 1(Red) Slot Equal to Unused
    • Actions
      • Unit Group - Pick every unit in (Units owned by Player 1 (Red) and do Remove Picked Unit
or

  • Map Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All Players) and do Actions
        • Loop - Actions
          • Player - Limit training of Necropolis to 1 for (Picked Player)
          • If (All Conditions are True) Then do (Then actions) Else do (Else actions)
            • If - Conditions
              • ((Picked player) slot status) Equal to Unused
            • Then - Actions
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units owned by (Picked Player)) and do Actions
                • Loop - Actions
                  • Unit - Remove (Picked Unit) from the game
            • Else - Actions
Slightly edited from PurplePoot's one.
 
Status
Not open for further replies.
Top