[SOLVED] 4.5.9 Text Box Sound Effects

smilehero65

Active member
Hey there!
I saw some Byte-Off entries with sound effects when letters showed up on a textbox. Could anyone explain how that's done?

I tried to follow an old thread, but didn't work on 4.5.9.

Any assistance is appreciated.
 

baardbi

Well-known member
Hey there!
I saw some Byte-Off entries with sound effects when letters showed up on a textbox. Could anyone explain how that's done?

I tried to follow an old thread, but didn't work on 4.5.9.

Any assistance is appreciated.
Yeah. Here's the way I did it. It's a bit clunky but it works. In the doDrawText file under updateNormalTextCharacter: I put this:

Code:
LDA textSoundCounter
CMP #2
BNE incTextSoundCounter
    PlaySound #sfx_text
    LDA #0
    STA textSoundCounter
    JMP doneTextSound
incTextSoundCounter:
    INC textSoundCounter
doneTextSound:

PS! You need a counter for this, or else only the start of the sound will play. I called mine textSoundCounter. You might need to adjust the value to check (#2 in my example) in case you have a longer sound effect than mine.
 

smilehero65

Active member
Yeah. Here's the way I did it. It's a bit clunky but it works. In the doDrawText file under updateNormalTextCharacter: I put this:

Code:
LDA textSoundCounter
CMP #2
BNE incTextSoundCounter
    PlaySound #sfx_text
    LDA #0
    STA textSoundCounter
    JMP doneTextSound
incTextSoundCounter:
    INC textSoundCounter
doneTextSound:

PS! You need a counter for this, or else only the start of the sound will play. I called mine textSoundCounter. You might need to adjust the value to check (#2 in my example) in case you have a longer sound effect than mine.
Thank you so much baardi!
Love your entry btwšŸ˜„(y)
 
Top Bottom