YesNoOk
avatar

V-Ism coding problem (Read 1718 times)

Started by Shadow_Soldier, January 24, 2010, 10:37:26 pm
Share this topic:
V-Ism coding problem
#1  January 24, 2010, 10:37:26 pm
  • *
Hey, check this code out. Its a V-ism code and the problem here is that when you get hit while in v-ism, you still stay in v-ism. Seems like this code can only be reset after the round is over. Not only that, V-ism lasts forever and won't time out either.

It seems that the "[state -3 varset]" does'nt work..
I've been trying to get it to work properly but I don't know where the problem lies.

Btw, this code is not written by me.


===========
SFZ2 V-Ism
===========
Author: Doctor M
mguasti@ciudad.com.ar
http://www.brutalpaws.cjb.net

---------------------------------------------------------------------------
This is an immitation of the cool Custom Combo of Street Fighter Zero 2.
You use a state to start the mode, then proceed to walk very fast towards
your enemy. The attacks are super fast, cancellable, and there is no juggle
check, so large air combos are OK.
---------------------------------------------------------------------------

OK, in this example we are using Var(0) as the Mode Timer.

It would be a good idea to add this VelSet to every stand/crouch attack, to
keep close to your enemy. Eg.

[State 200: VelSet]
type = Velset
trigger1 = Var(0) > 0
x = 4

Then, open up the CMD file. We need to make sure that all the attacks can be cancelled freely.
Add the following line to the existing triggers:

;Stand Light Punch
[State -1: ChangeState]
type = ChangeState
value = 200
triggerall = (Command = "x") && (Command != "holddown")
trigger1 = (StateType = S) && (Ctrl)
trigger2 = (StateNo = 200) && (Time > 6)
trigger3 = (StateType = S) && (MoveContact) && (Var(0) > 0) ;<--------------------- This one!!!

Also, add a ChangeState to use the mode change. Here is the one I used:

[State -1: ChangeState]
type = ChangeState
value = 9000
triggerall = (Power > 1000) && (Var(0) = 0)
trigger1 = (Command = "recovery") && (StateType = S) && (Ctrl)

Now, the change mode state:

[Statedef 9000]
type = S
movetype = I
physics = S
anim = 195
ctrl = 0
velset = 0,0
sprpriority = 2

[State 9000: SuperPause]
type = SuperPause
trigger1 = [Insert trigger here.]
pos = 15, -77
anim = 100
sound = 20, 0
poweradd = -1000

[State 9000: AfterImage]
type = AfterImage
trigger1 = [Insert trigger here.]
time = 2
length = 30
palbright = 0, 0, 0
palcontrast = 100,100,190
paladd = 0,0,30
palmul = .45,.45,.75
timegap = 1
framegap = 4
trans = add

The value assigned to Var(0) determines the length of the mode.

[State 9000: VarSet]
type = VarSet
trigger1 = (!Time)
v = 0
value = 300

[State 9000: ChangeState]
type = ChangeState
trigger1 = (AnimTime = 0)
value = 0
ctrl = 1

We need a state that makes the player walk forward, so...

[Statedef 9001]
type = S
physics = S
anim = 20
sprpriority = 1

[State 9001: VelSet]
type = VelSet
trigger1 = 1
x = 6

[State 9001: AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = NoWalk
flag2 = NoAutoTurn

[State 9001: ChangeState]
type = ChangeState
trigger1 = Var(0) = 0
value = 0
ctrl = 1

To make it work right, override State 0 by adding this state:

[Statedef 0]
type = S
physics = S
sprpriority = 0

[State 0, 1]
type = ChangeAnim
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 0

[State 0, 2]
type = VelSet
trigger1 = Time = 0
y = 0

[State 0, 3] ;Stop moving if low velocity or 4 ticks pass
type = VelSet
trigger1 = abs(vel x) < 2
trigger2 = Time = 4
x = 0

This is the new state added to the standing:

[State 0: ChangeState]
type = ChangeState
trigger1 = (Var(0) > 0)
value = 9001
ctrl = 1

And now, the -3's...

[Statedef -3]

[State -3: VarAdd]
type = VarAdd
trigger1 = (Var(0) > 0)
v = 0
value = -1
ignorehitpause = 1

Cancel V-Ism Mode if you get hit or win the round.

[State -3: VarSet]
type = VarSet
trigger1 = (MoveType = H) || (Roundstate = 3)
v = 0
value = 0

Sorrowedge's Haste Code (tm), modified for faster anims.

[State -3: ChangeAnim]
type = ChangeAnim
triggerall = (Var(0) > 0) && (RoundState = 2) && (MoveType != H)
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
trigger1 = AnimElemTime(AnimElemNo(0)) > floor ((AnimElemTime(AnimElemNo(0)) - AnimElemTime(AnimElemNo(0) + 1))/3)
ignorehitpause = 1
value = Anim
elem = AnimElemNo(0) + 1

PalFX's during the mode.

[State -3: PalFX]
type = PalFX
trigger1 = (Var(0) > 0) && ((GameTime%3) = 0)
time = 2
add = 0,16,132
sinadd = 5,32,164,2

This ensures that the AfterImages are displaying during mode.

[State -3: AfterImageTime]
type = AfterImageTime
trigger1 = (Var(0) > 0)
time = 2

Infinnite juggle points!

[State -3: AssertSpecial]
type = AssertSpecial
trigger1 = (Var(0) > 0)
flag = NoJuggleCheck

Tone down the damage.

[State -3: AttackMulSet]
type = AttackMulSet
trigger1 = (Var(0) > 0)
value = 0.2

Damange back to normal, when the mode is off.

[State -3: AttackMulSet]
type = AttackMulSet
trigger1 = (Var(0) = 0)
value = 1
Re: V-Ism coding problem
#2  January 24, 2010, 10:55:58 pm
  • ******
You can start by using a type = DisplayToClipboard to check what value the variable actually has.
Why do you put the varset back to 0 in state -3 ? State -3 isn't read when you are put in a custom state :P
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.
Re: V-Ism coding problem
#3  January 25, 2010, 07:05:19 pm
  • *
You can start by using a type = DisplayToClipboard to check what value the variable actually has.
Why do you put the varset back to 0 in state -3 ? State -3 isn't read when you are put in a custom state :P


After hours of testing, i finally figured out what was the problem...

Out of curiosity, I simply copied the all the states in [statedef -3] and put it under [statedef -2] and  that worked!!

Shit, its always the simple stuff that makes a problem  look so huge...