YesNoOk
avatar

WARNING: Complex calculations, Veterans only (Read 829 times)

Started by Redash, February 23, 2018, 12:57:55 pm
Share this topic:
WARNING: Complex calculations, Veterans only
#1  February 23, 2018, 12:57:55 pm
  • avatar
  • **
    • Singapore
Hi.

I am currently trying to code an edited Chonshu hyper move that drains life.

I had manage to edit the hyper projectile to homes into the opponent (even midair :^D)

However i have issues calculating the trajectory of the returning projectile esp when the target is hit mid-air.

Assuming an right-angle triangle when target is hit in mid-air with Chonshu on ground, i am assuming:
Opposite = p2BodyDist Y
Adjacent = p2BodyDist X

I use the below expression formula to calculate my return trajectory of the returning projectile of Chonshu edited hypermove for my Scrtl:VelSet,
Code:
X = Cond(p2BodyDist X - Pos X > 0, p2BodyDist X % 2 + 1, Pos X % 2 + 1)
Y = Cond(Enemy, Pos Y >= Root, Pos Y, -1.2, tan(45) * p2BodyDist Y / p2BodyDist X)

The issue here is Y... -1.2 for Y works perfect when target is hit on ground, but problem arises when the target is Hit mid-air... the returning projectile sometimes go beyond below my character. Or simply way above my char. Can the veterans pls assist?

Do be warn this is rather complex and i had used a few googled calculations but seem nothing working (>_<)
Re: WARNING: Complex calculations, Veterans only
#2  February 24, 2018, 10:24:17 am
  • *****
  • Shame on you!
    • USA
I would think that your value should be based off of rootdist x and rootdist y.  Because it's returning home to the parent you should be able to just get 1 position and go to it. What ever code gets you to P2 correctly, just use rootdist instead of P2bodydist or whatever.

Is P1 moving while the projectile returns?
vVv Ryuko718 Updated 10/31/22 vVv
Re: WARNING: Complex calculations, Veterans only
#3  February 24, 2018, 11:21:36 am
  • avatar
  • **
    • Singapore
I have 2 versions, when executed using x, Chonshu cannot move until he is healed when the orb returned. But when executed using Y, chonshu i have edited him to be able to move as he has some followup attacks.

The rootdist improved the trajectory but still inaccurate some of the time, esp when Chonshu is moving.
Re: WARNING: Complex calculations, Veterans only
#4  February 25, 2018, 09:35:59 am
  • *****
  • Shame on you!
    • USA
You probably want to adjust your values so that it's not looking for the 0,0 point. Right now you may have it going back to P1's feet. You're going to want to subtract, or raise it up, so that it goes to P1's chest.
The rootdist x and y just look at the axis of P1 and the helper. So it only returns to that spot. Keep this in mind when doing the math.
vVv Ryuko718 Updated 10/31/22 vVv
Re: WARNING: Complex calculations, Veterans only
#5  March 03, 2018, 05:10:42 am
  • avatar
  • **
    • Singapore
Sort.of Partially solved my current issue when Chinshu is on ground (Pos Y):

Formula is simpler than i thought :^p
Type = veladd
Vel Y = Pos Y of Helper + Pos Y of Destination (an "imaginary horizontal line") / -Constant (negative)
Where constant is derived from character Pos Y arc with a fixed Vel X

Need multiple Velmul to reduce Vel Y to 0 and speed up Vel X at various interval.

Forget to add details that i used SCRTL: TargetBind Mid when projectile hit Target, so it look like it suck the lifeforce from Enemy Target instead of some strange location around the Target.

The issue still not totally solved however when Chonshu fired the Edited projectile in mid-air...
As the projectile travels diagonally downward then upward on its return path, there is an 'imaginary diagonal line' which for the return projectile to go to first (1st Part issue: i dunno how to determine that diagonal line in the expression) before working on further Vel Y and Vel X adjustment for the returning projectile to go upward (2nd part of problem.to solve)

So can anyone help?


Last Edit: March 03, 2018, 05:15:06 am by Redash
Re: WARNING: Complex calculations, Veterans only
#6  March 04, 2018, 12:35:51 am
  • *****
  • Shame on you!
    • USA
If I'm reading things right, it sounds like your vel y is set at a higher percentage than your vel x. Meaning you get to your pos y height before reaching your character.
To change this you'll want to divide the speed vel y sets, by the x distance.
vVv Ryuko718 Updated 10/31/22 vVv