Jump to content
  • 0

Global variable for all statedefs


jadeeye
 Share

Question

Hi everyone,

I have created an option to enable or disable Launcher for a character. I make a file call config.txt and put the state to enable/disable Launcher then link it to (character).def but did not work. Here's my code:

config.txt
; Initialize
[statedef 5900]
type = S

[state 5900, 1] ;Clear all int variables
type = VarRangeSet
trigger1 = roundsexisted = 0
value = 0

[state 5900, 2] ;Clear all float variables
type = VarRangeSet
trigger1 = roundsexisted = 0
fvalue = 0

[state 5900, 3] ;Change palette
type = RemapPal
trigger1 = 1
source = 1,1
dest = 1,palno

[state 5900, Launcher]
type = varset
trigger1 = 1
v = 47
value = 1 ;set 1 to enable Launcher, set 0 to disable Launcher


[state 5900, 4] ;Intro for round 1
type = ChangeState
trigger1 = roundno = 1
value = 190

[state 5900, 5] ;All other rounds
type = ChangeState
trigger1 = 1
value = 0


normal.cns
[state 420, Launcher]
type = HitDef
trigger1 = AnimElem = 3
..............
ground.velocity = -4, ifelse(var(47),-13,-4)


ryu.def
...............
st7 = config.txt


This variable just working if I put the Launcher's option in statedef 420 (Launcher). I need a variables work on all files so how can do that?

Please, help me. Thanks everyone.

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Thanks Ryon, it's working with your solution but I still need use an external file because no one like go to each file .cns (normal.cns, special.cns, etc) to config.

 

Beside, I have many characters have a same properties to config so need to have only one file to change them together (common.cns).

Link to comment
Share on other sites

  • 0

well look they still need to go into the def file.

still opening a file.

 

look if the statedef 5900 is anywhere in the cns, it will be read upon loading.

 

the bottom of it is just considered the best place.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...