Hi,I want to set ONLY the FIRST bit from 1 to 0, how do you do that in MUGEN? '~' operator seems not working Posted: January 18, 2021, 07:31:54 amSorry, some sad workaround discovered is Var(n) & 2147483646) but this is horrible...Wonder if anyone can share a better solution? Or this is the ONLY solution in MUGEN? Posted: January 18, 2021, 07:35:59 amThe end result is unstable... (Var(n) := Cond((Random % 2), (Var(n) | 2**0), Var(n) & 2147483646))Sometimes it will be 1 even if Random % 2 returns 0... really need help on what is going on ? Posted: January 18, 2021, 07:47:36 amCan someone help me if what would be a good BIT FLAG expression replacement in a Null SCTRL on below VarSet SCTRL ?[State 10001, Var(1)Set] type = VarSettrigger1 = (Time = 0)v = 1 value = Random % 2ignorehitpause = 1persistent = 0
If the VarSet works then why does it need to be a Null? You can assign bits via VarSet too.Regardless...Code: [State n, Null]type = Nulltriggerall = time = 0trigger1 = random%2 = 0 && (var(n)&1) = 1trigger1 = 1||var(n) := (var(n)&1)-1trigger2 = random%2 = 1 && (var(n)&1) = 0trigger2 = 1||var(n) := (var(n)|1)
trigger method: Trigger1 = 1||var(n):=(var(n)|1)-1Or varset method var(n) = (var(n)|1)-1 Posted: April 08, 2021, 07:38:18 amWith fvarTrigger method: trigger1 = 1||fvar(n):=(floor(fvar(n))|1)-1Varset method: fvar(n) =(floor(fvar(n))|1)-1