YesNoOk
avatar

Global vars (Read 276 times)

Started by jjmugen, February 26, 2012, 06:58:14 pm
Share this topic:
Global vars
#1  February 26, 2012, 06:58:14 pm
  • **
Hi, guys.

I just can't understand completely how sysvars works or what's its function.

It is possible to create a variable during the whole game?

I mean... If you are in match 1 and the global var sets to 1, then, when you are in match 5 this var continues being 1...

It is possible to make something like that?

Thanks a lot
Re: Global vars
#2  February 26, 2012, 09:05:34 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Regular variables can be set to persist from round to round. intpersistindex if set to 0 will cause every integer variable to persist from match to match.


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.
Re: Global vars
#3  February 27, 2012, 12:14:50 pm
  • *****
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
Sysvars are used internally by the engine. Can't remember right now, but I think to recall there were 4 o 5 sysvars.

Don't modify or override them as it could result in really weird behaviours or general engine malfunctions.

Besides, you don't need as much as variables to do whatever you try to achieve. Your 60/40 character variables are more than enough, and even if you need more, then spawn a helper and use those extra 60/40 vars.
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link

2OS

Re: Global vars
#4  February 27, 2012, 01:29:23 pm
  • ****
  • Ich schicke dich zur HOELLE ! ¡ ! ¡
    • Egypt
    • deuceovspadez.webs.com/
There are 5 sysvars

There are 5 sysfvars


Sysvar(1) is the only sysvar being used significantly. The rest do absolutely nothing.

Use them if you want but with 60 ints and 40 floats there really is no point whatsoever in doing so. Unless you want to use one as some sort of really major config ( I do this ).


[ 052012 ] Inazumachi 181/256  /  deviantART   /  2OS Grafphicsxz  Dead Anims ( Orochi/Mizuchi )  /  608's FX Volume 3
Re: Global vars
#5  February 27, 2012, 11:05:50 pm
  • ****
    • Hungary
    • seravy.x10.mx/Wordpress
intpersistindex and floatpersistindex to make your variables stay between rounds.
Override state 5900 and remove/edit the part that clears variables on round 1 to make them stay between matches as well, this one :

Code:

[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
Re: Global vars
#6  February 27, 2012, 11:19:50 pm
  • ******
  • Complicated.cns
  • No, I've never played a Zelda game before, shut up
    • Argentina
actually IIRC sysvar(0) is used as well, the thing is both are used for shallow stuff that could easily be replaced by mere triggers (Most of us use other ways to detect moves that can be cancelled rather than using a sysvar unlike what KFM, the char, does). Nothing happens if you use them but these system variables wont persist between matches (Like for example, different stages in arcade mode).
pls

2OS

Re: Global vars
#7  February 28, 2012, 12:13:31 am
  • ****
  • Ich schicke dich zur HOELLE ! ¡ ! ¡
    • Egypt
    • deuceovspadez.webs.com/
hence the word significantly lol.

you cant use assignment operator with them either.


[ 052012 ] Inazumachi 181/256  /  deviantART   /  2OS Grafphicsxz  Dead Anims ( Orochi/Mizuchi )  /  608's FX Volume 3
Re: Global vars
#8  February 28, 2012, 12:38:18 am
  • ******
  • Complicated.cns
  • No, I've never played a Zelda game before, shut up
    • Argentina
yeah just wanted to make sure he knows which ones are used at least once in case he wanna usethem for something.
pls
Re: Global vars
#9  March 02, 2012, 09:00:36 pm
  • **
Thanks for helping :)