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

[General] Game Text/Win Trigger

Status
Not open for further replies.
Hello,
1-how do I make it so that when a unit casts a spell on a target, it displays a text message ONLY to the owner of that casting unit.

2-Let's say there are 5 heroes in the map, if 4 heroes die the owner of the last surviving hero wins the game, how do I put that in a trigger?

willing to give both reputation and credits to anyone who might help.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
1)
  • Set tempForce = (Player group((Owner of (Triggering unit))))
  • Game - Display to tempForce the text: Some Text
  • Custom script: call DestroyForce( udg_tempForce )
"tempForce" is a player group variable.
"Player group((Owner of (Triggering unit)))" is the action "Convert Player to Player Group".

2)
  • Hero Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set heroesAlive = (heroesAlive - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • heroesAlive Equal to 1
        • Then - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Your Region) and do (Actions)
            • Loop - Actions
              • Game - Victory (Owner of (Picked unit)) (Show dialogs, Show scores)
        • Else - Actions
"heroesAlive" is an integer variable.
 
Status
Not open for further replies.
Top