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

[Spell] Charge with animation

Status
Not open for further replies.
Level 8
Joined
Nov 9, 2011
Messages
326
Okay guys i need to move my unit (i wanna fix my charge spell but dont know how) with running animation and i need to do it via custom script

I need someone to tell me how that custom script would look like

For example

WE have unit, angle, distance per moving...
i know how to do it in GUI but i need also an running animation to go with it and it seems that it doesnt work somehow when u move the unit via GUI trigger
 
Level 8
Joined
Nov 9, 2011
Messages
326
Use SetUnitX and SetUnitY, both do not issue a stop order unlike other unit moves. Warning they will bug on buildings (they fail to move the pathing footprint and origin).

i need it with distance

Right. Attempt changing the units X and Y value directly then.

  • Actions
    • Set yourUnit = (Triggering unit)
    • Set yourLoc = (Position of yourUnit)
    • Custom script: call SetUnitPosition(udg_yourUnit, GetLocationX(udg_yourLoc), GetLocationY(udg_yourLoc))
I heard that it will fix it somewhere..

i need distance also like 20-25 idk i dont remember how much
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,184
Irrelevant. Just use your normal GUI location variable, just replace the actual move action.

something like this if you want to try DSG's idea.
  • Actions
    • Set yourUnit = (Triggering unit)
    • Set yourLoc = (Position of yourUnit)
    • Custom script: call SetUnitX(udg_yourUnit , GetLocationX(udg_yourLoc))
    • Custom script: call SetUnitY(udg_yourUnit , GetLocationY(udg_yourLoc))
 
Status
Not open for further replies.
Top