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

Hero Kill Announcement Issue

Status
Not open for further replies.
Level 3
Joined
Jan 9, 2010
Messages
34
Hey Hive

So I have been trying to make a trigger that shows a message to all players whenever a hero owned by a player is killed (Dota style map)
But no message pops up when supposed to.

My triggers so far:

  • Map initialization
  • Set PlayerName[1] = ((|c00FF0000 + (Name of Player 1 (Red))) + |r
  • ....
  • Set PlayerName[12] = ......
  • Unit - A Unit Dies
  • ((Dying Unit) is a Hero) equal to True
  • (Custom Value of (Dying Unit)) equal to 1
  • Game - Display to All Players the text: ((PlayerName[(Player Number of owner of Killing Unit)))] + has just slain ) + PlayerName[(Player number of (Owner of (Dying Unit)))])
The custom value is due to the use of mirror image ability which would cause images to trigger the message. All heroes receive custom value 1 when picked.

So any idea why the trigger doesn't show any message?
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
Maybe you don't set the custom value correctly?

Anyway, it's kind of a waste to use custom value only for that.
Try adding this check:
  • ((Triggering unit) is an illusion) Not equal to True
(Yes Triggering unit is the same as Dying unit. You should use Triggering unit instead of Dying unit since it's more bug-free/bit faster.)
 
Level 3
Joined
Jan 9, 2010
Messages
34
Okay thanks, but still aint getting no message sadly.
Didn't think of the illusion thing, cheers.
 
Level 3
Joined
Jan 9, 2010
Messages
34
@Watermelon_1234

  • Unit - A Unit Enters Region
  • Unit - Set the Custom Value of (Triggering Unit) to 1
  • Custom script: call DestroyTrigger(GetTriggeringTrigger())
The other triggering data in this trigger is just for giving potions and setting health to 100% and so on.

@ABTS

I have another triggering preventing players from killing friendly heroes
 
Level 3
Joined
Jan 9, 2010
Messages
34
@ABTS
  • Deny
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Triggering unit) belongs to an ally of (Owner of (Attacking unit))) Equal to True
      • ((Life of (Triggering unit)) Greater than or equal to 50.00) or ((Percentage life of (Triggering unit)) Greater than or equal to 10.00)
      • ((Attacked unit) is A Hero) Not equal to True
    • Actions
      • Unit - Order (Attacking unit) to Stop


@Watermelon_1234

Tried to remove the custom script destroying the trigger but that didn't fix it either.

And ye, all heroes gets all components from the trigger with the custom value.

  • Blue
    • Events
      • Unit - A unit enters O H S <gen>
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 2 (Blue)
    • Actions
      • Unit - Remove Hero Chooser 0065 <gen> from the game
      • Camera - Apply O R <gen> for (Owner of (Triggering unit)) over 0.00 seconds
      • Set OR = (Center of O R <gen>)
      • Unit - Move (Triggering unit) instantly to (Center of O R <gen>)
      • Custom script: call RemoveLocation(udg_OR)
      • Hero - Create Teleport Scroll and give it to (Triggering unit)
      • Hero - Create Healing Potion and give it to (Triggering unit)
      • Hero - Create Mana Potion and give it to (Triggering unit)
      • Unit - Set life of (Triggering unit) to 100.00%
      • Unit - Set mana of (Triggering unit) to 100.00%
      • Unit - Set the custom value of (Triggering unit) to 1
      • Trigger - Turn off Random Blue <gen>
      • Trigger - Turn off Random 2 Blue <gen>
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
Well, this has me stumped as it looks like everything is done correctly...
For a last resort, try debugging the second trigger you posted to see what fails, like show a message whenever a unit dies, if the dying unit (remember, use triggering unit) is a hero, and if the dying unit is not an illusion/has a custom value of 1.

BTW, this is kind of off-topic but it looks like your triggers are inefficient in that there's a specific trigger for each player. Try using an array instead of a specific unit when you remove the Hero Chooser so one trigger can run correctly for all players.
 
Status
Not open for further replies.
Top