another question

Started by Rōjenomu, April 11, 2008, 12:37:39 AM

Previous topic - Next topic

Rōjenomu

dunno how i could title this post any better
but i'm a bit lost here

thing is i want to have a posadd trigger randomly between only 2 options -20 and 20

how should i code it
it has something to do with ifelse and random i think..

Spoiler (click to show)

QuoteLord Canti Says:
i was playing FFVII and I accidently named Red XIII Cyanide D:

Iced

Create a random var that goes between 1 and zero, if 1 do option a, else do option b.
In case you cant create a random var that goes between 1 and zero, read up on what numbers the random var returns and assign the value in the if to something close to the center of the numbers returned.
If randomvalue bigger than number do A, else, do B.

Rōjenomu

Spoiler (click to show)

QuoteLord Canti Says:
i was playing FFVII and I accidently named Red XIII Cyanide D:

DM

It can be done using the "combination" ifelse + random.
Ex: trigger99 = ifelse(random < 500,-20,20).

Rōjenomu

ahhh thank you, Duende!
that's was i was looking for
Spoiler (click to show)

QuoteLord Canti Says:
i was playing FFVII and I accidently named Red XIII Cyanide D:

Rōjenomu

jup i stumbled on another small problem

i added a cheese ko but it doesnt go fluid with my lie down state
so i wanted to end the round with my cheese ko anim (he's kneeling down)
but which state should i change him to (my cheese state is 5130)
i tried putting the last sprite in the anim to -1 but then it takes too long for the round to end
Spoiler (click to show)

QuoteLord Canti Says:
i was playing FFVII and I accidently named Red XIII Cyanide D:

Cyanide

Still have to go into 5150. Just override it a little so if prevstateno = 5130 anim = cheese KO anim.

Simple methods are best.


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.

Rōjenomu

hmm
so i directed the cheese ko to state 5150
and pasted prevstateno 5130 to the code

[State 5150, 4] ;Match over anim
type = ChangeAnim
persistent = 0
;trigger1 = Time = 0
trigger1 = MatchOver = 1
trigger1 = Anim = [5140,5149]
trigger1 = SelfAnimExist(anim+10)
trigger2 = prevstateno = 5130
value = anim+10

i think that that is the one that ends it right?
no idea what anim+10 is but it doesnt work
i probably don't understand the override part of it
Spoiler (click to show)

QuoteLord Canti Says:
i was playing FFVII and I accidently named Red XIII Cyanide D:

Cyanide

Ah, sorry. I thought you had a little more knowledge than that.

anim+10 would be change to current anim + another 10. So if it's 5130 mugen goes looking for 5140.

Set up an extra changeanim if prevstateno = 5130 && anim != 5130

That particular changeanim you've pasted. trigger1 = prevstateno != 5130 so it'll occur provided you haven't been cheese KO'd


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.

Rōjenomu

yeah, 1st time trying to modify the common states
still am a bit puzzled by it :(

[State 5150, 5] ;Switch to 5110 if liedead anim does not exist
type = ChangeAnim
trigger1 = Time = 0
trigger1 = Anim != [5140,5159]
trigger1 = Anim != [5110,5119]
value = ifelse(prevstateno = 5130&& anim != 5130,5131,5110)

ive gotten this
but i must have done something wrong again because it's not working
still goes to anim 5110
5131 is the last frame of the cheese ko
Spoiler (click to show)

QuoteLord Canti Says:
i was playing FFVII and I accidently named Red XIII Cyanide D:

Cyanide

I never mentioned ifelse. I said set up a new changeanim. Look at your triggers.

You're coming from state 5130, you'll be in anim 5130

trigger1 = Time = 0
trigger1 = Anim != [5140,5159]
trigger1 = Anim != [5110,5119]

doesn't really encompass anim 5130 does it? It will however detect that 5110 is not in use, and will change to that.

Go with a brand new changeanim please. Disallow the other 2 with a triggerall = prevstateno = 5130 and REQUIRE prevstateno = 5130 for the new one you add.


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.