News:

MFG's Character of the Month: October 2026 Nominations

Main Menu

command problems

Started by DR119, December 29, 2017, 09:15:04 PM

Previous topic - Next topic

DR119

I want an explod to be displayed if c is pressed, but it doesn't work. I already tried to leave out the part with the random var to make sure that something's wrong with the command.
What have I done wrong?

Code in the cmd:
[Command]
name = "c"
command = c
time = 1
[state -1]
type = ChangeState
value = 300
trigger1 = command = "c"

In the cns:
[statedef 300]
type = S
movetype = A
physics = S

[state 300, 1]
type = VarSet
trigger1 = StateNo = 300
var(22) = random

[state 300, 2]
type = explod
trigger1 = var(22)>499
anim = f300
id = 300

Jesuszilla

F300 is saying to use an animation from fightfx. Does it exist there, and is that your intention? If not, remove the F so it references the character animations.

Additionally, you're still checking for var(22), which is random.

altoiddealer

Side note: If you are in State 300, then "trigger1 = StateNo = 300" will be true every tick.
As a result, var(22) will be randomized every tick.

I think what you want instead is "trigger1 = Time = 0"


Also side note, another way to quickly do a coin toss is "GameTime%2 = 0"
Every tick, this will return either 0 or 1, which also alternates every tick.
So, a 50% chance of triggering if checked for 1 tick.

So, unless you are using Var(22) for something else, you could just do this:

[state 300, 2]
type = explod
trigger1 = Time = 0
trigger1 = GameTime%2 = 0
anim = 300
id = 300


DR119

Quote from: Jesuszilla on December 29, 2017, 09:48:26 PM
F300 is saying to use an animation from fightfx. Does it exist there, and is that your intention? If not, remove the F so it references the character animations.

Additionally, you're still checking for var(22), which is random.

The explod's sprites are in fightfx.sff, so that's not the problem. Strangely, if I change the state number to -2, the explod gets displayed correctly (only without the input) . So I assume that there's an error in the cmd code or state 300.

inktrebuchet

#4
It may have to do with whatever else is in state 300. Maybe the state changes before the explod can appear.

Cyanide

Do you enter state 300 at all is the question here. Turn on debug and see if you hit it ever. Make sure there isn't another one. And because I've seen this too many times. Copy paste your command changestate below itself and try again


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.

Odb718

"I want an explod to be displayed if c is pressed, but it doesn't work."
If this ^^^ is actually what you want, you shouldn't have your character go into a new state just to have an explod appear.
If you mean you want and explod to be displayed some of the times while in statedef 300, this is kinda close.

Your changestate in -1 sucks. Especially because Statedef 300 is barely defined. That and you have it as a standing attack but dont have any restrictions on your changestate to stop it from starting in the air.

If your statement at the top is actually what you want, try this in Statedef -2


[State -2, Explod]
type = Explod
triggerall = numexplod(300) = 0
trigger1 = command = "c"
trigger1 = GameTime%2 = 0
anim = 300
id = 300
pos = 0,0
postype = p1
ignorehitpause = 1
vVv Gouken718 vVv SabreTooth718 vVv