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

Annoying Trigger Issue

Status
Not open for further replies.
Level 1
Joined
Feb 24, 2010
Messages
62
I don't really seem to have this problem... This is the trigger that I used:

  • HE DIED
    • Events
      • Unit - Any Unit dies
    • Local Variables
      • Point = (Position of (Triggering unit)) <Point>
      • PointValues = (X of Point) <Real[2][2]>
    • Conditions
    • Actions
      • Variable - Set PointValues[2][1] = (Y of Point)
      • UI - Display (((Text(PointValues[1][1]) with Any Precision decimal places) + " X / Y ") + (Text(PointValues[2][1]) with Any Precision decimal places)) for (All players) to Subtitle area
      • Variable - Set PointValues[1][2] = (X of (Position of (Triggering unit)))
      • Variable - Set PointValues[2][2] = (Y of (Position of (Triggering unit)))
      • UI - Display (((Text(PointValues[1][2]) with Any Precision decimal places) + " X / Y ") + (Text(PointValues[2][2]) with Any Precision decimal places)) for (All players) to Subtitle area
(Yeah, I know, I used once with the Point variable and once without, just checking. :p)
Anyway, both gave me X and Y coordinates which weren't 0, so. :x
 
Level 9
Joined
Dec 17, 2007
Messages
431
create a local variable called "DyingUnit" and set it's intial value to Triggering Unit

Now it's remembered in the memory, a unit is removed from memory when it dies if no variables are assigned to it. You can now reffer to it as "DyingUnit". This is done to remove any memory-leaks (yes, there are down-sides with the new memory cleaner)'

btw. You have used a wait command before referring to the unit
 
Level 16
Joined
Feb 22, 2006
Messages
960
...you don't get me I think, 1. also if storing it in a variable the point gets 0,0 since the unit position is moved to this point if the unit dies.

This happens since I don't use TriggeringUnit(), seems more like a general problem with the garbage colector, since it should clean the memory of a variable if the variable isn't used anymore, but somehow my loop I use seems to crash this
 
Status
Not open for further replies.
Top