Coding full game ending

Started by Lord Mike, December 17, 2010, 01:25:19 PM

Previous topic - Next topic

Lord Mike

Hello. I need some help with something i'm trying to implement as an ending for my full game.
After the boss character is knocked out in the last round (i believe the trigger for that is matchover=1) i want both chars to go to state 0 for a few seconds, than p1 to remain in state 0 and the boss char to go in a different state. What i want to know is what do i edit and where.
I pressume that i have to add it in statedef -2, but how do i make p1 to go to state 0?
Here is a video with exactly what i want to do: http://www.youtube.com/watch?v=DinS9D-60B0

PS: i have the anims and statedefs created. I must learn how to use them.
何故諦める必要がある? 何を迷うことがある奪い取れ。今は悪魔が微笑む時代なんだ。

leandro1412

ok! first in statedef 180 of your character (winpose select) you have to add some changestate with the trigger Matchover && Alive && Enemy,Name = "Boss_Char" , you can edit that using matchno and others trigger etc.-

eg.



;-------------------------------------------------------------------------------
;
[Statedef 180]
type = S
movetype = I

[State 0, ChangeState]
type = ChangeState
trigger1= Matchover && Alive && Enemy,Name = "Boss_Char"
value = 81
ctrl = 0

;-------------------------------------------------------------------------------
;
[Statedef 81]
type = S
movetype = I
physics = N
anim = 0
ctrl = 0
velset = 0,0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Time = [0,2400] ;<- 40 seconds
flag = roundnotover
flag2 = nobardisplay
ignorehitpause = 1

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA
ignorehitpause = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = Time >= 2400
value = 0
ctrl = 1



next we have to go to statedef 5150 (LieDead state) in your "Boos char" and in there you have to put some changestate with the same trigger... but on this case use some else triggers to detect as a boss.. maybe stagevar (mugen 1.0) or ishometeam or something like that... eg trigger1 = MatchOver && !Alive && StageVar(info.name) = "Boss_Stage"

;---------------------------------------------------------------------------
; Downed get-hit (lying defeated)
[Statedef 5150]
type    = L
movetype= H
physics = N
sprpriority = -3
ctrl = 0

[State 0, ChangeState]
type = ChangeState
triggerall = Time >= 15 ;<- Some tics to decide "When?"
trigger1 = MatchOver && !Alive && StageVar(info.name) = "Boss_Stage"
value = 5151
ctrl = 0


and inside of this state add one like your standing up state


;-------------------------------------------------------------------------------
;
[Statedef 5151]
type = S
movetype = I
physics = N
ctrl = 0
velset = 0,0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = roundnotover
flag2 = nobardisplay
ignorehitpause = 1

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
value = 5120 ;<-Standing up default anim, 5121 or 5122 depends anim fall.

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !AnimTime && Anim = 5120
trigger2 = Anim = 0 && !Animtime ; <- Loop
value = 0 ;<-Standing anim.

[State 0, ChangeState]
type = ChangeState
trigger1 = Anim = 0 && Time > 240 ;<- 4 seconds
value = 5152
ctrl = 1


Then in your statedef 5152 you have to add all explods and effects that you need, chose the times, the state numbers, anims... sounds everything that you need to create your end credits... but don't forget don't care if you or your enemy press any buttom the ending'll end.

