character transofrmations

Started by serpenter, November 01, 2007, 06:07:40 PM

Previous topic - Next topic

serpenter

i have started to add transformations to my haracters, using the code from here:
http://mugenguild.com/forumx/index.php?topic=43756.msg264688#msg264688
however, once the character is in a transformed state, the animations for the sprites arn't occuring... it just stays as the same image.

can anyone help?
if ya need see the code i'll post it up here.
thanks

DavidGee

Then you must be triggering ChangeAnim repeatedly instead of once. You can try the "persistent = 0" in the ChangeAnim or "trigger1 = anim != (the action number)".

serpenter

hey, tha worked ^^ thanks.

EDIT: i got to editing the jmp, on the common, and now it keeps jumping... any ideas for that?

Bastard Mami

post your code, as you seem to have broken it.

serpenter

; Jump Start
[Statedef 40]
type    = S
physics = S
anim = 40
ctrl = 0
sprpriority = 1

[State 40, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 40, 2]
type = VarSet
trigger1 = command = "holdfwd"
sysvar(1) = 1

[State 40, 3]
type = VarSet
trigger1 = command = "holdback"
sysvar(1) = -1

[State 40, 4]
type = VelSet
trigger1 = AnimTime = 0
x = ifelse(sysvar(1)=0, const(velocity.jump.neu.x), ifelse(sysvar(1)=1, const(velocity.jump.fwd.x), const(velocity.jump.back.x)))
y = const(velocity.jump.y)

[State 40, 5]
type = VelSet
trigger1 = AnimTime = 0
trigger1 = prevstateno = 100 ;RUN_FWD
trigger1 = sysvar(1) = 1
x = const(velocity.runjump.fwd.x)

[State 10040, 6]
type = ChangeAnim
triggerall = (Var(0) <= 0)
trigger1 = AnimTime = 0
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 40

[State 45, 6]
type = ChangeState
trigger1 = Time = 2
value = 50
ctrl = 1

[State 10040, 6]
type = ChangeAnim
triggerall = (Var(0) > 0)
trigger1 = AnimTime = 0
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 10040

[State 45, 7]
type = ChangeState
trigger1 = Time = 2
value = 10050
ctrl = 1
;---------------------------------------------------------------------------
; AirJump Start
[Statedef 45]
type    = A
physics = N
ctrl = 0
velset = 0,0

[State 45, 1]
type = ChangeAnim
trigger1 = SelfAnimExist(44)
value = 44

[State 45, 2]
type = ChangeAnim
trigger1 = !SelfAnimExist(44)
value = 41

[State 45, 3]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 45, 4]
type = VarSet
trigger1 = command = "holdfwd"
sysvar(1) = 1

[State 45, 5]
type = VarSet
trigger1 = command = "holdback"
sysvar(1) = -1

[State 45, 6]
type = VelSet
trigger1 = Time = 2
x = ifelse(sysvar(1)=0, const(velocity.airjump.neu.x), ifelse(sysvar(1)=1, const(velocity.airjump.fwd.x), const(velocity.airjump.back.x)))
y = const(velocity.airjump.y)

[State 45, 7]
type = ChangeState
trigger1 = Time = 2
value = 50
ctrl = 1
;---------------------------------------------------------------------------
; Jump Up
[Statedef 50]
type    = A
physics = A

[State 50, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 50, 2]
type = ChangeAnim
trigger1 = Time = 0
value = ifelse((vel x)=0, 41, ifelse((vel x)>0, 42, 43))

[State 50, 3]
type = ChangeAnim
triggerall = (Var(0) <= 0)
trigger1 = Anim != 0 && Anim != 5
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim + 3)
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
persistent = 0
value = Anim + 3

[State 10050, 3]
type = ChangeAnim
triggerall = (Var(0) > 0)
trigger1 = Anim != 0 && Anim != 5
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim + 3)
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
persistent = 0
value = Anim + 3
;---------------------------------------------------------------------------
; Jump Down (empty state for compatibility)
[Statedef 51]
type    = A
physics = A

[State 51, 1]
type = Null
trigger1 = 1

;---------------------------------------------------------------------------
; Jump Land
[Statedef 52]
type    = S
physics = S
ctrl = 0
anim = 47

[State 52, 1]
type = VelSet
trigger1 = Time = 0
y = 0

[State 52, 2]
type = PosSet
trigger1 = Time = 0
y = 0

[State 52, 3]
type = CtrlSet
trigger1 = Time = 3
value = 1

[State 52, 4]
type = ChangeAnim
triggerall = (Var(0) <= 0)
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 0

[State 10052, 4]
type = ChangeAnim
triggerall = (Var(0) > 0)
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 10001

Ehm... that bit?

Bastard Mami

Quote from: serpenter on November 01, 2007, 08:01:58 PM
; Jump Start
[Statedef 40]
type    = S
physics = S
anim = 40
ctrl = 0
sprpriority = 1

[State 40, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 40, 2]
type = VarSet
trigger1 = command = "holdfwd"
sysvar(1) = 1

