YesNoOk
avatar

[An experiment] Special music when fighting rivals (Read 292 times)

Started by Trinitronity, November 15, 2012, 08:27:24 pm
Share this topic:
[An experiment] Special music when fighting rivals
#1  November 15, 2012, 08:27:24 pm
  • *****
  • Back to the Beginnings
    • Skype - trinitro.man

  • Online
Just, what the title says. I started to code a system for that (using on muteki's Millia):
Code:
[Statedef 193]
type = S
ctrl = 0
anim = 192
velset = 0,0

[State a]
type = assertspecial
trigger1 = 1
flag = nomusic

[State 191, 2]
type = varset
trigger1 = AnimTime = 0
trigger1 = Anim = 192
fvar(10) = pos x

[State -2]
type = posadd
trigger1 = time = 0
x = 40
persistent = 0

[State -2]
type = posadd
triggerall = time = 0
triggerall = numpartner

trigger1 = facing = -1
trigger1 = partner,pos x < pos x

trigger2 = facing = 1
trigger2 = partner,pos x > pos x

x = 30
persistent = 0


[State -2]
type = velset
trigger1 = animelem = 19
x = -2.5
y = -8

[State -2]
type = veladd
trigger1 = animelemtime(19) >= 0
trigger1 = animelemtime(22) < 0
y = 0.55


[State -2]
type = velset
trigger1 = animelem = 22
y = 0


[State 200, 1]
type = velmul
trigger1 = Vel X != 0
trigger1 = animelemtime(22) >= 0
trigger1 = animelemtime(24) < 0
x = 0.90


[State 200]
type = PlaySnd
trigger1 = Animelem = 18
value = 150, 4

[State 200]
type = PlaySnd
trigger1 = Animelem = 22
value = 101, 0

[State -2]
type = velset
trigger1 = animelem = 24
x = 0

[State 191, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = RoundState = 0
trigger1 = anim !=192
value = 194

[State -2]
type = varrandom
trigger1 = animelem = 16
trigger2 = Animelemtime(25) = 21
v = 0
range = 0,2

[State 200]
type = PlaySnd
trigger1 = animelem = 16
value = 0, 3+var(0)
channel = 0

[State 200]
type = PlaySnd
trigger1 = Animelemtime(25) = 21
value = 192, 0+var(0)
channel = 0

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

;[State 191, 2]
;type = AssertSpecial
;trigger1 = 1
;flag = NoMusic

[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = AnimTime = 0
value = 0
Code:
[Statedef 0]
type = S
physics = S
sprpriority = 0

[State -2]
type = destroyself
trigger1 = ishelper


[State -2]
type = posset
trigger1 = roundstate = 2
trigger1 = prevstateno = 193
trigger1 = fvar(10) != 0
trigger1 = 1
x = fvar(10)
persistent = 0

[State -2]
type = varset
trigger1 = roundstate = 2
trigger1 = prevstateno = 193
trigger1 = fvar(10) != 0
fvar(10) = 0
persistent = 0

;[state -2]
;type = selfstate
;value = 5090
;triggerall = fvar(33) >= 1.5
;triggerall = var(39) >= 1
;trigger1 = time = 0
;trigger1 = prevstateno = 5120

[State 0, 1]
type = ChangeAnim
trigger1 = Anim != [0,5]
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 0

[State 0, 2]
type = velset
trigger1 = Time = 0
y = 0

[State 0, 3] ;Stop moving if low velocity or 4 ticks pass
type = velset
trigger1 = abs(vel x) < 2 && !var(15)
trigger2 = Time = 4 && !var(15)
trigger3 = palno = 11
trigger3 = Time = 0
trigger3 = prevstateno = 20
x = 0

[State 0, 4] ;Are you dead?
type = ChangeState
trigger1 = !alive
value = 5050

[state StillInTheDark]
type = Helper
triggerall = ishelper = 0
trigger1 = numhelper(9999) = 0
trigger1 = p2name = "eddie"||p4name = "eddie"
id = 9999
name = "music"
sprpriority = 5
pos = 0,0
postype = p1
stateno = 9999
helpertype = normal
pausemovetime = 0
ignorehitpause = 1
persistent = 0
keyctrl = 0
ownpal = 1
Code:
;Still in the Dark
[Statedef 9999]
type = S
movetype = I
ctrl = 0
anim = 9999
velset = 0,0
physics = N
sprpriority = 0

[state a]
type = AssertSpecial
trigger1 = 1
flag = nomusic

[State a]
type = PlaySnd
trigger1 = time = 0
value = 9999, 99
channel = 5
loop = 1
It works fine so far, but it doesn't respawn in the next round. How do I do it? Thanks in advance!
I make characters RP-styled (Current WIP: Marisa):
http://mugenguild.com/forum/topics/marisarp-150600.0.html
Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
you are all small and can't grow manly sideburns
Last Edit: November 15, 2012, 09:09:28 pm by Trinitronity
Re: [An experiment] Special music when fitting rivals
#2  November 15, 2012, 09:00:20 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
I see nothing to prevent it spawning in the next round.

Do the usual. Debug and make the triggers simpler.


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: [An experiment] Special music when fighting rivals
#3  November 16, 2012, 10:30:14 pm
  • *****
  • Back to the Beginnings
    • Skype - trinitro.man

  • Online
Okay, tested with debug mode on. Nothing unusual or something, that would prevent the helper from respawning. Is that normal?
I make characters RP-styled (Current WIP: Marisa):
http://mugenguild.com/forum/topics/marisarp-150600.0.html
Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
you are all small and can't grow manly sideburns
Re: [An experiment] Special music when fighting rivals
#4  November 16, 2012, 11:38:20 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Your requirements are the name of the character, the fact that the helper doesn't exist (new round it shouldn't) and that time is 0. So unless you're not entering state 0 ever, that should work.

Regardless, do what i said, make the triggers simpler. Do something you think should FORCE it to work regardless of anything. This is how you troubleshoot.


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: [An experiment] Special music when fighting rivals
#5  November 17, 2012, 12:59:21 pm
  • *****
  • Back to the Beginnings
    • Skype - trinitro.man

  • Online
Your requirements are the name of the character, the fact that the helper doesn't exist (new round it shouldn't) and that time is 0. So unless you're not entering state 0 ever, that should work.

Regardless, do what i said, make the triggers simpler. Do something you think should FORCE it to work regardless of anything. This is how you troubleshoot.
Hmm, the only way, I can make it simplier is removing the requirement of needing a certain char, since 0 is Idle and time = 0 means, it gets executed right away. So, yeah, gonna comment out that name requirement for a moment for simplifying.
EDIT: Okay, now I know, what's going on. It actually respawns, but not immidiately.
If only repsawns, when the announcer said "FIGHT". Does there exist a way, to make the helper reappear earlier?
Or does there even exist a way, where the music actualy continues playing in the next round?
I make characters RP-styled (Current WIP: Marisa):
http://mugenguild.com/forum/topics/marisarp-150600.0.html
Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
you are all small and can't grow manly sideburns
Last Edit: November 17, 2012, 01:05:28 pm by Trinitronity

2OS

Re: [An experiment] Special music when fighting rivals
#6  November 17, 2012, 01:16:59 pm
  • ****
  • Ich schicke dich zur HOELLE ! ¡ ! ¡
    • Egypt
    • deuceovspadez.webs.com/
first question: statedef -2

second question: no


[ 052012 ] Inazumachi 181/256  /  deviantART   /  2OS Grafphicsxz  Dead Anims ( Orochi/Mizuchi )  /  608's FX Volume 3
Re: [An experiment] Special music when fighting rivals
#7  November 17, 2012, 01:27:52 pm
  • *****
  • Back to the Beginnings
    • Skype - trinitro.man

  • Online
first question: statedef -2

second question: no
1. Thanks, but can you explain it a bit further, please?
2. Damn. So looks like, I have to mute the music when going to the win state...should be easy, though.
I make characters RP-styled (Current WIP: Marisa):
http://mugenguild.com/forum/topics/marisarp-150600.0.html
Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
you are all small and can't grow manly sideburns

2OS

Re: [An experiment] Special music when fighting rivals
#8  November 17, 2012, 10:07:09 pm
  • ****
  • Ich schicke dich zur HOELLE ! ¡ ! ¡
    • Egypt
    • deuceovspadez.webs.com/
[Statedef -3]  ;;  states that execute when not targetstated.

[Statedef -1]  ;;  is required. states that execute when not targetstated.

[Statedef -2]  ;;  states that unconditionally always execute.


having said this where are you gonna want that helper.


[ 052012 ] Inazumachi 181/256  /  deviantART   /  2OS Grafphicsxz  Dead Anims ( Orochi/Mizuchi )  /  608's FX Volume 3
Re: [An experiment] Special music when fighting rivals
#9  November 17, 2012, 11:47:41 pm
  • *****
  • Back to the Beginnings
    • Skype - trinitro.man

  • Online
[Statedef -3]  ;;  states that execute when not targetstated.

[Statedef -1]  ;;  is required. states that execute when not targetstated.

[Statedef -2]  ;;  states that unconditionally always execute.


having said this where are you gonna want that helper.
Oh, now I got it. I need to move the helper to Statedef -2. Gotta test it out soon.
I usually used -2 and -3 for some sound inits before.

     Posted: November 18, 2012, 01:02:59 pm
It worked!
I make characters RP-styled (Current WIP: Marisa):
http://mugenguild.com/forum/topics/marisarp-150600.0.html
Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
you are all small and can't grow manly sideburns