YesNoOk
avatar

how to code winning, loosing and what are variables for ? (Read 374 times)

Started by Zodiac Uchiha, September 07, 2010, 01:30:02 am
Share this topic:
how to code winning, loosing and what are variables for ?
#1  September 07, 2010, 01:30:02 am
  • **
    • Germany
Hi there
i would like to ask how to code a won round. i made the animation i want to use for winning and another one i want to add with the explod statetype.
this wont be a problem i guess. the lying down animation is done. if i beat the opponent, it says K.O. . But it doesnt switch to the next round. there must be something i am missing. how can i tell mugen that the round is won and he can go on to the next round (if there is one) ?
to be more exact: i coded a super move and it requires me to code a special winning code with an animation which isnt connected yet to another winning code. and pls include loosing in your explanation as well .

well and the 2nd question is what are variables for ? i already know they are used to transform. like this
[State 800,varset]
type = varset
trigger1 = animelem = 6
v = 6
value = 1

[State 800, changestate]
type = changestate
trigger1 = var(6) = 1
value = 800
ctrl = 1
; ok you write all this under the statedef 800 which should be the transformation state. i wrote this example because i wonder if it will work if we let the varset out of this and use another trigger in the changestate. and i would like to know what variables are GENERALLY used for.
ok guys, this might be a lot of questions in one topic, but if somebody knows the solution i am sure he will know how to summarize a good understandable answer. please help me
Re: how to code winning, loosing and what are variables for ?
#2  September 07, 2010, 02:20:08 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
A variable is simply a number you want to refer back to later that may have changed. Something you have control over. Say you want to save your current value of life to return to it later. You're on 200 health, you can't use your current health so you use the variable to return to the previous value.

That sort of thing.

This is like SGS where akuma has a special winpose? In order to enter the winning state p1 must gain ctrl at some point. Preferably state 0. Going straight to another state with no ctrl means the game assumes the character is still doing a move and the round only times out 5 seconds or so later (dependant on what's in system.def)


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: how to code winning, loosing and what are variables for ?
#3  September 07, 2010, 04:03:51 pm
  • **
    • Germany
ok i understood that thing with the variables. but where is the difference between varset and varadd ??? i guessed that with varadd it is possible to have more than 1 extra case to check, right ?

ok you guessed the exact right move there. i am editing an Evil Ryu which hasnt been given SGS. and later i will also edit the shinkuu Hadoken, but only the animation of the projectile. from the small one to the cool beam that is used in xmen vs street fighter(for example). but i will try this first. if i have problems with that i will post it later, if there is no similar thread yet.
but now to the edited SGS : everything works fine, and even the pose of Evilryu at the end is ok, but the enemy is supposed to lie down, with only the lying animation. you know...only with one frame. i.e. i want him to already lie down when the screen returns to normal. even that works fine, but it doesnt change to the next round. if there is one that is...
btw thats a cool avatar of red XIII you have there.
Re: how to code winning, loosing and what are variables for ?
#4  September 07, 2010, 04:48:45 pm
  • ******
  • Limited time to use Infinite power !
    • France
    • network.mugenguild.com/cybaster/
ok i understood that thing with the variables. but where is the difference between varset and varadd ??? i guessed that with varadd it is possible to have more than 1 extra case to check, right ?
It's in the name of the state controller.

Varset allows you to set a variable to a certain value, when the conditions set in the triggers are met. For example, when life<200, you can set var(5) to 8 :
[mcode]
type = varset
trigger1 = life<200
var(5) = 8[/mcode]

Varadd allows you to modify the value of a variable by adding a certain quantity to said variable, given the conditions set in the trigger.
For example, you want to add 1 to var(14) each time the move you're performing hits or is guarded :
[mcode]
[State 4000, hitvar]
type = varadd
trigger1 = movehit = 1 || moveguarded = 1
var(14) = 1[/mcode]
The last line doesn't set var(14) to 1, but adds 1 to var(14) each time the trigger is true.
Re: how to code winning, loosing and what are variables for ?
#5  September 07, 2010, 08:06:26 pm
  • ****
  • HAHAHAHAHAHAHAHA
    • Chile
(movehit = 1 || moveguarded = 1 ) = movecontact

Also check if you are using vars already defined in other states- that may be crappy.
ok .. now for the winning and loosing
#6  September 07, 2010, 08:28:22 pm
  • **
    • Germany
ok thank you two . i think i got it now with the variables.

whats left is the winning and loosing.
you all read the example with ShunGokuSatsu right ?
at the end of the black screen i changed the state of the target to another one:
[State 66667]
type = targetstate
trigger1 = animelemtime(16) >= 0 && numtarget(4000)
value = 77779
id = 4000
persistent = 0

[Statedef 77779]
type = L
movetype = H
physics = C
velset = 0,0
ctrl = 0

[State 77779, anim]
type = changeanim2
trigger1 = !time
value = 77780

[State 77779, end]
type = selfstate
trigger1 = !alive
value = 5110

[State 77779, end]
type = selfstate
trigger1 = !animtime && alive
value = 5120
;---------------this is how i wrote it in FF-------------------------
ok. the secondlast state is my problem. the value has to be the animation which iwant the opponent to be in, right ?

[State 77779, end]
type = selfstate
trigger1 = !alive
value = 5110           
it only takes longer ... but why ?
#7  September 07, 2010, 09:19:00 pm
  • **
    • Germany
ok i tried again guys and i realized, that it takes a few seconds before the next round is started. that means it takes longer than with other moves with which you kill the opponent. does anybody know how i make it take as long as with the other moves ?

the whole problem is reduced to this tiny problem =)
Re: how to code winning, loosing and what are variables for ?
#8  September 07, 2010, 10:29:45 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
selfstate
value = 5150
ctrl = 1

and YOU need to have ctrl at some point as well or as i say the round doesn't complete. I abused this once to let a pre match loss pose play without skipping. But it needs to be done.


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.
problem solved
#9  September 08, 2010, 04:16:19 pm
  • **
    • Germany
ok the problem is solved. i gave the wrong statenumber in selfstate. 5150 is the common number for lying dead animation right ? as long as we use the template elecbyte player. is that correct ?