YesNoOk
avatar

Why does round 1 intro play at the start of every round? (Read 16669 times)

Started by gonespaces, August 30, 2023, 08:59:59 pm
Share this topic:
Why does round 1 intro play at the start of every round?
#1  August 30, 2023, 08:59:59 pm
  • foldable samsung fridge
    • USA
I'm new to coding in Mugen. I'm editing this character and he works just fine, nothing in the debug. However, his intros for round 1 play consistently for every start of the round after. I tried looking everywhere but couldn't figure out why this was happening. And when I tried to remove the statedef 5900 I put at the top (as you will see below), it does sorta solve the issue but then his 2nd intro (statedef 202) stops working.

[Statedef 5900]
type = S

[State 5900, 1] ;Clear all int variables
type = VarRangeSet
trigger1 = roundsexisted = 0
value = 0

[State 5900, 2] ;Clear all float variables
type = VarRangeSet
trigger1 = roundsexisted = 0
fvalue = 0

[State 5900]
type = VarRandom
trigger1 = 1
v = 4
range = 1,2

[State 191,]
type = ChangeState
trigger1 = !time
trigger1 = var(4) = 1
value = 191

[State 202,]
type = ChangeState
trigger1 = !time
trigger1 = var(4) = 2
value = 202

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

[State 190,]
type = VarRandom
trigger1 = time = 1
v = 23
range = 0,3

[State 190,Intro 2]
type = ChangeState
trigger1 = Time = 1
trigger1 = var(23) = 0
value = 190

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

[State 191, “ÁŽêŒø‰Ê]
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 191, ƒXƒe?ƒg•ύX]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
;----------------------------------------------------------------------------
[State 5900] ;Intro for round 1
type = ChangeState
trigger1 = roundno = 1
value = 190

[Statedef 190]
type = S
ctrl = 0
velset = 0,0

[State 190, 1] ;Go straight to intro.
type = ChangeState
trigger1 = Time = 0
value = 191

[State 190, 2] ;Go straight to intro.
type = ChangeState
trigger1 = Time = 0
value = 202
;---------------------------------------------------------------------------
[Statedef 191]
type = S
ctrl = 0
anim = 190
velset = 0,0

[State 191, “ÁŽêŒø‰Ê]
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 191,]
type = PlaySnd
trigger1 = AnimElem = 2
value = s4,0

[State 191, ƒXƒe?ƒg•ύX]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
;-------------------------------------------------------------------------------
[Statedef 202]
type = S
ctrl = 0
anim = 202
velset = 0,0

[State 202, “ÁŽêŒø‰Ê]
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 202, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = S7,48

[State 202, PlaySnd]
type = PlaySnd
trigger1 = animelem = 17
value = S18,21

[State 202, ƒXƒe?ƒg•ύX]
type = ChangeState
trigger1 = animtime = 0
value = 0

Sorry if it may seem a little all over the place I kinda almost don't know what I'm doing but can anyone help me here?
Last Edit: August 30, 2023, 09:03:29 pm by gonespaces
Re: Why does round 1 intro play at the start of every round?
#2  August 30, 2023, 09:45:25 pm
  • *****
  • Resident Tosspot
  • Pftheh
    • UK
    • plasmoidthunder.neocities.org
For the two ChangeStates in 5900, add trigger1 = roundno = 1. This will ensure they only play on the first round.

Oh, I want a diagram. I fucking love diagrams.
Re: Why does round 1 intro play at the start of every round?
#3  August 30, 2023, 09:52:05 pm
  • foldable samsung fridge
    • USA
Dude a lot idk why I didn't figure that out sooner
Re: Why does round 1 intro play at the start of every round?
#4  August 30, 2023, 09:53:16 pm
  • ****
    • USA
    • twitter.com/inktrebuchet
And if you don't want to mess with 5900 you can do something like this and save a var or if you still want to use a var you can use randomvarset in 190. I personally prefer to do that because 190 is where intros actually happen not 5900.
* it's also much easier to read code if you only place ";---------" lines only between statedefs.

Code:
;-------------------------------------------------------------------------------
[Statedef 190]
type = S
ctrl = 0
velset = 0,0

[State 190, 1] ;Go straight to intro.
type = ChangeState
trigger1 = roundno = 1
trigger1 = Time = 0
value = 191

[State 190, 2] ;Go straight to intro.
type = ChangeState
trigger1 = Time = 0
value = 202
;---------------------------------------------------------------------------
[Statedef 191]
type = S
ctrl = 0
anim = 190
velset = 0,0

[State 191, “ÁŽêŒø‰Ê]
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 191,]
type = PlaySnd
trigger1 = AnimElem = 2
value = s4,0

[State 191, ƒXƒe?ƒg•ύX]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
;-------------------------------------------------------------------------------
[Statedef 202]
type = S
ctrl = 0
anim = 202
velset = 0,0

[State 202, “ÁŽêŒø‰Ê]
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 202, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = S7,48

[State 202, PlaySnd]
type = PlaySnd
trigger1 = animelem = 17
value = S18,21

[State 202, ƒXƒe?ƒg•ύX]
type = ChangeState
trigger1 = animtime = 0
value = 0