The Mugen Fighters Guild

Help => M.U.G.E.N Development Help => Topic started by: Disconcorde on October 03, 2019, 01:11:12 am

Title: Detecting Custom States without variables?
Post by: Disconcorde on October 03, 2019, 01:11:12 am
I learnt that p1 can detect if they are in a custom state because -3 isn't processed then, while -2 is. So with a simple var, you could detect it like so:

Code:
In -3:
[State -3]
Type = VarSet
trigger1 = 1
var(1) = gametime

In -2:
[State -2]
Type = VarSet
trigger1 = 1
var(2) = var(1) = gametime

Var 2 should return 0 if p1 is in a custom state. I'd like to use this, but the char I'm editing no longer has any free vars for me to use.
Is there another way, independent of vars?
Title: Re: Detecting Custom States without variables?
Post by: DarkWolf13 on October 03, 2019, 02:20:19 am
You can try to use a helper that doesn't have a destroyself sctrl and constantly updates itself at all times. Helper states don't share the same variable pool as the root/parent unless you use ParentVarset/ParentVarAdd.

Example:
Code:

;In Root/Parent states
[State 0, VarSet]
type = VarSet
trigger1 = time = 0
var(14) = 1

;In Helper State
[State 0, VarSet
type = VarSet
trigger1 = time = 0
var(14) = 1

If the helper uses Var(14), that variable is the helper's own variable as it doesn't share it with the root/parent so anything the root/parent uses that involves var(14) will have no effect on the helper nor will the helper's var(14) have any effect on the root/parent.

Title: Re: Detecting Custom States without variables?
Post by: Cyanide on October 03, 2019, 08:04:29 am
Unless you meant to redirect there... hes got no variables free. Explods if your detection doesn't have to be instant.

State -3. Keep creating an invisible explod with a removetime of 1. State -2 detect if the explod exists. If you're in a custom state you'll stop spawning it. Might be a 1 tick delay though.
Title: Re: Detecting Custom States without variables?
Post by: JustNoPoint on October 03, 2019, 07:16:31 pm
There is no delay unless the explod is created by a helper
Title: Re: Detecting Custom States without variables?
Post by: Disconcorde on October 04, 2019, 04:43:28 pm
@Cyanide

Your explod method worked! Thanks.