YesNoOk
avatar

Character VS Character BGM- Anyway to do that? (Read 809 times)

Started by Palimification, October 19, 2012, 08:41:14 pm
Share this topic:
Character VS Character BGM- Anyway to do that?
#1  October 19, 2012, 08:41:14 pm
  • avatar
  • *
    • Portugal
    • mariano.mega@hotmail.com
Hi I'm constructing a game with mugen using some chars and doing minor edits to them. I would like to know if there is any way to include Char VS Char BGMs, like in Guilty Gear and Blazblue when certain pairings like Ragna and Jin or Millia Rage and Zato-1 fight each other.
One way that ocurred me was by puting a code on one of the chars that would react with his/her "rival" and turn the default BGM off while playing the new one (included in the .snd file), looping it.

Problem is... I don't know a thing about the Mugen coding language.
Re: Character VS Character BGM- Anyway to do that?
#2  October 19, 2012, 09:15:25 pm
  • ******
  • [The only one worthy of my love!]
    • USA
1: Covert the desired song into .wav format. Remember, depending on the size of the resulting file, you may make MUGEN lag.
2: Put the entire music file into one of the characters using a program like Fighter Factory, giving it a Group and Sound number you will remember.
3: In Statedef -2 you'd code in a PlaySnd controller that triggers only when player 2 or 4 is "insert_char_name_here" (you get the name by looking at the char's .def file and typing what's in the "name" parameter. Ignore "displayname") AND when time=0. The value of course would be the group and number you defined in Step 2.
4) Also in Statedef -2, add an Assertspecial controller that triggers, again, when the p2 or p4 is "insert_char_name_here" and time=0. Your flag should be "NoBGM"
5) If you did everything right, it should play when those two characters are opponents.

For more info on how exactly to code a PlaySND or Assertspecial controller, check out the docs
Re: Character VS Character BGM- Anyway to do that?
#3  October 19, 2012, 10:23:21 pm
  • avatar
  • *
    • Portugal
    • mariano.mega@hotmail.com
trying and trying and neither the default bgm shuts up nor the intended bgm plays

Code:
[Statedef -2]
[State 0, PlaySnd]
type = PlaySnd
trigger1 =   (time = 0)  && (p2name = "Battler")
value = 20,2
volume = 100
channel = -1
;lowpriority = -1
freqmul = 1.0
loop = 1
pan = 0
;abspan =
;ignorehitpause =
;persistent =
flag = "NoBGM"

This is what I have made till now. the intended BGM is on group 20, number 2
Re: Character VS Character BGM- Anyway to do that?
#4  October 19, 2012, 10:26:52 pm
  • avatar
  • ****
    • USA

  • Online
Re: Character VS Character BGM- Anyway to do that?
#5  October 19, 2012, 10:30:18 pm
  • avatar
  • *
    • Portugal
    • mariano.mega@hotmail.com
Well I didn't understand too well how to put that thing :/
Re: Character VS Character BGM- Anyway to do that?
#6  October 19, 2012, 10:30:57 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Flag is NoMusic
noBGM is invalid (i'm surprised it didn't error, must be winmugen)


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: Character VS Character BGM- Anyway to do that?
#7  October 19, 2012, 10:34:24 pm
  • avatar
  • *
    • Portugal
    • mariano.mega@hotmail.com
Actually is 1.0 that I am using

2OS

Re: Character VS Character BGM- Anyway to do that?
#8  October 19, 2012, 10:39:32 pm
  • ****
  • Ich schicke dich zur HOELLE ! ¡ ! ¡
    • Egypt
    • deuceovspadez.webs.com/
1. statedef -1 -2 -3 only triggers on time=0 when targetstated.
2. since you specified no state number it would (ideally) trigger every single state when time=0.


type=playsnd
trigger1=numenemy
trigger1=enemy,name="enemy name goes here"||enemy(numenemy=2),name="enemy name goes here"
trigger1=stateno=5900&&time=1

type=assertspecial
trigger1=numenemy
trigger1=enemy,name="enemy name goes here"||enemy(numenemy=2),name="enemy name goes here"


[ 052012 ] Inazumachi 181/256  /  deviantART   /  2OS Grafphicsxz  Dead Anims ( Orochi/Mizuchi )  /  608's FX Volume 3
Re: Character VS Character BGM- Anyway to do that?
#9  October 19, 2012, 10:48:03 pm
  • avatar
  • *
    • Portugal
    • mariano.mega@hotmail.com
