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

Passive spell help

Status
Not open for further replies.
Level 10
Joined
Apr 9, 2004
Messages
502
I was thinking after gettin some feedback for my spells that i;d make a different one since after thought it seemed very unbalanced. Anyways, I want to make a spell for one of my slow players to increase his speed the longer he is in motion and then add the increased speed to his attack. I just want to know how i can detect when he is in motion and when he isn't.


I figured i'd make a half second looping trigger that checked for his position and added a value to his speed if his position wasn't the same.

Now the problem with this is running in between units so i figured after a certian speed was met he's start pushing units out of the way and after that he also start damaging unit's he pushed. As he maxed out his pseed wouldn't increased, but rather his attack damage. the only thing i don't know about is moving the unit he is trying to attack. I suppose i could make an exception so it doesn't to allow him to easy get to that unit and finsih it.


Any thoughts on this spell? Could it be balanced, or would it be too overpowered? (keep in mind that the unit who gets this is the slowest naturally and that it takes a good 3000 distnace or so to acheive full speed. The only thing i'd have to check is his movement angle and make sure to cut his speed bonus by a value (like 250 or so) if he turns 180 degrees and take and lower the penalty the straighter he runs. This will keep him from running in circles to increase momentum and make this spell used to catch up and finish of targets much like his other spell but less cheap as he can stop and be killed in the process or even lose his speed bonus if he's stunned. Perhaps even make him leave a unit trail to confuse enemies.


The only thing is i'll need to make his max speed around 700 or so so he could easily catch any unit running full speed for a good quick attack.

Anyone know how to change that? Can i use the shift thing (it can't be triggered movement he actually has to be moving that fast.)

That's pretty much it.
 
Level 10
Joined
Apr 9, 2004
Messages
502
Why can no one ever answer?

I mean i've heard people answer easier questions.

I just wanna know what i;d need to do so that this trigger isn't overpowered and so that he slows down when he turns, but he slows down the more he turns (the maximum amoutn of turning being that of 180 degrees.


Don't tell me no one (not even daelin) can tell me how this can be done.
 
Level 6
Joined
Dec 13, 2004
Messages
320
you didn't give them very long to reply.

This sounds very difficult, but units have a propulsion window which is how far off stright forward the unit can go forward. eg. just say the propulsion window is 60 then if the unit is ordered to move 25 degrees off the direction hes facing then he can start moving striaght away but if hes ordered to go 120 degrees then he'll have to stop and turn on the spot before he can move in that direction.

My sugestion is that if he stops he loses all of his speed bonus, i think this should be easy to do
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Sorry, I didn't notice this thread. And besides, if you posted it 11 hours ago or earlier I wasn't online since I was sleeping (I'm in Romania, +2 GMT). If you posted it earlier, sorry.

Ok, the idea would be indeed to always take two points. You would need to work with timers. If you know JASS and you know handlers it will be piece of cake. If you don't, wait a little bit more since I think this afternoon I will finish my basic JASS tutorial. With it you can do locals and other stuff (but handlers not yet).

Anyway, you have a timer which everytime it expires it checks the last position of the unit (stored into a variable) and the current position of the unit (which is (Position of YourUnit)). However, the idea is that you should also have stored the angle between the last two positions into a variable. So you should permanently have another angle between points into a variable. Now, if the difference between (angle between the last two positions) and (angle between alst position and current position) is x (depends on what you want), then you decrease its speed. Else, you check if the unit changed its position and if it has you increase its speed. Sounds complicated but if you don't get it, I will try a script.

And you have my apologeze again because I didn't answer fast enough for you.

~Daelin
 
Level 10
Joined
Apr 9, 2004
Messages
502
well sorry to burst your bubble daelin but i believe i;ve tried that already and it worked fro 3/4 of all scenarios. The problem with simply subtracting the angles is that after you get to 359.99, you go back to 0 and then 1 and so forth. so the editor checks all of the short angles only up from 0 to 180. everything after that will screw up and deduct the wrong amount.

Anyways, since it's been almost a week since i posted i figured out a decent enough way for this which was only to reduce the momentum if he stops. Otherwise this ability takes too long to powerful without being overpowered. So it doesn't matter any more.

However, i have a new question i think yuo could answer Daelin.


Do you know how i could import and inverted parabela and use that to make a jumping arc?
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Of course... The idea would be to know what's the distance between the points and how much you need to wait. Things which can be obtained through a formula by Vexorian:

SquareRoot(Pow([Start Point x]-[Destination Point x],2)+Pow([Start Point y]-[Destination Point y],2)) / Unit Speed

This if you make the unit move itself. If you move it manually just take the duration in which it would be moved.

Now, the idea would be that in the first half of the period to have the unit rise up with the Flying Height action. In the second half it would fall down.

The problem is to have it move smoothly. You can simply order the unit to move itself but if you do so, animations will screw up. So instead, you have to move it manually using handlers with JASS. If you can do this with triggers, super. But I never succeeded to make it move really smooth with triggers.

~Daelin
 
Level 10
Joined
Apr 9, 2004
Messages
502
well thanks for the formula. I've been trying for quite some time. I'll remmeber to ask you since you're quite a wiz with mathematics.


Just one more thing as a function do go like this

Set Height to (all that that you showed be)

And do i base it off of current position - total distance? Well i'll fiddle around with it but if you could post that yeah...that would help me out a lot.
 
Level 10
Joined
Apr 9, 2004
Messages
502
Wait now i'm stuck, by X and why as that finding coordinates for points or is X siatnce and Y height at distance? or what?

WHY AM I SO CONFUSED?


[edit] maybe if you knew what i was doing then you could help me. I basically devised my jump spell into 3 triggers; 1 to initiate and set it up, 1 to move him froward and 1 to move him upward based on how far he's gone.

Maybe Showing you these will help because i'm confused and i'm not sure how to use your formula. I found the distance byt mesureing the distance from my catser to the point and storing it. Then i made a trigger that moved him by a a constant value depepnding on the origional distance and finally i got something to change his height based on that. Here are the three triggers, perhaps you can show me how i should set it up.

anyways :

Initiate set target point
Events
Unit - Giant Hunter 0013 <gen> Starts the effect of an ability
Conditions
(Ability being cast) Equal to Giant Leap
Actions
Unit - Make Giant Hunter 0013 <gen> Invulnerable
Unit - Remove GiantLeapLanding from the game
Set GiantLeapDistancestore = (Distance between (Target point of ability being cast) and (Position of Giant Hunter 0013 <gen>))
Unit - Create 1 Universal Dummy Unit for (Owner of Giant Hunter 0013 <gen>) at (Target point of ability being cast) facing Default building facing degrees
Set GiantLeapLanding = (Last created unit)
Unit - Turn collision for Giant Hunter 0013 <gen> Off
Unit - Add Flying Trick to Giant Hunter 0013 <gen>
Unit - Remove Flying Trick from Giant Hunter 0013 <gen>
Unit - Pause Giant Hunter 0013 <gen>
Animation - Reset Giant Hunter 0013 <gen>'s animation
Animation - Change Giant Hunter 0013 <gen>'s animation speed to 19.00% of its original speed
Animation - Play Giant Hunter 0013 <gen>'s Spell Slam animation
Unit - Add Giant Leap Trail to Giant Hunter 0013 <gen>
Trigger - Turn on Move Kongol From point A to point B <gen>
Trigger - Turn on Increase Height <gen>

Now length increase

Move Kongol From point A to point B
Events
Time - Every 0.01 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Distance between (Position of Giant Hunter 0013 <gen>) and (Position of GiantLeapLanding)) Less than (GiantLeapDistancestore / 150.00)
Then - Actions
Animation - Change Giant Hunter 0013 <gen> flying height to 0.00 at 1000000000.00
Unit - Make Giant Hunter 0013 <gen> Vulnerable
Unit - Create 1 Universal Dummy Unit for (Owner of Giant Hunter 0013 <gen>) at (Position of Giant Hunter 0013 <gen>) facing Default building facing degrees
Unit - Move (Last created unit) instantly to (Position of Giant Hunter 0013 <gen>)
Unit - Add a 0.20 second Generic expiration timer to (Last created unit)
Unit - Add Giant Leap Area damage to (Last created unit)
Unit - Set Level of Giant Leap Area damage for (Last created unit) to (Level of Giant Leap for Giant Hunter 0013 <gen>)
Unit - Order (Last created unit) to Human Mountain King - Thunder Clap
Special Effect - Create a special effect at (Position of Giant Hunter 0013 <gen>) using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
Special Effect - Destroy (Last created special effect)
Unit - Turn collision for Giant Hunter 0013 <gen> On
Unit - Remove GiantLeapLanding from the game
Unit - Remove Giant Leap Trail from Giant Hunter 0013 <gen>
Animation - Change Giant Hunter 0013 <gen>'s animation speed to 100.00% of its original speed
Unit - Unpause Giant Hunter 0013 <gen>
Trigger - Turn off (This trigger)
Trigger - Turn off Increase Height <gen>
Else - Actions
Unit - Move Giant Hunter 0013 <gen> instantly to ((Position of Giant Hunter 0013 <gen>) offset by (GiantLeapDistancestore / 150.00) towards (Angle from (Position of Giant Hunter 0013 <gen>) to (Position of GiantLeapLanding)) degrees), facing (Angle from (Position of Giant Hunter 0013 <gen>) to (Position of GiantLeapLanding)) degrees

and now height (i made a triangle because i can't seem to make a parabola)

Increase Height
Events
Time - Every 0.01 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Distance between (Position of Giant Hunter 0013 <gen>) and (Position of GiantLeapLanding)) Less than or equal to (GiantLeapDistancestore / 2.00)
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GiantLeapHeight Less than 0.00
Then - Actions
Animation - Change Giant Hunter 0013 <gen> flying height to 0.00 at 1000000000.00
Unit - Turn collision for Giant Hunter 0013 <gen> On
Unit - Remove GiantLeapLanding from the game
Unit - Remove Giant Leap Trail from Giant Hunter 0013 <gen>
Unit - Unpause Giant Hunter 0013 <gen>
Unit - Make Giant Hunter 0013 <gen> Vulnerable
Trigger - Turn off (This trigger)
Else - Actions
Set GiantLeapHeight = (1.50 x (((Distance between (Position of Giant Hunter 0013 <gen>) and (Position of GiantLeapLanding)) / GiantLeapDistancestore) x 1500.00))
Animation - Change Giant Hunter 0013 <gen> flying height to ((Default flying height of Giant Hunter 0013 <gen>) + GiantLeapHeight) at 1000000000.00
Else - Actions
Set GiantLeapHeight = (1.50 x (((GiantLeapDistancestore - (Distance between (Position of Giant Hunter 0013 <gen>) and (Position of GiantLeapLanding))) / GiantLeapDistancestore) x 1500.00))
Animation - Change Giant Hunter 0013 <gen> flying height to ((Default flying height of Giant Hunter 0013 <gen>) + GiantLeapHeight) at 1000000000.00


So yeah i'm going to assume that all of this should be done within 1-2 tirggers and that height and distance should be made at the same time.

Perhaps i can use a physics formula for an arc instead to make one more real....

Anyways, perhaps you can tell me how to fix mine. because my way seems to have no connection with yours.
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
As far as I know, there is a mathematical function which creates this parabola. It's a second grade function (unfortunately) and I'm not sure what it is yet. But as soon as I get to it, I'll make sure to announce you. And yes, I made some parabola at physics as well but it had nothing to do with creating it, just with the uniform accelerated movement or something. And I don't think this would help in WE.

~Daelin
 
Level 6
Joined
Dec 13, 2004
Messages
320
Here's the Formula for a function that keeps his height the same no matter what the distance:

y=Height
x=Horizontal Position
h=Max Height
d=Max Distance

y=(h/((d/2)^2))*x*(x-d)

If you want him to go higher the further he jumps then use:

y=x*(x-d)

Any Q's or more formulae just contact me and i'll see what i can do. Hope it Helps.
 
Level 10
Joined
Apr 9, 2004
Messages
502
Um i can see a flaw in it though: when the distance is 1, the height won't be the same as when the distance is 599 if the max distance is 600, accoring to your formula. thta will only work for half the way. He'll start high and slwly drop down. My question is, will this be in the form of an arc?
 
Level 6
Joined
Dec 13, 2004
Messages
320
I get the same answer for both 1 and 599. do you relise that h and d have to stay the same? there is another mistake though. the whole thing should be multiplied by -1, otherwise everything is negative. keep h and d the same and follow the formula exactly and it should work. the part (h/((d/2)^2)) will boil down to an exact value. the x part means that y is zero where x=0. the (x-d) part means that y zero where x-d=0 or x=d. l8r.
 
Status
Not open for further replies.
Top