• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Will This Work ?

Status
Not open for further replies.
Level 14
Joined
Nov 13, 2010
Messages
315
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
 
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.
 
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
 
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.
 
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.
 
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.
Back
Top