Code:
[Statedef -2]
[State 0, PlaySnd]
type=playsnd
trigger1=numenemy
trigger1=enemy,name="Battler"||enemy(numenemy=2),name="Battler"
trigger1=stateno=5900&&time=1
value = 20,2
volume = 500
channel = -1
;lowpriority = -1
freqmul = 1.0
loop = 1
pan = 0
;abspan =
;ignorehitpause =
;persistent =
type=assertspecial
trigger1=numenemy
trigger1=enemy,name="Battler"||enemy(numenemy=2),name="Battler"
flag = noMusic
Re: Character VS Character BGM- Anyway to do that?
#10  October 19, 2012, 10:55:31 pm
  • avatar
  • ****
    • USA

  • Online
assertspecial must be in ANOTHER state, not in the same state as PlaySND.

Code:
[Statedef -2]

[State 0, PlaySnd]
type=playsnd
trigger1=numenemy
trigger1=enemy,name="Battler"||enemy(numenemy=2),name="Battler"
trigger1=stateno=5900&&time=1
value = 20,2
volume = 500
channel = -1
;lowpriority = -1
freqmul = 1.0
loop = 1
pan = 0
;abspan =
;ignorehitpause =
;persistent =

[State 0, AssertSpecial]
type=assertspecial
trigger1=numenemy
trigger1=enemy,name="Battler"||enemy(numenemy=2),name="Battler"
flag = noMusic

Re: Character VS Character BGM- Anyway to do that?
#11  October 19, 2012, 11:20:02 pm
  • avatar
  • *
    • Portugal
    • mariano.mega@hotmail.com
okay so now the main bgm shuted up, but now the new bgm doesn't initiate.

it's supposed to be number 108 , group 20, sound 2
Re: Character VS Character BGM- Anyway to do that?
#12  October 19, 2012, 11:21:59 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Where does 108 come into it?

value = S20,2


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: Character VS Character BGM- Anyway to do that?
#13  October 19, 2012, 11:26:51 pm
  • avatar
  • *
    • Portugal
    • mariano.mega@hotmail.com
its where its located on Fighter Factory in that thing to scroll through the sounds

and not working ._.
even tried selecting some other sound in the Character, but it doesn't seem to be problem with the bgm
Re: Character VS Character BGM- Anyway to do that?
#14  October 19, 2012, 11:56:48 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Oh so it's the 108'th sound in the list, that's not the group/soundno you gave it.

Lets do some simple stuff then. Swap the
trigger1=stateno=5900&&time=1
to
trigger1=stateno=0&&time=1

It's gonna repeat over itself, but i'm actually pretty sure state 5900 doesn't have a time = 1 unless you give it one. If you wanna use 5900 (best choice btw), copy the state from common1.cns and paste it into your cns file.


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: Character VS Character BGM- Anyway to do that?
#15  October 20, 2012, 12:05:42 am
  • avatar
  • *
    • Portugal
    • mariano.mega@hotmail.com
Now the new bgm played, but as soon as I pressed some buttons to move the characters another copies of the music start to play (like when in a birthday party some trolls start to sing happy birthday later and we get a confusing song)
Re: Character VS Character BGM- Anyway to do that?
#16  October 20, 2012, 12:17:56 am
  • avatar
  • ****
    • USA

  • Online
It must be the "state 0". when you move the character, it changes state, so when you stop move it changes back to state 0. Thus, causing the bug.

change state 0 to state -2 and see what happens.

Code:
[Statedef -2]

[State -2, PlaySnd]
type=playsnd
trigger1=numenemy
trigger1=enemy,name="Battler"||enemy(numenemy=2),name="Battler"
trigger1=stateno=5900&&time=1
value = 20,2
volume = 500
channel = -1
;lowpriority = -1
freqmul = 1.0
loop = 1
pan = 0
;abspan =
;ignorehitpause =
;persistent =

[State -2, AssertSpecial]
type=assertspecial
trigger1=numenemy
trigger1=enemy,name="Battler"||enemy(numenemy=2),name="Battler"
flag = noMusic

Re: Character VS Character BGM- Anyway to do that?
#17  October 20, 2012, 12:24:21 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Sigh, no he shouldn't. That was what was known as a TEST to see if his music worked properly. I knew it would be buggy that is why i said

Quote
Lets do some simple stuff then. Swap the
trigger1=stateno=5900&&time=1
to
trigger1=stateno=0&&time=1

