• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Inaccuracy

Status
Not open for further replies.
Level 17
Joined
Mar 21, 2011
Messages
1,597
Hi,
at map initialization, i create a unit at the position of another unit (Selection Circle). The created unit is exactly in the center of the circle.
Now, if i pick a hero, the created unit dies, and the picked unit moves to the exact location (to the Circle). The location is saved in a location variable

Note: Even if i use a timer as a delay (to prevent that the created units' collision is in the way), it is still not working.
 

Attachments

  • Example1.PNG
    Example1.PNG
    117 KB · Views: 80
  • Example2.PNG
    Example2.PNG
    125.8 KB · Views: 97
Level 13
Joined
Jan 2, 2016
Messages
973
You could use "GetLocationX(your point)" and "GetLocationY(your point)", and after that set the unit's X and Y to these values "SetUnitX" and "SetUnitY", that ignoes collisions.
With more details it would look something like this:
  • Custom script: set udg_X = GetLocationX(the point)
  • Custom script: set udg_Y = GetLocationY(the point)
  • Custom script: set udg_TempUnit = CreateUnit ( '0000' , udg_X, udg_Y, 0.00)
//Not sure if creating units, using X and Y is ignoring collision, but if it isn't:
  • Custom script: call SetUnitX(udg_TempUnit , udg_X)
  • Custom script: call SetUnitY(udg_TempUnit , udg_Y)
EDIT: You could potentially make your trigger a tiny little bit lighter, if you don't use the point/location variable, instead get the Circle of Power's coordinates.
Then the trigger will look like "set udg_X = GetUnitX(~the circle~); set udg_Y = GetUnitY(~the circle~)"
 
Last edited:
Level 12
Joined
May 22, 2015
Messages
1,051
Are you certain you are killing the unit before moving the other?

I'm not sure what else could cause it.
 
Level 17
Joined
Mar 21, 2011
Messages
1,597
ok, even if i do not spawn the wisp at all, the hero will still spawn with an offset.
SetUnitX, SetUnitY did not work.

EDIT: i tried using the basic paladin and bloodmage, and they worked. so it has to do something with the unit itself? some object editor data. basic footmen also do have a slight offset

EDIT: they dont seem to move to the exact position where i click either, it is always with an offset. really weird
 
Last edited:
Level 24
Joined
Aug 1, 2013
Messages
4,657
I suppose the units.
Collision size is included in setting the position of units, it be SetUnitPosition or SetUnitX/Y.
So I suppose it adds half the collision size to the actual coordinates... like the actual X/Y position is actually the lower left corner of the collision shape... iirc.

I was confronted with it when I was trying to place a cannon on a tank that would be a separate unit so it could aim and shoot while driving etc.
It had me stunned for hours why it didnt just stay in place.
 
Status
Not open for further replies.
Top