News:

MFG's Character of the Month: October 2026 Nominations

Main Menu

[Solved] Question about power value coding

Started by suisiao, April 05, 2010, 05:03:11 AM

Previous topic - Next topic

suisiao

1. how to stopping a character from receiving any power (from attacking or being attacked)

2. how to adding extra power gauge
      eg: -a character have 2 power gauge OR
            -like ultra gauge and EX gauge in SF4

sorry for my poor explanation... --;

Cyanide

For the "no power ever"

Save your power level in a variable ONCE. Powerset consistently to that variable.

I don't understand 2. Power stocks are based on 1000 power. 3000 power = 3 stocks. This is one of the undocumented constants. If you mean additional bars like some characters have, you need to code them in.


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.

suisiao

ok, thx for the answer
theres another:

1. if i want drain my power per time, but it still cannot receive power (eg: the power is full and state activated, it cannot gain power until the power is drop to 0), how i gonna code it?

2. how i gonna temporary off the background music when it go into a state?

Cyanide

assertspecial>nobgmusic

As for the, power may only be used up. Same deal as above pretty much. Except you keep setting the variable as well, and don't set it if power > var.


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.

Sam

a long time ago I've created a code to drain the power. It works similar to the Maximum bar on SVC. You can try to do something similar to drain your power.

[Statedef -2]

;MAXIMUM POWER DECREASE (GASTAR AOS POUKOS)
[State -2, liga]
type= VarSet
trigger1= power= floor(powermax)
var(2)=1


[State -2, tira power]
type= PowerAdd
trigger1= var(2)=1
value= -3%Time

[State -2, desliga]
type= VarSet
trigger1= var(2)=1
trigger1= power <= floor(powermax-1000)
var(2)= 0

;NAUM ADD POWER
[State -2, PowerSet]
type = PowerSet
trigger1 = stateno !=[5000,5999]
value = ifelse(var(2)=1,var(3),Power)
trigger1 = var(3):=Power
trigger2 = 1
ignorehitpause = 1

Don't forget to add an ifelse in poweradds of ur hitdefs.
This code may be flawed, but hey, I was a noob at that time xD

suisiao

Quote from: Sam on April 06, 2010, 01:35:40 AM
[Statedef -2]

;MAXIMUM POWER DECREASE (GASTAR AOS POUKOS)
[State -2, liga]
type= VarSet
trigger1= power= floor(powermax)
var(2)=1
can you explain that trigger meaning? what is floor?
Quote from: Sam on April 06, 2010, 01:35:40 AM
[State -2, tira power]
type= PowerAdd
trigger1= var(2)=1
value= -3%Time
yup this one i already set it earlier
Quote from: Sam on April 06, 2010, 01:35:40 AM
[State -2, desliga]
type= VarSet
trigger1= var(2)=1
trigger1= power <= floor(powermax-1000)
var(2)= 0
another floor?
Quote from: Sam on April 06, 2010, 01:35:40 AM

;NAUM ADD POWER
[State -2, PowerSet]
type = PowerSet
trigger1 = stateno !=[5000,5999]
value = ifelse(var(2)=1,var(3),Power)
trigger1 = var(3):=Power
trigger2 = 1
ignorehitpause = 1
this state what i understand is trying change power on variation
your var(3) is stack on which part? and := stands for?

sorry i really a noob  :-\

Cyanide

Floor means. Decrease a float value to an integer. Floor(1.5) means convert value to 1.

As power is always an integer, and you're not dividing it at all, you don't really need floor at all, but it won't hurt for it to be there.

You know, you could have made this easier for him. Using := for a beginner? Harsh.

powerset
trigger1 = power >= var
value = power

varset
trigger1 = power <= var

that should probably do it really. If the power is above the variable, the power is reset to the value of the variable. If the power is below the value of the variable, the var is reset to the current value of power. Put it in state -2. It should cancel out gaining power in any manner at all. If you need it to be temporary, add another var to turn it on/off.


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.

suisiao

yes! after ur explaination, all things clear! problem solved many many thx ;D

Sam

:= is the assignment operator, and it is used to set a value to a variable without using a varset sctrl