spell to push unit

Status
Not open for further replies.
Level 4
Joined
Mar 15, 2011
Messages
39
Hi, I want to to program a skill that basically work to push or attract an enemy unit. I have no idea how. Any help?
 
Level 7
Joined
Nov 19, 2015
Messages
283
If you are more specific I can provide more help.

Basically these movement spells.

Save the location of the unit
Create a offset position
Move the unit to that new position
Repeat

By moving a unit a small distance in a small amount of time, it will look like the unit is being pulled or pushed.
 
Level 4
Joined
Mar 15, 2011
Messages
39
If you are more specific I can provide more help.

Basically these movement spells.

Save the location of the unit
Create a offset position
Move the unit to that new position
Repeat

By moving a unit a small distance in a small amount of time, it will look like the unit is being pulled or pushed.

To be more specific. I wish the movement of the display unit (such as meat hook butcher)
 
Level 7
Joined
Nov 19, 2015
Messages
283
Ahh ok
I don't know what level of triggering you are at but here is the basics

A unit starts the effect of an ability

Ability equal to force staff push

Add unit to unit group


Every 0.0X seconds
Pick every unit in group and
Save target unit
Save position of target
Set new position to position of target offset by x towards facing of target
Custom script: call SetUnitX(target,GetLocationX(new_position))
Custom script: call SetUnitY(target,GetLocationY(new_position))

Using the set Unit X/Y is better than the GUI move unit as it does not stop channel or orders.
 
Level 4
Joined
Mar 15, 2011
Messages
39
Ahh ok
I don't know what level of triggering you are at but here is the basics

A unit starts the effect of an ability

Ability equal to force staff push

Add unit to unit group


Every 0.0X seconds
Pick every unit in group and
Save target unit
Save position of target
Set new position to position of target offset by x towards facing of target
Custom script: call SetUnitX(target,GetLocationX(new_position))
Custom script: call SetUnitY(target,GetLocationY(new_position))

Using the set Unit X/Y is better than the GUI move unit as it does not stop channel or orders.

A question. in the part of "new position" I should add? I tried it with my name variable and the editor throws me an error.
 
Level 7
Joined
Nov 19, 2015
Messages
283
A question. in the part of "new position" I should add? I tried it with my name variable and the editor throws me an error.

I don't know what you tried to do but here is an example.

Set [force_unit] = picked unit
Set [temp_Loc1] = position of [force_unit]
Set [temp_Loc2] = [temp_Loc1] offset by x towards facing of [force_unit]

I put all the variables in [ ]. I hope this helps.
 
Level 4
Joined
Mar 15, 2011
Messages
39
I don't know what you tried to do but here is an example.

Set [force_unit] = picked unit
Set [temp_Loc1] = position of [force_unit]
Set [temp_Loc2] = [temp_Loc1] offset by x towards facing of [force_unit]

I put all the variables in [ ]. I hope this helps.

Thx a lot
 
Status
Not open for further replies.
Top