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

[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