collapse

Author Topic: Number of var(x)?  (Read 353 times)

0 Members and 2 Guests are viewing this topic.

Offline dante244

  • Initiate
  • **
  • Posts: 39
  • Last Login:May 05, 2021, 10:54:45 PM
Number of var(x)?
« on: October 03, 2008, 01:26:33 AM »
I just wanna know the number of vars that i can use in a char(cns, cmd, etc). Where do i define the name of the vars that i gonna to use¿?

var(0), var(1), var(2), for example, why not var(p), var(y), var(j)?



Offline Fallen_Angel

  • Global Moderator (out of the office)
  • *****
  • Posts: 1358
  • Last Login:July 04, 2012, 03:11:05 PM
    • Email
Re: Number of var(x)?
« Reply #1 on: October 03, 2008, 02:08:00 AM »
You have a limit on the vars (you can adjust that in your char)....to define what they do, you will need to add a varset or a varadd or a varrandom....check the docs for more info


sig made by shullbocka

Offline dante244

  • Initiate
  • **
  • Posts: 39
  • Last Login:May 05, 2021, 10:54:45 PM
Re: Number of var(x)?
« Reply #2 on: October 03, 2008, 04:15:35 PM »
You have a limit on the vars (you can adjust that in your char)....to define what they do, you will need to add a varset or a varadd or a varrandom....check the docs for more info


Where can i adjust the limit of the vars.

I know use varset, varadd, etc. I wanna know how define the NAME of the vars. why their name are var(0), var(1), etc. Is that  predefine?

Offline Fallen_Angel

  • Global Moderator (out of the office)
  • *****
  • Posts: 1358
  • Last Login:July 04, 2012, 03:11:05 PM
    • Email
Re: Number of var(x)?
« Reply #3 on: October 03, 2008, 04:45:01 PM »
If I remember welll you have 54 variables from 0 to 53......you can use any number for the vars (0 to 53), its not predefined


sig made by shullbocka

Offline El Chupacabras

  • Forum Member
  • ***
  • Posts: 315
  • Last Login:June 11, 2010, 04:34:36 PM
Re: Number of var(x)?
« Reply #4 on: October 03, 2008, 09:15:20 PM »
http://www.mugen-infantry.net/forum/index.php?topic=64928.0

O_O

You did all that with Eddie without using variables?!?! Woah!

Aoko wouldn't be anywhere without variables!! <3 Variables. :sugoi:


Here's the basic rundown.

60 int variables, i.e. they can store integer values e.g. -1, 0, 5, 444, -299, etc.

40 float variables, i.e. they can store real number values e.g. 6, -207.345, 3.141592653589793238462, etc.


All variables start out with the value 0 unless you override it in the common1.cns file, stateno 5900.

to set a variable:

[state <insert number>] ; this state can be in a statedef of a move, -1, -2, -3
type = varset ; the type - setting a variable equal to a value
trigger1 = ; the trigger for the variable to get set
v = <insert number> ; the int variable number, 0-59
value = <insert value> ; the value you wish to store into the variable

ex:

[state 190]
type = varset
trigger1 = time = 0
v = 1
value = 0

This code put in statedef 190 (the intro) will set int variable 1 equal to 0 at time 0.

If you want to reference a variable, such as for a trigger:

trigger1 = var(1) = 0

will trigger when variable 1 is equal to 0.

There's also the varadd, which lets you add a certain amount to a variable. Same setup as varset, but type = varadd.

Same set up for float variables, except you have fv = <insert number from 0-39>. You reference to them using fvar(<number>)

ex:

[state 190]
type = varset
trigger1 = time = 0
fv = 1
value = 0.5

trigger1 = fvar(1) < 1

For the afterimage.... I used your tutorial. :sugoi:


... I was too lazy to remove the comments........


[State -2, AfterImage]
type = AfterImage
trigger1 = var(4) = 0 ;AnimElem = ___        ;start at sprite image no.
trigger1 = time = 2
length = 1                    ;how long the images stay
time = 9999999999
palbright = 0,0,0                  ;affects brightness of afterimage R,G,B
palcontrast = 0,0,0                ;affects contrast R,G,B
paladd = 0,0,0                     ;color of afterimage added R,G,B
palmul = .5,.5,.5                   ;all 0 for a shadow image, add integers of 1 for solidish
timegap = 1                      ;delay before appears but too much looks retarted integers of 1
framegap = 1                     ;if u dont skip frames to use on ur afterimage u might have an epileptic attack
trans = add   ;transparency-use add"#"(means try something like add1),"none", or "sub"
ignorehitpause = 1               ;just keep at 1 -.-
persistent = 1                   ;same as above

