YesNoOk
avatar

Helper/Hitdef Velocity Issue? (Read 3184 times)

Started by The4ury, August 03, 2019, 10:18:48 PM
Share this topic:
Helper/Hitdef Velocity Issue?
#1  August 03, 2019, 10:18:48 PM
  • avatar
  • *
    • UK
I have a helper that bounce of each side of the screen. The issue is once it bounces off the right hand side of the screen and makes contact with the opponent, it will hit him more than once.

I think it's something stupid but I been on it for a while, no luck.

This is the code.
Spoiler, click to toggle visibilty

If you don't understand anything, just reply.
Re: Helper/Hitdef Velocity Issue?
#2  August 04, 2019, 02:30:17 AM
  • ****
  • さようなら
So you want to make it hit only once? You can set a var for when the helper make contact, and change the trigger for the hitdef to something like "triggerall = !var(x)".

Code:
[State 1005, Contact]
type = VarSet ;can also be parentvarset / varadd / parentvaradd
trigger1 = MoveContact && NumTarget
var(x) = 1 ;change x for an unused var
persistent = 0
ignorehitpause = 1

You can tweak this so it match your conditions.
And since you're using a helper it can have its own variables and they will reset everytime you spawn a new helper.
Re: Helper/Hitdef Velocity Issue?
#3  August 04, 2019, 04:09:36 PM
  • avatar
  • *
    • UK
Hey, thanks for the reply.

I should of pointed out that it does hit once but when it bounces of the right the helpers hits twice, I figured out that it has something to do with the velocity. So instead of pushing the opponent back like a light punch would do, the helper pushes him towards the helper causing two hits.

Also, its really strange becuase I have the ground.type = high but once it bounces of the right it becomes ground.type = low it seems like.

I also have this code
Spoiler, click to toggle visibilty

DW

Re: Helper/Hitdef Velocity Issue?
#4  August 04, 2019, 04:18:13 PM
  • *****
    • USA
    • www.trinitymugen.net
I'm not sure about the hitanim thing changing, though for the p2's velhit, I'm guessing you'll need to define the vels based on sides:

ground.velocity = ifElse(P2Dist x < 0,8,-8), 0

^Try this. Or maybe you'd define it based on the helper's facing. In which case, just change the "P2Dist x" stuff to "Facing = 1".

EDIT:

You should also add a hitoverride script that sends it to state 1010 as well.
Last Edit: August 04, 2019, 04:21:19 PM by DW
Re: Helper/Hitdef Velocity Issue?
#5  August 04, 2019, 04:52:35 PM
  • avatar
  • *
    • UK
Hi DW,

I actually tried ifElse(facing = 1,-8,8), 0 before, thought it didn't work. I just tried P2Dist x and still didnt work as well.

I have HitOverRide in state 1000.
Re: Helper/Hitdef Velocity Issue?
#6  August 04, 2019, 05:33:41 PM
  • avatar
  • ***
From the look of your code and what I understand that you only want the helper to hit once, I see the helper has anim 1005, so that animation has a clns1 in it. When the helper hits it goes to state 1010, which also uses anim 1005, so it still has a clns1 and state 1010 has a hitdef in it, this could explain why it is hitting twice, remove the hitdef in 1010 or change add movetype = I to 1010, or copy anim 1005 and remove the clns1 and make it anim 1010, then change state 1010 to anim=1010.

Hope this helps

MGMURROW
Re: Helper/Hitdef Velocity Issue?
#7  August 04, 2019, 07:32:28 PM
  • avatar
  • *
    • UK
Hi, thanks for replying.

I need the hitdef on both.

The issue is once the helper bounces of the right hand side, it hits the oppenent but instead of it pushing the opponent further back it pushes him towards the helper, It shouldn't be doing that.
Re: Helper/Hitdef Velocity Issue?
#8  August 04, 2019, 11:14:14 PM
  • ****
  • さようなら
Try this:

ground.velocity = ifelse(vel X>0, -8, 8), 0
Re: Helper/Hitdef Velocity Issue?
#9  August 05, 2019, 12:39:42 AM
  • avatar
  • *
    • UK