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

Win / Loss Triggers [GUI]

Status
Not open for further replies.
Level 2
Joined
Apr 12, 2009
Messages
16
Hello! Alright so i need to make some triggers in GUI for win / loss. This is a multiplayer game. I'm totally lost when it comes to making triggers and i would appreciate some help.

Losing
When the player loses his hero abomination, i want the trigger too
-Remove / Kill all his units
-Play a little message that says they lost, etc.
-Set a variable for the winner
-Give him vision of the map

i only know how to make it set the variable and play the message, the other two i have no idea how to set up.

Winning
The last player will win when he is the last hero abomination alive!
-Check to see if the other 5 variables are set
-Play a win cinematic or something!

HELP WOULD BE GREATLY APPRECIATED, and ++ REP :D!
 
Level 8
Joined
Aug 1, 2008
Messages
420
Losing
  • lose
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Abomination
    • Actions
      • Quest - Display to (All players) the Warning message: ((Name of (Owner of (Triggering unit))) + has just lost!)
      • Visibility - Create an initially Enabled visibility modifier for (Owner of (Triggering unit)) emitting Visibility across (Playable map area)
      • Set TempGroup = (Units owned by (Owner of (Dying unit)))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
      • Loop - Actions
        • Unit - Remove (Picked unit) from the game
    • Custom script: call DestroyGroup(udg_TempGroup)
Simplez, i just dont know what you mean for "Set a variable for the winner", what if the winner hasnt won yet? what if their are other players with abominations?

And for winning... i dont really know... you'll need someone elses help for that... I cant think of a way to do it.
edit: added remove units
 
Last edited:
Level 13
Joined
Mar 4, 2009
Messages
1,156
for removing units

set UNITGROUP = unit owned by owner of unit (dying unit)
pick every unit in UNITGROUP and do actions
- remove picekd unit from the game
Custom Script:call DestroyGroup(udg_UNITGROUP)

go edit variables>new variabne>variabel type Unit Group

for massages il give you my trigger if you want colors
  • set colors
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set COLOR[1] = |CFFFF0303
      • Set COLOR[2] = |CFF0042FF
      • Set COLOR[3] = |CFF1CE6B9
      • Set COLOR[4] = |CFF540081
      • Set COLOR[5] = |CFFFFFC00
      • Set COLOR[6] = |CFFFE8A0E
      • Set COLOR[7] = |CFF20C000
      • Set COLOR[8] = |CFFE55BB0
      • Set COLOR[9] = |CFF959697
      • Set COLOR[10] = |CFF7FBFF1
      • Set COLOR[11] = |CFF106246
      • Set COLOR[12] = |CFF492A04
      • -------- use this action in every trigger if you are shure it will run only once --------
      • Custom script: call DestroyTrigger( GetTriggeringTrigger() )
when Abomination dies
  • Actions
    • Game - Display to (All players) the text: (COLOR[(Player number of (Owner of (Dying unit)))] + ((Name of (Owner of (Dying unit))) + |r´s Abomination has been killed))
  • Visibility - Create an initially Enabled visibility modifier for (Owner of (Triggering unit)) emitting Visibility across (Playable map area)
 
Level 2
Joined
Apr 12, 2009
Messages
16
I mean like, there is a variable for each player's Abomination. At the start of the game it checks to see if the player is there, sets the variable if he is and when the player loses his hero it sets it to false. I already figured out how to do it so its all good :). Thanks for all the help everyone +rep!

EDIT: Actually, the win condition failed, so i need help with that too please :)
 
Last edited:
  • Trigger0
  • Events
    • Time - Elapsed time is 0.00 seconds
  • Conditions
  • Actions
    • Set Temp_Force = (All players matching ((Matching Player)'s slot equal to Is Playing) and ((Matching Player) Controller) Equal to User)
  • Trigger1
  • Events
    • Unit - A unit dies
  • Conditions
    • ((Unit-type) of (Dying unit)) Equal to Abomination
  • Actions
    • Player Group - Remove (Owner of (Dying unit)) from (Temp_Force)
    • Game - Display to (PlayerGroup(Owner of (Dying unit))) the message X
    • Visibility - Create an initially Enabled visibility modifier for (Owner of (Dying unit)) emitting Visibility across (Playable map area)
    • If/ Then/ Else
      • If (Conditions)
        • (Number of Players in (Temp_Force)) Equal to 1
      • Then (Actions)
        • Game - Display to (All Players) the text (((Name of (Picked Player)) + (has won the game!)
 
Last edited:
Level 13
Joined
Mar 4, 2009
Messages
1,156
or maybe just...

set UNITGROUP = unit in playable map area matching condition (unit of type matching unit equal to Abomination and matching unit is alive equal to true)
pick ever unit in UNITGROUP and do actions
-Game - Display to (All Players) the text (((Name of owner of unit(Picked Unit)) + (has won the game!)
call DestroyGroup(udg_UNITGROUP)


BTW i think you want to run win/lose trigger when last enemy dies

---set UNITGROUP = unit of type Abomination
if/than/else
all units in UNITGROUP are dead
than
(do actions for win/lose)
else
(no actions at all)
---call DestroyGroup(udg_UNITGROUP)
 
Status
Not open for further replies.
Top