So using this, Aoko has no after image when var(4) = 0. Put in state -2 so it affects all the time.

Oh look at that... I did remove the comments...

[State -2, AfterImage]
type = AfterImage
trigger1 = var(4) = 1 || var(4) = 2
trigger1 = time = 2
length = 10
time = 99999
palbright = 0,0,0
palcontrast = 0,0,0
paladd = 0,0,255
palmul = .5,.5,.5
timegap = 1
framegap = 1
trans = add
ignorehitpause = 1
persistent = 1

So this makes Aoko have a blue afterimage when var(4) equals 1 or 2.

I have trigger1 = time = 2 cause the var set to 1 or 2 or whatever is caused in a state change (heat burst). and if I didn't have that, then the after image wouldn't show up. I guess if I did it like that, MUGEN wouldn't recognize the variable changed, or something. So I set trigger1 = time = 2. You can't even tell the time difference. =P

As for damage dampener... I just figured this out a little bit ago... Doesn't work perfectly in certain situations, specifically when having tripped the opponent and countinuing the combo... For some reason if you trip the opponent it dampens more... o_O

In every statedef of every attack I have this:

[State 200]
type = varadd
triggerall = p2movetype = H
trigger1 = movehit = 1
v = 1
value = 1

[State 200]
type = varset
trigger1 = p2movetype != H
v = 1
value = 0

Which means that if the attack if the opponent, and they're still in a gethit state, increment var(1) by 1. So it's essentially counting how many moves are in the combo. Reset the counter if the opponent is no longer in a gethit state, cause the combo ended.

Then for damage... Well, Melty Blood damage scaling, each attack does less damage the more hits in the combo by a linear amount: decreases in strength by 3.125% per attack. So I did some rounding cause damage is only in integer values...

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
damage = 30 - Var(1)

In this case, the base damage of the attack is 30, and then it dampens by the dampener variable for each hit. (3.125% of 30 is roughly one damage =P)

In other cases I have

damage = 175 - 5*var(1)

The base damage is 175 (it's a charge up move >_>) and it dampens by five times the dampener variable per hit. (3.125% of 175 is roughly 5)

That's how I made my damage dampener, and I like it a lot. ^_^

Hope this helps! =D

Offline dante244

  • Initiate
  • **
  • Posts: 39
  • Last Login:May 05, 2021, 10:54:45 PM
Re: Number of var(x)?
« Reply #5 on: October 03, 2008, 11:45:00 PM »
Great man, i didn't know how to set the float vars thanks

Tags:
 


* IMT Facebook

Help us by Donating!

IMT Discord

Join us at our Discord! Click the image below!

* IMT Shoutbox

Sorry, this shoutbox does not exist.

* Recent Posts

Barkley Shut Up and Jam! Stages by Vegaz by LightFlare
[November 12, 2024, 11:26:21 AM]


[BOR] _Avengers United Battle Force_ by O Ilusionista
[November 11, 2024, 12:35:24 PM]


Eternal Lament Stage 1.1 & 1.0 by O Ilusionista
[November 11, 2024, 12:34:54 PM]


MatreroG's Stages W.I.P. Concepts by MatreroG
[November 11, 2024, 07:00:56 AM]


Marvel vs. Capcom: Eternity of Heroes REMAKE Game Update 1.3.0 - N.A.O.H. by ExShadow
[November 02, 2024, 04:54:41 AM]


Spooky House(1.1 Only/AIGS) by Vegaz by LightFlare
[October 31, 2024, 11:31:36 AM]


Rooftop Skyline(1.1 Only/AIGS) by Vegaz by LightFlare
[October 21, 2024, 12:13:37 PM]


Secluded Base(1.1 Only/AIGS) by Vegaz by LightFlare
[October 17, 2024, 01:21:06 PM]


Ultimate Balrog + stage by ELECTRO
[October 17, 2024, 05:40:31 AM]


Classic VS : Balrog by ELECTRO
[October 08, 2024, 04:35:53 PM]

* IMT Calendar

November 2024
Sun Mon Tue Wed Thu Fri Sat
1 2
3 4 5 6 7 8 9
10 11 12 13 14 [15] 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

SimplePortal 2.3.5 © 2008-2012, SimplePortal