View Full Version : Reverse walking for units
jasonongsip
08-04-2009, 12:47 PM
can someone teach me how to make a unit walk in reverse when pressing the down arrow key? i figured out the other directions already. if possible not jass please. :P thanks!
Child_0f_Bodom
08-04-2009, 01:01 PM
Try this:
Set TempPoint1 = (Position of <Your Unit>)
Set TempPoint2 = ( TempPoint1 offset by <Offset> towards ((Facing of <Your Unit>) + 180.00) degrees)
Unit - Order <Your Unit> to Move To TempPoint2
Custom script: call RemoveLocation(udg_TempPoint1)
Custom script: call RemoveLocation(udg_TempPoint2)
jasonongsip
08-04-2009, 01:39 PM
well i wanted something that will make it look like he's walking in reverse. like the moonwalk. :P i dont want it to face the direction. any ideas? =/
toofless
08-04-2009, 02:14 PM
Oh man, there was a topic a while back about playing animations in reverse. It's possible but the function was quite complicated. Lemme search for you....
Eh, I haven't tested this system btw...
http://www.wc3c.net/showthread.php?t=103936
Restor
08-04-2009, 02:21 PM
try to play little bit with pitch angle and the second angle thing within object editor.
then you will to make the exactly same unit, but with different angles, and of course it will go in reverse. Then make trigger which will replace the units.
jasonongsip
08-04-2009, 02:33 PM
ok thanks guys! got everything solved now except for the reverse animation. Toofless, is there an easier way to do it? because those functions are too complicated for me. T_T im still a noob in map designing. Well, at least tell me what i need to have before i use those functions. :P thanks alot im making good progress now. xD
rednek
08-04-2009, 02:41 PM
Events
Time - Every 0.0X seconds of game time
Conditions
Actions
Set TempPoint1 = (Position of <Your Unit>)
Set TempPoint2 = ( TempPoint1 offset by <Offset> towards ((Facing of <Your Unit>) - 180.00) degrees)
Custom script: call SetUnitAnimationByIndex(udg_<Your Unit>, <It's Walk Animation (type number in here)>)
Unit - Move <Your Unit> instantly to TempPoint2
Custom script: call RemoveLocation(udg_TempPoint1)
Custom script: call RemoveLocation(udg_TempPoint2)
-working
jasonongsip
08-04-2009, 02:56 PM
Events
Time - Every 0.0X seconds of game time
Conditions
Actions
Set TempPoint1 = (Position of <Your Unit>)
Set TempPoint2 = ( TempPoint1 offset by <Offset> towards ((Facing of <Your Unit>) - 180.00) degrees)
Custom script: call SetUnitAnimationByIndex(udg_<Your Unit>, <It's Walk Animation (type number in here)>)
Unit - Move <Your Unit> instantly to TempPoint2
Custom script: call RemoveLocation(udg_TempPoint1)
Custom script: call RemoveLocation(udg_TempPoint2)
-working
For the "Custom script: call SetUnitAnimationByIndex(udg_<Your Unit>, <It's Walk Animation (type number in here)>)",
I put Custom script: call SetUnitAnimationByIndex(udg_RedHero, Walk(1))
RedHero is the variable for the unit. Its saying expected name of something. what did i do wrong? =/
[EDIT]
Ok i got it now. ur supposed to put the number only. xD Thanks man!this helped me alot. its fixed now! :P even though it looks a little weird the animation.. still! its still great! thanks alot! :P
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.
Search Engine Optimization by
vBSEO 3.5.1 PL2