YesNoOk
avatar

Setting Variables (Read 11424 times)

Started by Messatsu, November 18, 2004, 01:24:21 am
Share this topic:
Setting Variables
#1  November 18, 2004, 01:24:21 am
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html
Quick and confusing (somewhat) way to set variables at time = 0. ;D

[statedef 666]
ctrl     = C + 0*((var(2):=524194)+(var(3):=15761881)+(var(4):=768)+(var(5):=16259)+(var(6):=16260)+(var(7):=16280)+(var(8):=16320)+(var(9):=16288)+(var(10):=16383))

You can do this as long as the expression isn't too long.  If needed, you can remove all spaces as shown above.  Replace the C with the desired value of the expression.


Many people risk their lives everyday by having Mugen.
Re: Setting Variables
#2  November 18, 2004, 03:53:06 am
  • ****
  • Chicks dig me. (SDS Overfiend is the Gamertag)
    • wrestlingarena2.free.fr/star.html
is that to change the variables at specific times?
i swear, Stupid muthafokkers exist all over this board!
Nonetheless Dickriders get all of the Attention!
Go Figure.
--------------
Yes online Gaming is important........ Who Else are you gonna practice on?
http://wrestlingarena2.free.fr/star.html

Beta Kagetsura can still be found here.
http://wrestlingarena2.free.fr/Kagetsura.rar
Re: Setting Variables
#3  November 18, 2004, 04:25:02 am
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html
It's a quick way to store something at time = 0.  Or multiple somethings in the case of my example.  I needed to set 24+ for my menu.  It allows for me to use those variables as global constants instead of independently modifying the values at multiple locations.

If you want to set variables another way and not just at time = 0 during statedef execution, you can use this.

type = null
trigger1 = time = C
trigger1 = (var(0):=1) + (var(1):=root, var(0))

Or just insert whatever the hell you want as conditions in trigger1,1.


Many people risk their lives everyday by having Mugen.
Re: Setting Variables
#4  June 17, 2007, 11:24:50 am
  • ****
  • "Moyashi tsuku shite yaru..."
What the hell?.. How does it work?
Re: Setting Variables
#5  June 17, 2007, 11:48:01 am
  • ******
  • Loyal to the Game
    • USA
    • http://jesuszilla.trinitymugen.net/
The := I understand completely as I've used that.



But Time = C? What the fucking shit were you smoking because I want some of that.
Re: Setting Variables
#6  June 17, 2007, 03:05:53 pm
  • ******
  • Just a butcher on a mission
    • www.justnopoint.com/lbends
C is a shorthand to mean any constant.
Re: Setting Variables
#7  June 17, 2007, 07:06:24 pm
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html


Many people risk their lives everyday by having Mugen.
Re: Setting Variables
#8  October 17, 2007, 08:19:13 pm
  • **
I don't understand how to use variables. I have made a couple of characters, but never used variables, and I've noticed that the coolest characters use variables. And I think the variables are used somehow to program the characters AI... How do I use it?
........
Re: Setting Variables
#9  October 18, 2007, 09:54:49 am
  • ******
  • Limited time to use Infinite power !
    • France
    • network.mugenguild.com/cybaster/
You're better off not trying to read what Messatsu wrote here, as it would confuse you even more. This is an advanced trick.

Rather read the mugen docs concerning variables. Will be clearer.
Re: Setting Variables
#10  October 19, 2007, 01:37:17 am
  • **
I've already read it a hundred times, but I don't get it... they are not specific enough. I need a Variables for dummies version... or better yet math state controlers and triggers for dummies!
I need a step by step explanation of each, and what each means... if you put a * or a ~ or a 34 in there, I want to know why, and what does it mean.... I'm a quick learner, but when I get explained in details.. and once I learn, I become very good at it (specially in math), but since I don't get crap, I can't learn. BTW.. Do you make the variables, or are they already set?
........
Re: Setting Variables
#11  October 19, 2007, 10:37:15 am
  • ******
  • Limited time to use Infinite power !
    • France
    • network.mugenguild.com/cybaster/
Variables are all set to 0 at the beginning of the match by default.

To set a variable to a particular value, you use a varset controller.
type = varset
trigger1 = blabla
v = 13
value = 45
means that you are setting var(13) (variable number 13) to the value 45.

You can also use varadd. If we have var(13)=45, using :
type = varadd
trigger1 = blabla
v = 13
value = 7
means that we ADD 7 to var(13), hence after the varadd, var(13)=45+7=52.

After that, you often use varaible as triggers to see if you display a certain image, do a certain damage, or whatever.

Silly example :
if you press X or Y, you want your character to do the same move, but Y will do more damage than X.
You can set two different chagestate in your cmd to do that, or simply use a variable in a single changestate.
As in :
type = varset
trigger1 = command = "y"
v = 10
value = 1

type = varset
trigger1 = command = "x"
v = 10
value = 0


If the y command was used, then var(10)=1, else, it's equal to 0.

And, in the hitdef part of your move, in the damage :
damage = 20+15*var(10)
If you pressed X, var(10)=0, so you inflict 20 damage. If you pressed Y, var(10)=1, hence damage = 20+15*1 = 35.
Re: Setting Variables
#12  November 03, 2007, 12:47:43 am
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html
The statement in my first post sets the variables in the statement at time = 0 without the after effects of harming the controller parameter (ctrl seen here).  The expression * 0 => means to invalidate the results of the variable operations so that the controller can be used normally.  This is just a quick way of avoiding the usage of using a set of varsets or using a null sctrl.


Many people risk their lives everyday by having Mugen.