YesNoOk
avatar

Individual Character BGM by PlaySnd (Read 135 times)

Started by Ogre., April 14, 2021, 08:47:26 AM
Share this topic:
Individual Character BGM by PlaySnd
#1  April 14, 2021, 08:47:26 AM
  • avatar
  • **
    • UK
Here's how it works:
Basic Elecbyte states that
1. All Intro, Win, and Lose states occur in States 170-199
2. State 5900 is for intro to a new round before
the announcer says "Fight".
3. These States occur in what as known to MUGEN code
as " RoundState = 1 " for intro, and = 4 for Win/Loss after K.O.,
respectively.

With that said, Roundstate = 2 is for the fight itself,
After fight, Before K.O., where Statedef ) starts.

If your character does not have a StateNo 0,
Please identify the Number for its helper,
like with Alpha.exe, or insert a template
Statedef 0; Then, place this code within it:


[State 0, Helper]
type = Helper
trigger1 = numhelper () = 0
name = ""
ID =
stateno =
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

"NumHelper", "ID", and "stateno" all need a number that your
character is not using in its CNS. That number needs
to go in the state below, and it needs to be pasted under the
changestate of your character's standing statedef.:


;---------------------------------------------------------------------------
; Music
[Statedef ]
type = S
physics = S
sprpriority = 0
velset = 0,0
ctrl = 1
Anim = 8502

[State 15, ±¬Å­BGM]
type = PlaySnd
trigger1 = AnimElem = 1
value = S,
volumescale = 200
channel =
loop = 1
lowpriority = 1

[State 0, DestroySelf]
type = DestroySelf
trigger1 = life = 0

;---------------------------------------------------------------------------

then you should place this in your character's -2's.:

[State -2, StopSnd]
type = StopSnd
trigger1 = Root,StateNo = 5150
channel = 13

That should stop the music when your character is desd :)
Re: Individual Character BGM by PlaySnd
#2  April 14, 2021, 08:56:35 AM
  • avatar
  • **
    • UK
Make sure your music is in .wav format, and make sure the number assigned in fighter factory is one that
other sounds are not using.

I am using Anim = 8502 in .AIR for this character.
This character has no animation for 8502, so this works for this character.

the right-click edit notepad patch for .air file in your character's file looks like this :) :

[Begin Action 8502]
-1,0, 0,0, 10
LoopStart
-1,0, 0,0, 10

As you can see, there is loopstart in an invisible helper that triggers at start of round for your music to start playing,
and loop until the end of round and when your character is K.O.
Re: Individual Character BGM by PlaySnd
#3  April 14, 2021, 08:58:39 AM
  • avatar
  • **
    • UK
This is the basis for a stage with no bgm lol
there are other topics in this forum that discuss stopsnd for music playing in the background :)