Jump to content
  • 0

[Solved] MKP 2.9 - delay in playing win snd on old chars


Question

Posted

https://streamable.com/l5qum1

 

I've made my own finish/win code work in the MKP's common1.cns file when I make it at correct place it worked for all but now I decided to use the original code that comes with MKP 2.9, so that triggers match. A single win sound to play for specific stage will look like that:

 

[State 180, end music]
type = Playsnd
trigger1 = time = 0 && root,var(4) = 0 && prevstateno != 181
trigger1 = stagevar(info.name) = "pr1s0n"
value = f41,29
volumescale = 140
channel = 0

 

I have chars that I downloaded recent years and they are already v 1.0 and the sound plays instantly on Win with this code. Here in the video I show how the win sound is supposed to play when it works fine, for example the Green robot I took is already updated to 1.0

 

But old chars that did not use the shared file play it with some delay, as you can see there is some pause, no sound then the Wins is heard and the sound starts playing. This delay is what I want to fix

I found one first issue that prevented the Win from playing on Win state at all: Chars had in their main CNS a WIN code that had to be deleted  , from

 

; WIN
[Statedef 180]

to Statedef 611 or maybe I need to keep the Intro too, but Win had to be deleted because they share it in the Common. The video shows both go through the same states. Again, the Purple is the one that has delay and I can't find all my converted chars from older MKP before they use the shared files have this delay. At least I fixed them to play music at all by deleting the Win state from their own CNS

So now they both use the shared Common.cns, here is a chunk of code: - and the question is what else I need to change on the older MKP chars so the sound plays instantly? They use the same - shared MKP Common1, Fatality.st and Pit.st files

 

 

 

====================================
Update: It works to play instantly if I replace BOTH the AIR file from a working char and st = (working char).CNS while I keep the rest files of the char. But what exactly causes the delay im not sure, any MKP user?

 

So as I figured something in CNS and possibly doing something with Anim in the AIR is the problem, I started excluding code from the CNS of the working char until it also caused a delay in the PlaySND. Looked like the issue is because:

 OK I know MKP provided good base for MK based projects, Movelist was good to code as Mugen was lacking it (I  now use Ikemen GO, will see how native Movelist works if not better), Ladder climbing too although I personally don't use it and had to disable it, but why the heck they needed to add own code just to display WIN text?? Fight.def does that fine and when needed!

 

So the issue was that 1)

Since MKP Se 2.9 chars use the shared Common 1, all

; WIN
[Statedef 180]

 

until

;---------------------------------------------------------------------------
; INTRO

needs to be removed from their (Char).cns

2)
but then in State -2 new chars of Se 2.9 have the code

[State 0, win];win screen
type = helper
triggerall = win
trigger1 = numhelper(180) = 0 && partner,numhelper(180) = 0
trigger1 = var(4) = 0
trigger1 = selfanimexist(9300)
ID = 180
stateno = 181
facing = facing
pos = 0,-90
ownpal = 1

It checks for an animation of the Win text (again why this even exists when it can be Fight.def) and if it has no anim, the delay happens. Easiest for older chars is to edit in text and add a dummy anim and have the helper code in state -2 too

;
[Begin Action 9300]
-1,-1, 0,0, 100


The code is needed because it tells it to switch to the victory without delay. so it's not bad that the helper exists.

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...