[State 40, 3]
type = VarSet
trigger1 = command = "holdback"
sysvar(1) = -1

[State 40, 4]
type = VelSet
trigger1 = AnimTime = 0
x = ifelse(sysvar(1)=0, const(velocity.jump.neu.x), ifelse(sysvar(1)=1, const(velocity.jump.fwd.x), const(velocity.jump.back.x)))
y = const(velocity.jump.y)

[State 40, 5]
type = VelSet
trigger1 = AnimTime = 0
trigger1 = prevstateno = 100 ;RUN_FWD
trigger1 = sysvar(1) = 1
x = const(velocity.runjump.fwd.x)

[State 10040, 6]
type = ChangeAnim
triggerall = (Var(0) <= 0)
trigger1 = AnimTime = 0
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 40

[State 45, 6]
type = ChangeState
trigger1 = Time = 2
value = 50
ctrl = 1

[State 10040, 6]
type = ChangeAnim
triggerall = (Var(0) > 0)
trigger1 = AnimTime = 0
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 10040

[State 45, 7]
type = ChangeState
trigger1 = Time = 2
value = 10050
ctrl = 1
;---------------------------------------------------------------------------
; AirJump Start
[Statedef 45]
type    = A
physics = N
ctrl = 0
velset = 0,0

[State 45, 1]
type = ChangeAnim
trigger1 = SelfAnimExist(44)
value = 44

[State 45, 2]
type = ChangeAnim
trigger1 = !SelfAnimExist(44)
value = 41

[State 45, 3]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 45, 4]
type = VarSet
trigger1 = command = "holdfwd"
sysvar(1) = 1

[State 45, 5]
type = VarSet
trigger1 = command = "holdback"
sysvar(1) = -1

[State 45, 6]
type = VelSet
trigger1 = Time = 2
x = ifelse(sysvar(1)=0, const(velocity.airjump.neu.x), ifelse(sysvar(1)=1, const(velocity.airjump.fwd.x), const(velocity.airjump.back.x)))
y = const(velocity.airjump.y)

[State 45, 7]
type = ChangeState
trigger1 = Time = 2
value = 50
ctrl = 1
;---------------------------------------------------------------------------
; Jump Up
[Statedef 50]
type    = A
physics = A

[State 50, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 50, 2]
type = ChangeAnim
trigger1 = Time = 0
value = ifelse((vel x)=0, 41, ifelse((vel x)>0, 42, 43))

[State 50, 3]
type = ChangeAnim
triggerall = (Var(0) <= 0)
trigger1 = Anim != 0 && Anim != 5
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim + 3)
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
persistent = 0
value = Anim + 3

[State 10050, 3]
type = ChangeAnim
triggerall = (Var(0) > 0)
trigger1 = Anim != 0 && Anim != 5
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim + 3)
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
persistent = 0
value = Anim + 3
;---------------------------------------------------------------------------
; Jump Down (empty state for compatibility)
[Statedef 51]
type    = A
physics = A

[State 51, 1]
type = Null
trigger1 = 1

;---------------------------------------------------------------------------
; Jump Land
[Statedef 52]
type    = S
physics = S
ctrl = 0
anim = 47

[State 52, 1]
type = VelSet
trigger1 = Time = 0
y = 0

[State 52, 2]
type = PosSet
trigger1 = Time = 0
y = 0

[State 52, 3]
type = CtrlSet
trigger1 = Time = 3
value = 1

[State 52, 4]
type = ChangeAnim
triggerall = (Var(0) <= 0)
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 0

[State 10052, 4]
type = ChangeAnim
triggerall = (Var(0) > 0)
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 10001

Ehm... that bit?

where is state 10050 ?

i mthink you still want to change to state50.

serpenter

10050 is jump up...
anyhow, i have got it so when in the normal state thingy you can jump, but when in the transformed state, and you jump, it changes the sprite, however jumps repeatedlky (as said erlier)
thanks for your help... if you have any ideas on what i have done wrong, let us know.

Cyanide

I see no statedef 10050 in there. I see a
[State 10050, 3]
type = ChangeAnim
triggerall = (Var(0) > 0)
trigger1 = Anim != 0 && Anim != 5
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim + 3)
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
persistent = 0
value = Anim + 3

but that bits really just an identifier, you can't jump to those. state 9847373 in there would work as well.


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.

serpenter

#8
Quote from: Cyanide on November 01, 2007, 08:48:12 PM
I see no statedef 10050 in there. I see a
[State 10050, 3]
type = ChangeAnim
triggerall = (Var(0) > 0)
trigger1 = Anim != 0 && Anim != 5
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim + 3)
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
persistent = 0
value = Anim + 3

but that bits really just an identifier, you can't jump to those. state 9847373 in there would work as well.

oh... ok. i didnt know that XD

hmm...
i sorta understand the simple parts of this, like, i can add the change animation to the standing for example,  but when i try to apply the change animation like on the standing animation, to the jumping one, it doesent work... i dont know what im doing wrong, however, if anyone can direct me as to where it has to go?...
XD

EDIt: never mind. if found it XD