YesNoOk
avatar

Trouble with useing Variables in separate .st files (Read 1028 times)

Started by MarioManX1983, July 19, 2019, 04:37:55 am
Share this topic:
Trouble with useing Variables in separate .st files
#1  July 19, 2019, 04:37:55 am
  • avatar
  • *
    • USA
I've been trying to teach myself how to make/code characters using Fighter Factory Studio and have been doing fairly well so far. I recently tried moving all of my Variables into a single .st file for organization purposes after looking at P.O.T.S. Ryu character and seeing that the character is able to call/read it's variables from separate .st files.

As you may have already guessed, my character does not seem to work like that.

Vars that are stored in the .cns file or are in the same .st file are read by states in the .st files just fine. But when I try to call/read a var from a different file, Ex.

Spoiler, click to toggle visibilty

It does not get read.

The Display to Clip Board code is in the .cns file. But the var(30) code is in a separate .st file and is coded as a -2 state. When I test run Mugen and activate the debug to look at the Display to clip board it does not display the correct number. (1000 in this case.) It just shows 0. But when I use a var that is in the .cns file it displays the correct number.

P.O.T.S Ryu character has no vars in the .cns file but does have vars all over the place in the .st files and even one in a .txt file and all of those are read just fine during play testing.

So why is my character not doing the same thing?
May you always win every round, both in MUGEN and Life. :)
Re: Trouble with useing Variables in separate .st files
#2  July 19, 2019, 08:24:02 am
  • ***
    • Brazil
    • deathscythemugen.neocities.org
If your var is in state -2, where is your DisplayToClipboard? I mean, did you split statedef -2 in two files? If so I think it won't work. If not, try saving all cns & st files, close and reload your char on fighter factory. If this doesn't work, you're doing something wrong with either your var or your displaytoclipboard.

Re: Trouble with useing Variables in separate .st files
#3  July 19, 2019, 12:30:02 pm
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
how are you setting var(30)? Post the code.

Splitting the varsets into different files has no difference, but if you have two different statedef -2, then it won't work. Mugen will read one and discard the other one
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!
Re: Trouble with useing Variables in separate .st files
#4  July 20, 2019, 04:46:39 am
  • avatar
  • *
    • USA
In the player.cns file I have,
Spoiler, click to toggle visibilty
and in the Variables.st file I have
Spoiler, click to toggle visibilty
If I call var(20) in the DisplayToClipboard state then the correct number is shown. (1000 in this case.) But if I call var(30) then 0 is displayed.

Just in case, I also tested this out. In the Variables.st file I put.
Spoiler, click to toggle visibilty
and tried to call the var(30) from a special move in the Specials.st file. It did not work, but if I use the same variable only in a -2 state in the .cns file, then it does work.
May you always win every round, both in MUGEN and Life. :)
Re: Trouble with useing Variables in separate .st files
#5  July 20, 2019, 10:48:19 am
  • ***
    • Brazil
    • deathscythemugen.neocities.org
Well, it still looks like you have two Statedef -2. As XGargoyle and I said, it won't work unless you use only one Statedef -2. The test code doesn't work probably because you're not entering this state. It says statedef 9999, do you have any command or code that makes you go to state 9999? If not then your var(30) won't change even if you set trigger to 1. It works on Statedef -2 because these are always executed. In other words, you'll have to use var(30) in your first statedef -2 (the one on player.cns), and delete the other one as it will be ignored, or do the opposite, move everything on statedef -2 in player.cns to statedef -2 in variables.st. You can't have both at the same time.
Re: Trouble with useing Variables in separate .st files
#6  July 22, 2019, 01:25:43 am
  • avatar
  • *
    • USA
Have decided to forgo the organization for now. Thank you to all who tried to help.
May you always win every round, both in MUGEN and Life. :)