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

[Solved] fast question

Status
Not open for further replies.

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,219
hi, I just run into a possible problem.
if I do the following
  • Actions
    • Unit - Create 1 Troll Lord for Neutral Hostile at (Center of Region 010 <gen>) facing Default building facing degrees
    • Unit - Add a 90.00 second Generic expiration timer to (Last created unit)
(ignore the leak ty)

and then I want to give gold to the player who kills this unit. However what happens if the unit dies by the timer I put? Would that count as player passive killed him or what?
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
I can think of 2 potential ways

The first way would be to check if the owner of killing unit == null I'm not sure that works though.

The other way would be to index all the units you want having an "expiration timer" and count down in a periodic trigger and when their timed life should end you just kill them that way, thereby easily detecting when the unit expired rather than was killed.
 
Status
Not open for further replies.
Top