• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Movement system problem

Status
Not open for further replies.
Level 5
Joined
Jun 12, 2016
Messages
74
Hi guys, I'm trying to solve a problem for hours now, I don't see the problem on my gui here, it's a campaign map, so I'm not worry about local variables, I don't know coding in jass/vjass, I'm a gui guy.

The objective is to make a "dodge skill", the casting unit "ddgr" (dodger) will make a semi circle (180°) movement with 128 radius, just like an Blade and Soul skill that moves behind the target.

upload_2016-6-15_2-38-12.png



The wait is necessary for the animation to work, first I set up the facing angle followed by the semi circle points, the starting point and the circumcenter respectively, the problem is somewhere in the red rectangle.


upload_2016-6-15_2-39-36.png



This works pretty bad in game, it should be a perfect semi circle, I need that skill to be 100% precise. At least the timing is precise, it ends in 0.33 seconds, but the movement is bugging, why???????
 
Level 14
Joined
Jul 1, 2008
Messages
1,314
Can you maybe describe, what the actual motion is? I think, it might be the power to the 2, that you apply to the timing. This makes the movement non-linear and thereby hard to understand for our brains, I'd say.
you may also include a debug message for this kind of problems for yourself, if you didnt do this yet. Like this, you can use trial and error, which is pretty handy.
 
Level 5
Joined
Jun 12, 2016
Messages
74
AAAAAAWWW I found the problem! My math is wrong, the (-1)x(dodge angle) doesn't give the opposite angle but the simetric angle on X axis, I've changed to (180)+(dodge angle) and now it's perfect! That's great.


This doesn't relate to your problem at hand, but you need to remove leaks. I'm also a GUI gal here, and you gotta remove leaks nonetheless.

I've removed all the leaks right at the end, except unit group leak because I forgot how to do it.

upload_2016-6-15_13-23-44.png
 
Level 9
Joined
May 21, 2014
Messages
580
AAAAAAWWW I found the problem! My math is wrong, the (-1)x(dodge angle) doesn't give the opposite angle but the simetric angle on X axis, I've changed to (180)+(dodge angle) and now it's perfect! That's great.




I've removed all the leaks right at the end, except unit group leak because I forgot how to do it.

View attachment 240279
Great! :D Good to know it works. I completely missed that angle misinformation.
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
Btw, to remove the wait, try the actual effect event of abilities "A unit starts the effect of an ability".
It is much better.

Also, it might be a good idea to implement a frametime feature to it.
On every index, you store the elapsed time (a real variable that increases with 0.03 every interval).
If that number + 0.03 is bigger than the duration you want and if that number itself is not equal to the duration, you then calculate the frametime (which is the amount of seconds, in your case 0.01) and multiply distances etc by the factor of that frametime.

It sounds like a lot of work... and in some cases it is, but it is worth to try out.
Even without the frametime, you can still choose a variable duration.
 
Level 5
Joined
Jun 12, 2016
Messages
74
Btw, to remove the wait, try the actual effect event of abilities "A unit starts the effect of an ability".
It is much better.

Also, it might be a good idea to implement a frametime feature to it.
On every index, you store the elapsed time (a real variable that increases with 0.03 every interval).
If that number + 0.03 is bigger than the duration you want and if that number itself is not equal to the duration, you then calculate the frametime (which is the amount of seconds, in your case 0.01) and multiply distances etc by the factor of that frametime.

It sounds like a lot of work... and in some cases it is, but it is worth to try out.
Even without the frametime, you can still choose a variable duration.
Thanks, thats realy better with start effect, I've been using "being casting ability" in other skills because it's a faster action in game, but I forgot to change this one. Works fine for skills that don't have cooldown, just I take the mana with trigger.
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
If you dislike the "long" casting time, you should check out what cast point does.
It essentially adds that time to the casting time of all abilities for animation purpose, however, 0.5 seconds is a pain in some cases.
That, including the turn speed and required angle, you sometimes end up having quite a large bonus casting time on a 0s casting time ability.
 
Level 5
Joined
Jun 12, 2016
Messages
74
If you dislike the "long" casting time, you should check out what cast point does.
It essentially adds that time to the casting time of all abilities for animation purpose, however, 0.5 seconds is a pain in some cases.
That, including the turn speed and required angle, you sometimes end up having quite a large bonus casting time on a 0s casting time ability.
Woooahh the cast point is new to me! I've removed and now it's perfect! TVM, it helped me A LOT! <3
 
Status
Not open for further replies.
Top