[

Nice userbars no? :P Make click & Download something nice for your Mugen!!!
________________________________

Lord Mike

I think i get it. But, the downside is that i don't use 1.0 (i have a very slow PC). So, uhm....do you know of another trigger that i can use instead of stagevar?
何故諦める必要がある? 何を迷うことがある奪い取れ。今は悪魔が微笑む時代なんだ。

Cyanide

You know when the boss is going to appear based on how many rounds there are.

You want to make use of

matchno ishometeam teammode

To detect when you have reached the boss battle. I wouldn't really consider stagevar a good choice here anyway as you might trigger it in VS mode when you don't want to.


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.

leandro1412

Quote from: Cyanide on December 18, 2010, 11:59:20 AM
To detect when you have reached the boss battle. I wouldn't really consider stagevar a good choice here anyway as you might trigger it in VS mode when you don't want to.

i mean, a special stage for boss, hidden in select.def. just avaible to boss... but if he doesn't use mugen 1.0 then its better use old triggers to detect that like you say... but survivalmode sucks u.u when you try to do that and when you have the bad luck that mugen choose your boss in the same matcno XD then... endings appear... well if i use matchover u should fix that... my bad  :sugoi:
[

Nice userbars no? :P Make click & Download something nice for your Mugen!!!
________________________________

Lord Mike

Matchover and IsHomeTeam did the trick for me. And thanks for that code for p1 to go in state 0. It's just what i needed.
何故諦める必要がある? 何を迷うことがある奪い取れ。今は悪魔が微笑む時代なんだ。

Lord Mike

I have one more question about this.
All chars stop music when they play their own BGM for a one-shot kill move.
How do i turn off their music to play only the booses music for this final cutscene?
何故諦める必要がある? 何を迷うことがある奪い取れ。今は悪魔が微笑む時代なんだ。

leandro1412

Use "nomusic" to mute the Stage BGM, put that in your boss char. where? in all states where you need music stops.

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nomusic


see ya!
[

Nice userbars no? :P Make click & Download something nice for your Mugen!!!
________________________________

Lord Mike

I know how to stop the stage's music.
Here is a more detailed situation. In my full game most of the rounds (decisive rounds) end with a Fatal KO (which is a one-hit kill move). This Fatal KO comes with it's own BGM, therefore, the char that performs this move also stops the stage's music. I need to stop winning char's music through p2 to have only the ending's sound play, and i've tried stopsnd and it didn't worked (i've tried first nomusic, but that didn't get me anywhere)...
何故諦める必要がある? 何を迷うことがある奪い取れ。今は悪魔が微笑む時代なんだ。

leandro1412

Define a channel to your KO BGM, and mute with stopsnd

for example

Playsnd
value = x,x
channel = 10



<Statedef -2>
Stopsnd
trigger1 = Stateno = 81
;<- Remember i use this state to "Standing"
;other possibility
trigger2 = Enemy,Name = "Boss" && Enemy,IsHometeam && Matchover && !Enemy,Alive
;and the last possibility
trigger3 = Numhelper(xxxx) || Numexplod(xxxx) || Var(x)
;look this 3rd triggers its for special detection... when do u K.Oed your Boss you can activate that, call an empty helper.. and invisible explod, or a var and with this activation you be sure that you KOed your enemy... and make all things that you need
channel = 10

use but if your boss plays the "ending music" set in your trigger when your boss plays this music... for example

trigger1 = enemy,name ... enemy,ishometeam... !enemy,alive etc
trigger1 = Enemy,Stateno = 5152
;<- Enemy Ending play state.

plz comment if that works.
[

Nice userbars no? :P Make click & Download something nice for your Mugen!!!
________________________________

Lord Mike

Nothing stops that sound file. I even placed loop=0 and it started playing again...
何故諦める必要がある? 何を迷うことがある奪い取れ。今は悪魔が微笑む時代なんだ。

leandro1412

soo... you play a sound with your player, and it can't be stoped  o_O

My questions are, when do you play the sound? Where did you have this code? how is your code? Are u using stopsnd in to correct char i mean the player who plays snd? (that last questions is if i confuse you with last xmplain), a video of your issue will be great ;D
[

Nice userbars no? :P Make click & Download something nice for your Mugen!!!
________________________________

Lord Mike

I have 2 videos with this game:
http://www.youtube.com/watch?v=0eyrJpcqO4o (here all the fatal ko's performed)
http://www.youtube.com/watch?v=F1t8-CLSXjM (here is the ending)

Now i'm trying to stop that bgm while the edning occours, as the ending has it's own music.

As for the coding part:
[state ]
type=assertspecial
trigger1=root,var(1)&8388608
flag=nomusic
[state ]
type=stopsnd
trigger1=root,var(1)&8388608
trigger1=root,anim=3000
trigger1=root,movehit=10
channel=30
[state ]
type=playsnd
triggerall=root,var(1)&8388608
trigger1=root,anim=3000; Fatal KO attack animation
trigger1=root,movehit>=10; when does the bgm start
trigger2=anim!=3000
value=s73100,0+random%2;sound file used
loop=0
channel=30
lowpriority=1

there is one example. At the beginning of statedef -2 i have added:
[state ]
type=stopsnd
trigger1=stateno=50081
trigger1=enemy,stateno=5152
trigger2= Matchover && Alive && Enemy,Name = "KENOH"
channel=30

I have tried changing the channel to various numbers, i have changed these triggers for stopsnd.
Does the fact that this bgm is inserted in statedef -2 as well has something to do with it?
何故諦める必要がある? 何を迷うことがある奪い取れ。今は悪魔が微笑む時代なんだ。

leandro1412

So... this was my last possibility XD i think that you could understand XD jaja that never stop if you code the playsnd in a helper XD sooo... inside of your helper put the next.

[state 0]
type=stopsnd
trigger1=Root,stateno=50081
trigger1=enemy,stateno=5152
trigger2= Root,Matchover && Root,Alive && Enemy,Name = "KENOH"
channel=30


but i don't know if you have some destroyself in your helper state making it dissapear and you can read the next codes, fix that if thats happens.


by the way why you are using this trigger?  "&8388608" what is supposed to do this?
[

Nice userbars no? :P Make click & Download something nice for your Mugen!!!
________________________________

Lord Mike

Quote from: leandro1412 on December 19, 2010, 10:39:27 PM
So... this was my last possibility XD i think that you could understand XD jaja that never stop if you code the playsnd in a helper XD sooo... inside of your helper put the next.

[state 0]
type=stopsnd
trigger1=Root,stateno=50081
trigger1=enemy,stateno=5152
trigger2= Root,Matchover && Root,Alive && Enemy,Name = "KENOH"
channel=30


but i don't know if you have some destroyself in your helper state making it dissapear and you can read the next codes, fix that if thats happens.


by the way why you are using this trigger?  "&8388608" what is supposed to do this?

I have managed to pull something off here. I added stopsnd for channel 30 on both boss char and p1 and the sound stops when state 5152 begins.
But the game speed becomes 1% of normal. How can i correct this? And when i hit the pause button, the music that should be stopped begins to play....
Quote from: leandro1412 on December 19, 2010, 10:39:27 PM
by the way why you are using this trigger?  "&8388608" what is supposed to do this?

This trigger is used to define special win speaches (doing a certain combo and ending it with Fatal KO would make that char say something, just doing the move without combo will make him give a different win speach).
何故諦める必要がある? 何を迷うことがある奪い取れ。今は悪魔が微笑む時代なんだ。

leandro1412

1%  o_O, any bug report in Debug data (ctrl+D) ?? that couldn't happens XD

so, i had said if your helper still here when you kill your enemy, why? because if your helper is not there you can't stop the sound from channel 30.

so tha pause key its now a play buttom  lol  ;D, we really need to fix this  :sugoi:.
[

Nice userbars no? :P Make click & Download something nice for your Mugen!!!
________________________________