YesNoOk
avatar

Intro if P2 loses the round. If P1 loses, replay an intro after losing to P2 (Read 170 times)

Started by ComboKing, March 04, 2025, 12:11:28 pm
Share this topic:
Intro if P2 loses the round. If P1 loses, replay an intro after losing to P2
#1  March 04, 2025, 12:11:28 pm
  • avatar
    • Argentina
I'm implementing the intro after losing the first round. And after losing the round, let's say p1. Only the p1 animation is played, but there's no need to play p2. It's only once. It's for mk9. I've tried to do everything possible by searching on the internet and copying the script. But p2 and p1 are produced at the same time. And there's no need to play the p2 intro again. Well, now it doesn't play because I set roundno = 1 as default.

Here's an example video, if nothing is understood, because I use Google Translate.

If someone can fix it, I'll be grateful.

Code:
;---------------------------------------------------------------------------
; Initialize (at the start of the round)
[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, 3] ;Change palette
type = RemapPal
trigger1 = 1
source = 1,1
dest = 1,palno

[State 5900, 4] ;Intro for round 1
type = ChangeState
trigger1 = roundno = 1
trigger1 = var(41) = 0
value = 190

[State 5900, 4] ;Intro for round 1
type = ChangeState
trigger1 = var(41) = 0
value = 190

[State 5900, 5] ;All other rounds
type = ChangeState
trigger1 = var(41) = 1
value = 0

;[State 5900, 3] ;Intro for round 1
;type = ChangeState
;trigger1 = roundno = 1
;value = 190

;---------------------------------------------------------------------------
; States that are always executed (use statedef -2)
;---------------------------------------------------------------------------

[Statedef -2]

[State 0]
Type = VarSet
Trigger1 = Roundstate = 4
Trigger1 = WinKO
V  = 41
Value = 1

Re: Intro if P2 loses the round. If P1 loses, replay an intro after losing to P2
#2  March 04, 2025, 01:36:21 pm
  • ******
    • Portugal
    • network.mugenguild.com/pots/
If what matters is losing then maybe you should use LoseKO trigger instead and rework the logic. You should also reset the variable when the char wins. This is one way to do it:

Code:
[State -2]
Type = VarSet
Trigger1 = Roundstate = 4
V  = 41
Value = LoseKO

You also need to make sure the char's variables are kept between rounds, by setting these constants to 0:

Code:
;Variables with this index and above will not have their values
;reset to 0 between rounds or matches. There are 60 int variables,
;indexed from 0 to 59, and 40 float variables, indexed from 0 to 39.
;If omitted, then it defaults to 60 and 40 for integer and float
;variables repectively, meaning that none are persistent, i.e. all
;are reset. If you want your variables to persist between matches,
;you need to override state 5900 from common1.cns.
IntPersistIndex = 0
FloatPersistIndex = 0
You can help with Ikemen GO's development by trying out the latest development build and reporting any bugs on GitHub.
My Mugen and Ikemen content can also be found here.