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

drag a unit

Status
Not open for further replies.
Level 3
Joined
Sep 17, 2005
Messages
38
Need help:

How do i make a spell drag.
The action is like you tied a unit on your horse and then with the horse you can drag them to wherever you want.

The idea is just like Achiles drag hector after he win from him.

So whereever the dragger move to the dragged unit is following but cannot do any harm to the dragger until he is untied.
 
Level 3
Joined
Dec 22, 2005
Messages
38
This is probably a crude idea at best, but you could make an event to check either based on some kind of player moving event or time interval and then use the instant move "Move unit - to Triggering Unit with offset"

You'll want your offset to be reflective of the angle the unit is facing too, there's data in the triggers for that also.
 
Level 3
Joined
Dec 22, 2005
Messages
38
I'd also like to add, that I was playing with it and it works slightly except without some trigonometry it's really jankety. You have to move the unit (per x time interval and whatever conditions like "unit has buff = dragging unit") to a location facing angle.

The location will be the player's location with an offset. The challenge you'll have here is figuring out the offset. You'll have to do some math conversion off the other geometric information to find out where exactly you'll put the unit directly behind the moving unit so it doesn't obstruct it's pathing.

Now you can also give it the same facing angle of the unit it's following so also add to the effect that it's being dragged.

I'm assuming the answer here is some kind of radian to point conversion based on the angle the dragging unit is facing.
 
Level 3
Joined
Dec 22, 2005
Messages
38
This may be a bit late, but I was working on something that invovled the same issue and was reminded of this. I did some research and asked around and got some help on the specifics.

Using a DragUnit and a Paladin, the event is game time interval of like .05 time or something like that. So you'll see this "dragged unit" following a pace behind the Paladin. The action is a move <unit> instantly to <point with offset> facing <point>.

Unit - Move DragUnit 0002 <gen> instantly to ((Position of Paladin 0000 <gen>) offset by 150.00 towards ((Facing of Paladin 0000 <gen>) + 180.00) degrees), facing (Position of Paladin 0000 <gen>)

Was originally trying to use offsets with Cosine and Sine. Well I had missed over the "polar offset" point option, which someone pointed out to me in another forum. It works a lot easier and doesn't cause the problems I was having.

Well, in case you ever stop by to read this again I hope it helps.
 
Level 3
Joined
Sep 17, 2005
Messages
38
Ah thanks,

It also comes to my mind about using the trigger "<unit> instantly to <point with offset> facing <point>"

but i haven't tried it due to some works. Since you said about sine, cosine it really mess up my mind, i'm really sucks at that subject. But it is really worth to try
 
Status
Not open for further replies.
Top