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

[Trigger] Getting wrong Location

Status
Not open for further replies.
Level 16
Joined
Jun 25, 2008
Messages
1,043
  • Drop
    • Events
      • Unit - A unit Loses an item
    • Conditions
    • Actions
      • Set TempItem = (Item being manipulated)
      • Set TempPoint = ((Position of (Item being manipulated)) offset by (-100.00, 50.00))
      • Item - Set the custom value of (Item being manipulated) to (0 + (Integer(ItemReal)))
      • Set ItemVar[(Integer(ItemReal))] = TempItem
      • Floating Text - Create floating text that reads (Name of TempItem) at TempPoint with Z offset 0.00, using font size 13.00, color (100.00%, 100.00%, 100.00%), and 40.00% transparency
      • Set ItemFloating[(Integer(ItemReal))] = (Last created floating text)
      • Set ItemReal = (ItemReal + 1.00)
      • Custom script: call RemoveLocation(udg_TempPoint)
This trigger works perfectly, with only one problem
  • Set TempPoint = ((Position of (Item being manipulated)) offset by (-100.00, 50.00))
This doesn't register the point where the item is when dropped, but instead from where it was picked up :|

Any ideas what might be wrong?
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
First: Though you use a point variable, you still leak, in this part:
Set TempPoint = ( (Position of (Item being manipulated)) offset by (-100,50))
The red is still a leak, you can kill it by making a new point variable and setting it,,
Then you can try to debug it by making a special effect, or a unit,,
If it does not work, try to use the position of the unit that drops it,,
Though this is not the exact location of the item, it gets very close if you set 'drop range' or so in Object editor (i thought) to 0 or a little more,,

Actually i wouldnt know why it does not work, but i always debug by making a special effect, and not removing it,, then you can see where it is exactly (OF COURSE remove it after, or not make it at all when you know what is wrong, it is just a debug after all,,)
 
Status
Not open for further replies.
Top