YesNoOk
avatar

Projectile Type Helper Hits Only Once (Read 706 times)

Started by Creamy_Goodness, April 21, 2019, 01:28:01 pm
Share this topic:
Projectile Type Helper Hits Only Once
#1  April 21, 2019, 01:28:01 pm
  • ***
    • USA
    • creamyg.jdluke.com/
> I have been working on a projectile attack that bounces seven times before disappearing. However, the projectile disappears after hitting the opponent once when it should continue bouncing. This error only happens when it hits the opponent and not when it hits the walls or the floor. Here's the code that I have on it so far. The coding is long and complex, so please bear with me...
Spoiler, click to toggle visibilty

> Anyone have any pointers?
= = = = = = = = = =
Jason "Creamy Goodness" Tenn
http://creamyg.jdluke.com/
Last Edit: May 01, 2019, 03:06:04 pm by Creamy_Goodness
Re: Projectile Type Helper Hits Only Once
#2  April 28, 2019, 08:50:41 pm
  • *****
  • Hug Pikachus!
    • USA
Will it be possible to send over the character as is to me so I can diagnose the problem more effectively? I just want to see the error in action myself.
Hug the Pikachus!

Hug A Pikachu Today!
Re: Projectile Type Helper Hits Only Once
#3  April 29, 2019, 11:00:19 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Goddamn thats making a simple attack complicated.

So all your hitdefs are commented out. Does that have any bearing on it not continuing to bounce?

Edit: reread. Your destroyself has a trigger on movecontact. If you hit thats true. So the helper goes away. Take trigger4 off the destroyself.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Projectile Type Helper Hits Only Once
#4  April 30, 2019, 01:21:33 pm
  • ***
    • USA
    • creamyg.jdluke.com/

DNZRX768 - "Will it be possible to send over the character as is to me so I can diagnose the problem more effectively? I just want to see the error in action myself."

> Absolutely. Here's what I have so far...

http://creamyg.jdluke.com/Projects/MUGEN/Characters/Creamy_Goodness/CGX_Creamy/CGX_Creamy(v0.1.6_b01).zip

----------

Cyanide - "Edit: reread. Your destroyself has a trigger on movecontact. If you hit thats true. So the helper goes away. Take trigger4 off the destroyself."

> The DestroySelf only kicks in if the projectile is in it's eighth and final form, as stated by the line triggerall = Anim = 3568. The projectile begins using Animation 3561, and moves onto the next animation after every bounce until the last one at 3568. Until the projectile reaches Animation 3568, it should not self destruct. The ball only disappears early if it hits the opponent, and not the walls or the floor. Still, I can dick around with the coding some more and give you whatever results I come up with.
= = = = = = = = = =
Jason "Creamy Goodness" Tenn
http://creamyg.jdluke.com/
Re: Projectile Type Helper Hits Only Once
#5  April 30, 2019, 02:11:35 pm
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
I don't have a solution but I think I found the root of the problem.

I commented all the "movecontact" triggers and it no longer poofs out of existence.

The reason it was poofing out of existence is because the MoveContact triggers allow it to instantly blaze through all the anim controllers and destroyself

Last Edit: April 30, 2019, 02:34:28 pm by altoiddealer
Re: Projectile Type Helper Hits Only Once
#6  April 30, 2019, 03:07:44 pm
  • *****
  • Hug Pikachus!
    • USA
I don't have a solution but I think I found the root of the problem.

I commented all the "movecontact" triggers and it no longer poofs out of existence.

The reason it was poofing out of existence is because the MoveContact triggers allow it to instantly blaze through all the anim controllers and destroyself

I agree, based on the quick testing I have done with the character.

I hypothesize that when the game is checking the triggers, they check move contact based on every frame. So it goes like this:

Time = X: Projectile connects, change animation
Time = X+1 frame: Projectile connects, change animation
Time = X+2 frame: Projectile connects, change animation

Time = X+2 frame: Projectile connects, destroy self.

I believe the problem is that the projectile moves too slow, so to speak. Therefore, when it changes animation, it is still "connecting" (i.e. red boxes touching blue) and moves onto the next animation. Since most of our MUGEN programs run at 30 or 60 frames per second, it zooms through those triggers and animations quicker than one can blink.

I'm not exactly too certain exactly how you would like to go about fixing this since this is your project and you alone have knowledge of how the move should work, but playing with the triggers on when the animation changes is a good place to start.
Hug the Pikachus!

Hug A Pikachu Today!
Last Edit: April 30, 2019, 03:11:11 pm by DNZRX768
Re: Projectile Type Helper Hits Only Once
#7  April 30, 2019, 03:21:25 pm
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
When movecontact is flagged it persists while the player is still in the attack state.

What you probably want to do is use MoveHitReset, and work in some kind of cooldowns on your HitDef and the other triggers.  Probably stick a MoveHitReset after every ChangeAnim controller.

Re: Projectile Type Helper Hits Only Once
#8  May 01, 2019, 03:05:53 pm
  • ***
    • USA
    • creamyg.jdluke.com/

> Hey guys, just a quick update. After a little bit of experimentation, I made two changes to the Jawbreaker Jamboree's code that may have fixed the problem. First, I added the following state controller between the Turn and ChangeAnim controllers. This prevented the projectile from disappearing prematurely when hitting the opponent...

[State 3560, MoveHitReset]
type = MoveHitReset ;type of state: Move Hit Reset
;^forces projectile to only hit for one frame per hit
trigger1 = MoveContact ;kicks in when projectile hits opponent

----------

> Second, I added the following trigger to the HitDef in order to make sure the projectile hits only once per bounce...

trigger1 = P2MoveType != H ;Player 2 is not being hit

----------

> I would like to thank all of you for taking the time to look into this issue and helping me fix it. As for now, I think it's time to mark this topic Solved.

= = = = = = = = = =
Jason "Creamy Goodness" Tenn
http://creamyg.jdluke.com/