News:

MFG's Character of the Month: October 2026 Nominations

Main Menu

Syntax for a trigger on a Changestate

Started by DrStrange, January 27, 2010, 05:52:12 PM

Previous topic - Next topic

DrStrange

So i have a move with an animation and I want the state to change when either the player moves or hits any button, or they are hit by p2. What would the syntax be for that change state.


[State 2000, 1]
type = ChangeState
trigger1 = ;if the player moves in any direction
trigger2 = ;if the player hits any button
trigger3 = ;if the player gets hit
value = 660      ; new state


Thanks

Cybaster

trigger 1 & 2 : "command="a" || "command="b" || ...

trigger 3 : Movetype = H

DrStrange

That did it. Thanks so much.

And just curious, is there some place else I could have gone (some documentation) that I could have found the answer to this?


Byakko

Your mugen/docs folder, or http://mugenguild.com/docs/ (in this case the trigger.html documentation)
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.

Rajaa Retired

Trigger 3 would be useless. Use a hitoverride instead.

Byakko

I don't see why, movetype = H is just fine. As long as it's really what he wants.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.

PotS

Because by the time he's in movetype=H he'll already be in another state.
You can help with Ikemen GO's development by trying out the latest development build and reporting any bugs on GitHub.
My Mugen and Ikemen content can also be found here.

Byakko

... Uh ? He gets hit (movetype = H), he goes to the state he wants (the changestate he's making). Isn't that what he wants ?
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.

DrStrange

Here is what I wanted to accomplish with Movetype = H.

Player1 will be in a state, player 1's state will change if one of 2 things happen.

1. If player 1 moves at all, up down, punch, kick anything.

OR

2. Player 2 hits player 1.

When I added the trigger2 = Movetype = H, it worked. When player 1 is in the state and player 2 hits player 1, the state changes correctly.

Rajaa Retired

That's strange, but as long as it works how you want it to. :ninja:

Byakko

I can't see what's strange with it :S It's a simple and straightforward solution that doesn't require an additional sctrl. Changestate when you get hit => triggerblah = movetype = H.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.

Rajaa Retired

Like, when you're in a state, and you're hit, you go to the hitstates, and then your movetype becomes Hit, so I don't see how it works in the state itself. I even just tested it out for myself and it doesn't work like that.

Byakko

Who said it was in the state itself ? It's in statedef -1 in the cmd.
... Oh wait, it does say [state 2000, 1]. :( But it can work if it's put in a negative state (and then it requires an additional trigger on the prevstateno).
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.

Rajaa Retired


DrStrange

Here is the code I used and it works exactly how I want it too. Should it not work?

[StateDef 2000]   
type = S
movetype= I
physics = N
juggle  = 15
ctrl = 0
anim = 2000

;[State 2000, sndx]
;type = PlaySnd
;trigger1 = time = 1
;value = 20,8

[State 2000, 1]
type = LifeAdd
trigger1 = time = 120
value = 50

[State 2000, 1]
type = LifeAdd
trigger1 = time = 240
value = 75

[State 2000, 1]
type = LifeAdd
trigger1 = time = 360
value = 100

[State 2000, 1]
type = LifeAdd
trigger1 = time = 480
value = 200


[State 2000, 2]   
type = ChangeState     
trigger1 = command = "a" || command="b" || command="x" || command="y" || command = "holdfwd" || command = "holdback" || command = "holdup" || command = "holddown"
trigger2 = Movetype = H
trigger3 = time = 481   
value = 660       
ctrl = 0

Byakko

Oh, yeah. It's indeed not normal if it works when you get hit without pressing any button and before 481 ticks have passed :blank:
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.

DrStrange

I will take a video tonight and post it, if it helps.

DrStrange

Ok, so this is weird. When I was testing I was using a light punch from P2 and it seemed to work as I wanted. But now I tested it with a heavy punch and the state did not change. Odd.

So it looks like I need to use a hitoverride. I read the doc on it but it did not make sense to me. Could someone give me a piece of example code with it in use?

Thanks

Rajaa Retired

Hitoverride is simple

First you need to know what attributes are, it tells you to check out the hitdef-documentation for that, you should doso.

state
type - hitoverride
trigger - whatever
attr - read up on it
stateno - state number you want to be changed to when this is activated
slot - up to 8 slots 0-7, only one active on one slot at a time
time - how long it lasts after triggered

DrStrange

I want the trigger to be p1 getting hit correct? So wouldn't that bring me back to movetype = H for trigger?