(4.1.X) Sound effect for text boxes.

DanielT1985

Member
In many NES games, a little sound plays whenever text appears.
Games like Zelda 1&2, Mother, Metal Gear, etc. have a sound every time dialogue or text is written.
Even the New 8-Bit Heroes game, Mystic Searches, has that sound effect.
However, NESmaker does not have the ability to do that... until today.

This quick tutorial will show you how you can get text dialogue sound playing in your NES game, and it only adds one line of code... the PlaySound code.

First, locate your Handle Text Box script. "You can find it in Project > Project Settings > Script Settings."
Or you can find it in "GameEngineData\Routines\Basic\System"

Next, find the part that writes Text to the textbox. It should be around line 200.

And it should look like this.

Code:
isWritingTextToTextbox:
	;;; already in bank 17.
	;; we need to get positioning.

	LDA xScroll
	LSR
	LSR
	LSR
	STA temp
	LDA #BOX_1_ORIGIN_X
	ASL
	CLC
	ADC updateNT_H_offset
	CLC
	ADC temp
	STA temp3
	AND #%00011111
	STA tileX

Under the last "STA tileX" line, insert the PlaySound command to the sound of your choice.

Preferably, I'd make a new one called something like "SND_TEXTDIALOGUE"

And voila! You now have text dialogue sounds in your upcoming NESmaker Projects.

I'd like to thank Dale_Coop & CutterCross for helping me a bit when trying to make this possible.
 

Logana

Well-known member
Um you realize that in the adventure model there is a place directly to have your text sfx, the only reason you would need this is if your making a different module witch is highly unlikely
 

dale_coop

Moderator
Staff member
DanielT1985, great topic. I know some people here are interested having that.

Logana said:
Um you realize that in the adventure model there is a place directly to have your text sfx, the only reason you would need this is if your making a different module witch is highly unlikely

Incorrect. In the default modules, there is no sound for the text letters (like in old adventure rpg games).
 

Jonny

Well-known member
Thanks DT, I'm putting text boxes in my platformer. I want to put in something similar to the wierd garbling sound like in animal crossing. Just need to sort the SFX for it now.
 

slashie

New member
Any update on this for 4.5.x ?

I added the call to `PlaySound` just under `updateNormalTextCharacter:` in Game/Subroutines/doDrawText.asm and it seems to work, but wondering if there's a better way.
 
Last edited:
Top Bottom