The Mugen Fighters Guild

Help => M.U.G.E.N Development Help => Topic started by: George777 on February 09, 2021, 09:43:15 pm

Title: Reading Target Commands With Helpers?
Post by: George777 on February 09, 2021, 09:43:15 pm
This is a follow-up from this thread: https://mugenguild.com/forum/topics/changeanim2-doesnt-use-my-animations--192379.0.html

So I managed to create a system where the opponent is held in place (and made invisible) by a Helper, for the sake of using my own animations, when the opponent gets hit.

So now, I have a new problem. I wanted to have a system where a variety of animations could play, depending on the opponent's inputs, while being bound. I used the typical "Target, Command" function and nothing happened. I've been trying a lot of different solutions, but I'm starting to get the suspicion that Helpers can't read Target commands, at all.

Here's the base code so far:

Code:
;Grab Helper
[Statedef 4000]
type = A
movetype= H
physics = N
anim = 4000
velset = 0,0
sprpriority = 5

[state PressBack]
type = changeanim
trigger1 = anim = 4000
trigger1 = target, command = "holdback"
value = 4007

[state ReturntoNeutral]
type = changeanim
trigger1 = anim != 4000
trigger1 = animtime = 0
value = 4000

Could someone more experienced confirm to me, that Helpers are not capable of reading Target commands? Or barring that, if there's some kind of error in this code?

(I know that using "Parent, Command" can allow my own commands to be read from a Helper, btw)

If Helpers aren't capable of directly reading Target commands, what would you suggest as the simplest solution?

Also, to those who helped me out in the previous thread, thanks :thumbsup:
Title: Re: Reading Target Commands With Helpers?
Post by: PlasmoidThunder on February 09, 2021, 11:33:51 pm
Target command only works if there is a target; the target is not shared, meaning only the player or Helper that actually hit the opponent has a target. What you want is a double redirect like root,target,command, which isn't possible in that exact form, but can be replicated with the cond() exploit (https://mugenguild.com/forum/topics/redirects-redirects-and-new-redirects-cond-exploit-185881.0.html).

For this particular example, it would look like this:
Code:
[state PressBack]
type = changeanim
trigger1 = anim = 4000
trigger1 = root,cond(numtarget,target,cond(1,command = "holdback",0),0)
value = 4007
Title: Re: Reading Target Commands With Helpers?
Post by: George777 on February 09, 2021, 11:55:05 pm

That's... such a bizarre workaround. But hey, it works. Thanks! :thumbsup:
Title: Re: Reading Target Commands With Helpers?
Post by: XGargoyle on February 10, 2021, 11:14:48 am
or, if you don't mind the 1-tick delay (or more depending the number of helpers you have), it may be possible for the helper to set a variable depending on target,command and then the root player just needs to acces the helper's variable