Bucket Mouse
Active member
To add sound effects to my cutscenes, I had to modify the Advance script in TimerEndScripts to create a variant that would command to play a sound effect, then advance the sprite action to a step that requires that sound effect.
I thought other people might find it useful too, so here it is. It can be used for several different sounds if you assign them to a specific screen (as I have done below), or if you just want to use one sound, you could comment out everything above ;;is advance action except the PlaySound command.
Save it as SoundAndAdvance.asm, then assign it to one of the unused End Scripts in Script Settings.
I thought other people might find it useful too, so here it is. It can be used for several different sounds if you assign them to a specific screen (as I have done below), or if you just want to use one sound, you could comment out everything above ;;is advance action except the PlaySound command.
Save it as SoundAndAdvance.asm, then assign it to one of the unused End Scripts in Script Settings.
Code:
LDA currentScreen
CMP #$20 ;; this is screen 0,2
BNE +
PlaySound #$01 ; beep
+
CMP #$09 ;; this is screen 9,0
BNE ++
PlaySound #$04 ; explosion
++
;; is advance action
LDA Object_action_step,x
AND #%00000111
CLC
ADC #$01
CMP #$08
BCC isAGoodActionStepValue2
;; is over 8, so go back to 1
ChangeObjectState #$00,#$02
JSR DoNewAction
JMP actionTimerFinished
isAGoodActionStepValue2:
STA temp
ChangeObjectState temp,#$02
JSR DoNewAction