YesNoOk
avatar

helper too slow to read enemy,GetHitVar (Read 16883 times)

Started by inktrebuchet, April 03, 2018, 06:53:38 pm
Share this topic:
helper too slow to read enemy,GetHitVar
#1  April 03, 2018, 06:53:38 pm
  • ****
    • USA
    • twitter.com/inktrebuchet
Okay guys, so I have been working on this reflector for a while now. Everything coded in one character, no edits to other characters needed and no it's not to replace Vans', blah blah blah. https://i.imgur.com/lZWYBgH.mp4

Here is the final hurdle: getting hitdef data to the reflected projectile.
This is a simple bit of code I assumed would work in a helper but surprise, it doesn't. Apparently the 1 tick delay helpers have is enough to miss these completely and no values are set.(this piece of code works fine in the root.)

So how can I get all of these values to a helper outside of putting them all in my characters root first?....
 :thinking2:

Code:
;test code
[state n]
type = null
trigger1 = enemy,GetHitVar(damage) > 0
trigger1 = var(6) != enemy,GetHitVar(damage)
trigger1 = var(6) := enemy,GetHitVar(damage)
ignorehitpause = 1

Actual data I plan on getting once that small piece works out:
Spoiler, click to toggle visibilty
Last Edit: April 04, 2018, 09:53:44 pm by ink
Re: helper too slow to read enemy,GetHitVar
#2  April 03, 2018, 11:02:14 pm
  • ******
    • www.justnopoint.com/
Why are you trying to use a redirect to get this info? Why not just add these directly to the reflector helper? And set vars so it can carry them over into the reflected helper.
Re: helper too slow to read enemy,GetHitVar
#3  April 03, 2018, 11:53:02 pm
  • ****
    • USA
    • twitter.com/inktrebuchet
I thought it would have to be done with redirects because the reflected projectile is actually spawned by the same character that originally threw it.

Making the reflector state itself a helper might be the best option. Currently I’m just using his guard state as the reflector state. I’ll give it a try! Thanks
Re: helper too slow to read enemy,GetHitVar
#4  April 04, 2018, 01:25:35 am
  • ******
    • www.justnopoint.com/
You can also look at armor on Buu or SSJ3 armor on Gotenks to see more examples of ways to use gethitvar to store info
Re: helper too slow to read enemy,GetHitVar
#5  April 04, 2018, 12:35:13 pm
  • *****
  • Shame on you!
    • USA
Apparently the 1 tick delay helpers have is enough to miss these completely and no values are set.(this piece of code works fine in the root.)

So how can I get all of these values to a helper outside of putting them all in my characters root first?....
 :thinking2:
Have you tried setting the value at the 2nd or 3rd tic?
I'm imagining it's kinda like my Noob's, "P2 creates the helper", problem. But if not, could you just not set the hitdef until the 2nd or 3rd tic? Set the state to idle then attack after mugen has time to update it. I mean in an extreme instance it could be possible that the thing is reflected and hits P2 in 1 tic but idk about all that.

Also
    ;test code
    [state n]
    type = null
    triggerall = var(6) != enemy,GetHitVar(damage)
    trigger1 = var(6) := enemy,GetHitVar(damage)
    ignorehitpause = 1
I think this could be a little faster than what you have? I guess you're going to do a giant list of := so the triggerall might not be the best. Does mugen auto skip all of the trigger1 if the top one fails? I thought if the top trigger1 fails it'll still read the 2nd and 3rd and 4th and on down trigger1. If not I'd just drop that first check. Seems redundant to me.

I was going to suggest using Altoid's method of using GetHitVar(fall.envshake.ampl) to keep track of variables across state lines but if you cant read the gethitvar fast enough idk. I totally forgot about this trick and I'm thinking my noob problem may benefit from it.
vVv Ryuko718 Updated 10/31/22 vVv
Re: helper too slow to read enemy,GetHitVar
#6  April 04, 2018, 02:25:47 pm
  • ****
    • USA
    • twitter.com/inktrebuchet
The helper with that code exists from the start of the round so it’s not a problem with it needing a couple ticks to spawn.

GetHitVar(damage) flips back to 0 directly after move contact so > 0 was needed. In fact if ignorehitpause is missing from the code it won’t write it to a var in root either. I’m still surprised the helper would miss it all together, since it exists the whole time.

I thought of altoid’s method too but there are so many var I need to move.
Last Edit: April 04, 2018, 02:43:14 pm by ink
Re: helper too slow to read enemy,GetHitVar
New #7  April 04, 2018, 09:53:28 pm
  • ****
    • USA
    • twitter.com/inktrebuchet
I ended up using a helper as the reflectors hurtbox, that successfully puts all of those gethitvars in a helper. I was able to transfer that helpers vars to the enemys *reflected projectile using Altoids method to get that players ID. (fall.envshake.freq also works fine in projectile sctrl.)

I just need to polish it up and test it for bugs. Thanks for your help!
Last Edit: April 04, 2018, 11:29:24 pm by ink