How to move a unit instantly, with collision, without interrupting orders?

Weep

Godspeed to the sound of the pounding
Reaction score
400
I'm hoping to implement a dragging method that uses WC3's native collision, so the dragged unit can slide around other units and doodads and terrain, but without interrupting its actions.

SetUnitX/Y ignores collision, and SetUnitPosition interrupts whatever it's doing, AFAIK. Also, using a pathability library would mostly just keep the unit from sliding if something is in the way, which isn't what I want.

I thought about creating another unit of the same unit-type and using SetUnitPosition on it and SetUnitX/Y to move the real unit to the position of the stand-in unit, but this has the problem of the stand-in colliding with the original unit if the offset is too small. Moving the original unit temporarily out of the way first runs the risk of unintentionally tripping region-entrance triggers, or stopping ranged spells like Life Drain.

Any suggestions?
 

BlueMirage

Trust, but doubt.
Reaction score
39
Moving the original unit temporarily out of the way first runs the risk of unintentionally tripping region-entrance triggers, or stopping ranged spells like Life Drain.

If moving the original unit temporarily is not an option, why not try turning its pathability off instead temporarily?
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
You can only make it ignore collisions, not make other units ignore it for the sake of their collisions, which retains the problem of the stand-in colliding with the original unit.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Why not just saving the current order of the unit, and ordering it to do the order again after being moved ? :S

Or, simply using the "LastOrder" library at Wc3C :D
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Because it's hard for a unit with non-zero attack damage point to actually get an attack off if it's being interrupted ever 0.03 seconds, even if reordered afterward. :p

It's not a matter of after it's been moved - I want it to be free to act while being dragged with collision.
 

BlueMirage

Trust, but doubt.
Reaction score
39
Interrupts unit queues and channeling spells.

EDIT: Are orders and stuff interrupted if a unit is hidden then instantly unhidden?
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
EDIT: Are orders and stuff interrupted if a unit is hidden then instantly unhidden?
I remember testing that and discarding it. I don't remember whether it interrupted the actual unit, but it can cancel channeling spells that are targeting that unit.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
No?

(In particular, I hope to apply this to unit images - so no morphing abilities possible...)
 

BlueMirage

Trust, but doubt.
Reaction score
39
If you have some free space on the map, you could "copy" the all the units nearby the unit sliding, including their formation, and create dummy units at some point on the map that is unaccessable by player units, and do your calculations there by removing the "original (a dummy)" and thus not having to worry about breaking links and stuff.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Well, that's a unique approach... :)

Sadly, that wouldn't account for terrain.

Another tried-and-failed idea I had was to give the original unit a long-duration, long-fade windwalk so it would never collide - but images can't use abilities. :( Not even Ghost or Invulnerability, I think.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Well, I wish they could, but neither with the target unit having Ghost (Visible), nor with a trigger adding Ghost (Visible) to the summoned illusion (from Item Illusion), nor with a periodic trigger adding Ghost (Visible) to every unit on the map, does the illusion gain that ability. :(
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
You could make true units instead of illusions.
And add the ward classification to them, so the user can't use an ability but you can order it with a trigger.
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
GroupEnumUnitsInRange for collision size. If any unit exists, stop moving it.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
You could make true units instead of illusions.
And add the ward classification to them, so the user can't use an ability but you can order it with a trigger.
Hmm, maybe, in correlation with Ghost (Visible)...but they'd show up as hero icons in the side, in order to have hero stats that can be matched to the unit being "copied".

Illusions were my original idea because it would make them distinct to the player but not enemies (the blue tint) and because it would adopt the original unit's stats.

GroupEnumUnitsInRange for collision size. If any unit exists, stop moving it.
I already said, I don't want to stop them moving when they collide - I want them to slide around obstacles.
 

Sharp

New Member
Reaction score
5
I have no idea what you are trying to do, but if you accomplish it, could you post it here in a demo map?

I'm curious now.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Hmm, maybe, in correlation with Ghost (Visible)...but they'd show up as hero icons in the side, in order to have hero stats that can be matched to the unit being "copied".

Illusions were my original idea because it would make them distinct to the player but not enemies (the blue tint) and because it would adopt the original unit's stats.
And god invented the object editor fields hideHeroBar/MiniMap.
Ofc you would need several unit type, and some other fancy stuff, because i don't believe that much in ghost but more in windwalk.

And i think you can make the blue tint with a trigger animation.
 

BlueMirage

Trust, but doubt.
Reaction score
39
And god invented the object editor fields hideHeroBar/MiniMap.
Which would be useless since it would hide the hero bar of my original hero.
And i think you can make the blue tint with a trigger animation.
It is possible. I did some testing a few months ago and the closest similarity to illusions color is 9% red, 38% green and 100% blue with 0 transparency.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Which would be useless since it would hide the hero bar of my original hero.
I didn't talked about the original hero ?

It is possible. I did some testing a few months ago and the closest similarity to illusions color is 9% red, 38% green and 100% blue with 0 transparency.
It might depends the main color of the unit, i mean the unit player color.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top