• 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] A unit dies

Status
Not open for further replies.
Level 12
Joined
Mar 30, 2013
Messages
664
Hello.

Im trying to create a trigger when a unit dies, and when its dead it will show up a message like: Footman: I will have revenge...

But this unit is NOT in the map, it will be spawned. So when it is spawned and therefor it goes a while, he died and show up a message.

Hope some one got an solution. +Rep for those who help.
 
Level 14
Joined
Dec 9, 2006
Messages
1,091
Chaosy's will work (except change "killing unit" to "killed unit" or whatever the proper name is). However, this is going to be mostly circumstantial. This code will trigger for ALL units. If it is for a specific unit that will spawn, make sure that its a unique unit type and that that unit type is set as a condition.

~Asomath
 
Level 15
Joined
Aug 7, 2013
Messages
1,338
Missing the colon in the actions. "Footman: I will have my revenge" instead of "Footman I will have my revenge"

@Asomath

It's GetDyingUnit() in JASS, hopefully it would also be called GetDyingUnit in GUI?
 
Level 15
Joined
Aug 7, 2013
Messages
1,338
chaosy said:
"Footman I will have my revenge" and "Footman: I will have my revenge" makes quite a difference.

It does actually. Without the colon the natural reading would imply that the Footman is the object of revenge, and not the one who wants to have its revenge. The grammatical case of "Footman" in the first sentence is a vocative object (being addressed by someone). (Un)Fortunately English doesn't overtly mark its nominals for case, unlike languages such as Russian, Greek, or German. As it appears many members on the hive are ESL (English second language), I guess it wouldn't be surprising this subtle detail might not seem to matter. But it does. Syntactically English uses left (and occasionally right) dislocation as a way to convey the vocative, while other languages might append an overt suffix that basically means VOCATIVE-OBJECT rather than burden the syntax.

On the other hand, the colon supplies the reference for the pronoun "I," we know that it is the Footman who wants his revenge, and not some other entity like the player. Think of it like variable assignment (that is basically how pronouns function more or less).
 
Level 12
Joined
Mar 30, 2013
Messages
664
It is a specific unit that is NOT on the ground, he will be spawned by a trigger.
And when he dies he will display the message.


EDIT:

I figured out to create it.
And for a thanks for all of you to participate, i give you all +Rep :goblin_good_job:

  • Lord Farks Death
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to (==) |cff8a2be2Skeleton Lord Fark|r
    • Actions
      • Game - Display to (All players) for 10.00 seconds the text: |cFF0080FFSkeleton ...
      • Wait 10.00 seconds
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,219
I guess you use an variable?
  • Actions
    • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
    • Set my_unit = (Last created unit)
  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Triggering unit) Equal to my_unit
    • Actions
      • Game - Display to (All players) the text: stuff
 
Status
Not open for further replies.
Top