News:

MFG's Character of the Month: September 2026 Voting

Main Menu

Need Variable Help

Started by Liero, August 28, 2007, 07:14:08 AM

Previous topic - Next topic

Liero

Is there a way to read one of player 2's variables?

For example, I want an attack to do a certain amount of damage depending on player2's variable value.

So..

if player2's var(10) = 0  then do 5 damage
if player2's var(10) = 1  then do 10 damage

etc.

Is this possible?

DemonicDrPhil

every character has different uses for different variables.  what a variable means in one character will be completely different in another character
Latest Yoshi alpha ready for feedback Aug 15th check here for details...

Captain Storm

Can't imagine why'd this be useful outside a full game.  I guess you could read a variable by putting p2 in a custom state then read the variable from there and use a negative lifeadd to do damage.

Cyanide

enemynear(0), var(x) = y

would work. This would seriously have to be full game only though.

Just in case, enemynear(0) refers to the enemy closest to you. ie hopefully the one you're hitting. If you don't need instant response from this var and it's involved in movecontact's you can use

target, var(x) = y

If it's for reactions to stimuli, enemynear and wishful thinking will have to do.


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.

Liero

#4
Oh it is a full game....I failed to mention that...Ive got a few people ( including a few skilled animators )...Were making a pokemon fighting game that includes the original game's "super effective" and "not very effective" elements...

My idea to make this work was to assign a number to a specific type of monster...For example fire=1 and grass=2

So if a fire type move was done, the hitdef would test to see if player2's variable was 2 ( or whatever else was weak to fire )...If it turned out to be true the damage would be twice as much

Cyanide...would the method you gave me work if I were to do this?

Also how would I go about assigning a variable to each character?

Maybe I am approaching this the wrong way...Is there an easier way?

One of my friends suggested to test the name of player 2...Although that seems extremely tedious, seeing that were aiming for 40+ characters...

Cyanide

If you don't want to waste variables, try using animations instead.

You don't have to use them but you get a huge number available.


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.

Liero

Well that should work fine then....Thanks a lot for the help!