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

Will This Work ?

Status
Not open for further replies.
Level 12
Joined
Nov 13, 2010
Messages
254
trying to make a trigger so a text show when you kill the other teams hero

  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Killing unit)) controller) Equal to (==) User
          • ((Killing unit) is A Hero) Equal to (==) True
          • ((Owner of (Killing unit)) slot status) Equal to (==) Is playing
          • ((Owner of (Dying unit)) controller) Equal to (==) User
          • ((Dying unit) is A Hero) Equal to (==) True
          • ((Owner of (Dying unit)) slot status) Equal to (==) Is playing
        • Then - Actions
          • Game - Display to (All players) the text: ((Name of (Owner of (Killing unit))) + ( Has Slain + (Name of (Owner of (Dying unit)))))
        • Else - Actions
 
Level 30
Joined
Nov 29, 2012
Messages
6,637
It would work but I would suggest setting those Killing Unit and Dying Unit into variables before this trigger either in a Map Init trigger or the trgger before that because they were used twice and above, it's for efficiency I guess. Anything used twice should be stored in variable as said by DIMF if I understand it correctly.

That should work overall.
 
Level 12
Joined
Nov 13, 2010
Messages
254
i have this
  • when heros dies
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Dying unit)) is an ally of Player 11 (Dark Green)) Equal to (==) True
          • ((Owner of (Dying unit)) controller) Equal to (==) User
          • ((Dying unit) is A Hero) Equal to (==) True
          • ((Owner of (Dying unit)) slot status) Equal to (==) Is playing
        • Then - Actions
          • Game - Display to (All players) the text: ((Name of (Owner of (Dying unit))) + has benn slain and will respawn in 20 seconds!)
          • Wait 20.00 game-time seconds
          • Hero - Instantly revive (Dying unit) at (Center of hero right <gen>), Hide revival graphics
          • Camera - Pan camera for (Owner of (Dying unit)) to (Center of hero right <gen>) over 2.00 seconds
        • Else - Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Dying unit)) is an ally of Player 12 (Brown)) Equal to (==) True
          • ((Owner of (Dying unit)) controller) Equal to (==) User
          • ((Dying unit) is A Hero) Equal to (==) True
          • ((Owner of (Dying unit)) slot status) Equal to (==) Is playing
        • Then - Actions
          • Game - Display to (All players) the text: ((Name of (Owner of (Dying unit))) + has benn slain and will respawn in 20 seconds!)
          • Wait 20.00 game-time seconds
          • Hero - Instantly revive (Dying unit) at (Center of hero left <gen>), Hide revival graphics
          • Camera - Pan camera for (Owner of (Dying unit)) to (Center of hero left <gen>) over 2.00 seconds
        • Else - Actions
so i was thinking of just set in there and i think it will work fine

so it becomes
  • when heros dies
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Dying unit)) is an ally of Player 11 (Dark Green)) Equal to (==) True
          • ((Owner of (Dying unit)) controller) Equal to (==) User
          • ((Dying unit) is A Hero) Equal to (==) True
          • ((Owner of (Dying unit)) slot status) Equal to (==) Is playing
        • Then - Actions
          • Game - Display to (All players) the text: ((Name of (Owner of (Dying unit))) + has benn slain and will respawn in 20 seconds!)
          • Wait 20.00 game-time seconds
          • Hero - Instantly revive (Dying unit) at (Center of hero right <gen>), Hide revival graphics
          • Camera - Pan camera for (Owner of (Dying unit)) to (Center of hero right <gen>) over 2.00 seconds
        • Else - Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Dying unit)) is an ally of Player 12 (Brown)) Equal to (==) True
          • ((Owner of (Dying unit)) controller) Equal to (==) User
          • ((Dying unit) is A Hero) Equal to (==) True
          • ((Owner of (Dying unit)) slot status) Equal to (==) Is playing
        • Then - Actions
          • Game - Display to (All players) the text: ((Name of (Owner of (Dying unit))) + has benn slain and will respawn in 20 seconds!)
          • Wait 20.00 game-time seconds
          • Hero - Instantly revive (Dying unit) at (Center of hero left <gen>), Hide revival graphics
          • Camera - Pan camera for (Owner of (Dying unit)) to (Center of hero left <gen>) over 2.00 seconds
        • Else - Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Killing unit)) controller) Equal to (==) User
          • ((Killing unit) is A Hero) Equal to (==) True
          • ((Owner of (Killing unit)) slot status) Equal to (==) Is playing
          • ((Owner of (Dying unit)) controller) Equal to (==) User
          • ((Dying unit) is A Hero) Equal to (==) True
          • ((Owner of (Dying unit)) slot status) Equal to (==) Is playing
        • Then - Actions
          • Game - Display to (All players) the text: ((Name of (Owner of (Killing unit))) + ( Has Slain + (Name of (Owner of (Dying unit)))))
        • Else - Actions
 
Level 17
Joined
Mar 21, 2011
Messages
1,611
well it would work, but its very unefficient. as hell_master said, store the killing and triggering unit into a variable at the beginning of the trigger.
you also dont need to do it 3 times and in your trigger, the death message would appear 2 times

  • Trigger
    • Events
      • Unit - A unit dies
    • Conditions
    • Actions
      • Set DyingUnit = (Triggering unit)
      • Set DyingUnitPlayer = (Owner of DyingUnit)
      • Set KillingUnit = (Killing unit)
      • Set KillingUnitPlayer = (Owner of KillingUnit)
      • Game - Display to (All players) the text: ((Name of KillingUnitPlayer) + (has killed + (Name of DyingUnitPlayer)))
      • Wait 20.00 game-time seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Conditions
          • (DyingUnit belongs to an ally of Spieler 11 (Darkgreen)) equal to True
        • 'THEN'-Actions
          • Set Integer = 0
        • 'ELSE'-Actions
          • Set Integer = 1
      • Hero - Instantly revive DyingUnit at Loc[Integer], show revival graphics
      • Camera - Pan camera for DyingUnitPlayer to Loc[Integer] over 0.00 seconds
just initialize the Loc[0] and Loc[1] in an initialization trigger

i didnt put in all the conditions, i think you can do it yourself, just put everything in an IF-THEN-ELSE and check through your conditions.
you also use waits, that means if you wanna play it multiplayer, it wont work correct.
 
Level 5
Joined
Oct 2, 2013
Messages
95
You should use timer arrays for the respawns, setting them to 20 whenever a unit dies. Then, make a trigger that revives the dead hero once the timer`s remaining time is == zero.

If you want those ˜kill˜ texts to look better, you can set all player colors in a string array with their colored hex code, and place those before the player names in the string. When the text shows up, the player`s name will appear with its respective color.
 
Level 12
Joined
Nov 13, 2010
Messages
254
You should use timer arrays for the respawns, setting them to 20 whenever a unit dies. Then, make a trigger that revives the dead hero once the timer`s remaining time is == zero.

If you want those ˜kill˜ texts to look better, you can set all player colors in a string array with their colored hex code, and place those before the player names in the string. When the text shows up, the player`s name will appear with its respective color.


that colored player names sound oka can you show me with a trigger
 
Status
Not open for further replies.
Top