It's gonna repeat over itself,
Now do the next bit of my suggestion, override state 5900 by copying it from common1.cns and putting it in your own .cns file. Place the playsnd THERE, time = 0 trigger as well.

time = 0 in state -2 is buggy. In addition you don't want to point it at a standard state anyway.

The other option if you absolutely must make use of state -2 is to use a variable.

[state -2]
type = playsnd
trigger1 = var(0) = 0
trigger1 = var(0) := 1
value = S20,2
volumescale = 100


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: Character VS Character BGM- Anyway to do that?
#18  October 20, 2012, 01:56:31 am
  • ******
  • [The only one worthy of my love!]
    • USA
I'd like to apologize to the original poster for pulling that advice out of my buttocks without consulting the docs and not knowing that NoBGM was not a flag.

2OS

Re: Character VS Character BGM- Anyway to do that?
#19  October 20, 2012, 02:49:46 am
  • ****
  • Ich schicke dich zur HOELLE ! ¡ ! ¡
    • Egypt
    • deuceovspadez.webs.com/
state 5900 has no time=1 only when roundno=1.

trigger1=(stateno=5900||(stateno=[190,199])&&roundno=1)&&time=1

though it will definitely work a var for this is pretty wasteful but since he's new  .  .  .


[ 052012 ] Inazumachi 181/256  /  deviantART   /  2OS Grafphicsxz  Dead Anims ( Orochi/Mizuchi )  /  608's FX Volume 3
Re: Character VS Character BGM- Anyway to do that?
#20  October 21, 2012, 01:42:12 pm
  • avatar
  • *
    • Portugal
    • mariano.mega@hotmail.com
[Statedef 5900]
type = S

[State 5900, PlaySnd]
    type=playsnd
    trigger1=numenemy
    trigger1=enemy,name="BATTLER USHIROMIYA"||enemy(numenemy=2),name="BATTLER USHIROMIYA"
trigger1=(stateno=5900||(stateno=[190,199])&&roundno=1)&&time=1
    value = S20,2
    volume = 99999
    channel = -1
    ;lowpriority = -1
    freqmul = 1.0
    loop = 1
    pan = 0
    ;abspan =
    ;ignorehitpause =
    ;persistent =
    [State 5900, AssertSpecial]
    type=assertspecial
    trigger1=numenemy
    trigger1=enemy,name="BATTLER USHIROMIYA"||enemy(numenemy=2),name="BATTLER USHIROMIYA"
    flag = noMusic



I'm starting to feeel like a shitty test subject

2OS

Re: Character VS Character BGM- Anyway to do that?
#21  October 21, 2012, 08:07:11 pm
  • ****
  • Ich schicke dich zur HOELLE ! ¡ ! ¡
    • Egypt
    • deuceovspadez.webs.com/
that in statedef -2 will work.


[ 052012 ] Inazumachi 181/256  /  deviantART   /  2OS Grafphicsxz  Dead Anims ( Orochi/Mizuchi )  /  608's FX Volume 3
Re: Character VS Character BGM- Anyway to do that?
#22  November 01, 2012, 12:12:35 am
  • avatar
  • *
    • Portugal
    • mariano.mega@hotmail.com
So it finnaly worked. Only known bug is when you try to switch to fullscreen in middle of the match it seems
And when the host character does a Taunt

Code:
[Statedef -2]
type = S

[State -2, PlaySnd]
    type=playsnd
    trigger1=numenemy
    trigger1=enemy,name="ENEMYNAME"||enemy(numenemy=2),name="ENEMYNAME"
trigger1=(stateno=5900||(stateno=[190,199])&&roundno=1)&&time=1
    value = SGROUP,NUMBEROFSOUND
    volume = 99999
    channel = -1
    ;lowpriority = -1
    freqmul = 1.0
    loop = 1
    pan = 0
    ;abspan =
    ;ignorehitpause =
    ;persistent =
    [State -2, AssertSpecial]
    type=assertspecial
    trigger1=numenemy
    trigger1=enemy,name="ENEMYNAME"||enemy(numenemy=2),name="ENEMYNAME"
    flag = noMusic

Here's a template for anyone who wants ;)
Last Edit: November 01, 2012, 12:25:41 am by Palimification
Re: Character VS Character BGM- Anyway to do that?
#23  November 01, 2012, 12:53:20 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Taunt is often state 195 so it's repeating your original playsnd.

If you can confirm that you have no intro's beyond that swap to

stateno = [190,194]

Will solve it.


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.