Stop Moving! Crouching, Walking, Jumping still? Look in here!
#1
Provided by Lillie's 音MADs
Simply copy this into your .cns to stop the character from moving in common states.
This works with the AI Template as described in #quick_start_ai_patches!
Without a Var(59) as established to check if the AI is ON/OFF in the AI template, this code will not work.

"Plug and play

Just tell people that they may need to alter it in case of custom walk states"



; Stand to Crouch
[Statedef 10]
type    = C
physics = C
anim = 10

[State 10, 1]
type = VelMul
trigger1 = Time = 0
x = .75

[State 10, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 11

[State 10]
Type=Changestate
Triggerall=time=0
triggerall = var(59) > 0
trigger1 = command = "holddown"
value=0;
ctrl=1
;---------------------------------------------------------------------------
; Crouching
[Statedef 11]
type    = C
physics = C
anim = 11
sprpriority = 0

[State 11, 1] ;Change from turning animation
type = ChangeAnim
trigger1 = Anim = 6 && AnimTime = 0
value = 11

[State 11]
Type=Changestate
Triggerall=time=0
triggerall = var(59) > 0
trigger1 = command = "holddown"
value=0;
ctrl=1
;---------------------------------------------------------------------------
; Crouch to Stand
[Statedef 12]
type    = S
physics = S
anim = 12

[State 12, 1]
type = ChangeState
trigger1 = AnimTime = 0
value = 0

[State 12]
Type=Changestate
Triggerall=time=0
triggerall = var(59) > 0
trigger1 = command = "holddown"
value=0;
ctrl=1
;---------------------------------------------------------------------------
; Walk
[Statedef 20]
type    = S
physics = S
sprpriority = 0

[State 20, 1]
type = VelSet
trigger1 = var(59) <= 0
trigger1 = Command = "holdfwd"
x = Const(Velocity.Walk.Fwd.X)

[State 20, 2]
type = VelSet
trigger1 = var(59) <= 0
trigger1 = Command = "holdback"
x = Const(Velocity.Walk.Back.X)

[State 20, 3]
type = ChangeAnim
triggerall = vel x > 0
trigger1 = Anim != 20 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 20

[State 20, 4]
type = ChangeAnim
triggerall = vel x < 0
trigger1 = Anim != 21 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 21


; 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]
Type=Changestate
Triggerall=time=0
triggerall = var(59) > 0
trigger1 = command = "holdup"
value=0;
ctrl=1

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

[State 40, 3]
type = VarSet
triggerall = var(59) <= 0
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 40, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1

I'm here to help, so feel free to ask!

Reply