[4.5.X] SFX Labels Question

Jonny

Well-known member
In my defense, I have only just started playing about with SFX in my game.

Ok, so I've made a SFX and short song and imported the txt file into my project.
If I add code " PlaySound #sfx_diamond " for a pickup it plays the sound effect I created. I can also play the song. No problem.

So, as far as I am aware, it is best practice to use SFX Labels so I set one up for the SFX and used " PlaySound #SND_DIAMOND "
I get a compiling error... " PlaySound (2) Unknown Label ". I've checked and triple checked everything and gone back to the tutorial video but can't figure out where I'm going wrong.

Any ideas? Joe doesn't mention SFX Labels in the Christmas tutorials so I'm a little confused about how and if I should be using these SFX constants or not or why they're used in the first place!?

Also... confised why, when I import my famitracker txt file, I get two SFX I didn't create (sfs_noteLife and sfx_noteDead). Any ideas why they've been created?
 
Last edited:

CutterCross

Active member
SFX have been the source of confusion because different versions of NESmaker recommend you do different things. Here's the breakdown.

The ft_txt_to_asm converter for GGsound auto-generates constants for each song and SFX. if you have a SFX called "sfx_testThing" in your FTM / txt file, you can play that SFX via labeled constant like this:
Code:
PlaySound #sfx_testThing

Older versions of NESmaker had a dedicated section to create custom labels for SFX. Tutorials for newer versions either neglect it or recommend you don't use it. Either way, it's still possible to create new labels corresponding to the SFX index, though I'm unsure if that SFX label section of the tool even does anything anymore.

If you don't want to bother with SFX constants, you can just use the SFX index directly. Say your SFX "sfx_textThing" is the 2nd SFX in your FTM / txt file. You can play that SFX via index like this:
Code:
PlaySound #$01
Or...
Code:
PlaySound #1
Or...
Code:
PlaySound #%00000001
You get the idea.

The "sfx_noteLife" and "sfx_noteDead" in your SFX list are auto-generated by the NESmaker tool. It's specific to the development of Mystic Searches. Don't ask me why Joe / Josh didn't just disable that.
 

Jonny

Well-known member
Thank you @CutterCross. That confirms what I was pondering regards the SFX Label function after I watched the Christmas video where it's not mentioned at all. I wish they would either remove things from the UI that dont work anymore or at least put a bit of text like "SFX Labels not currently implemented" or "Paths not fully implemented" or something along those lines or some indication because it does get confusing to me. I suppose that wouldn't look great to someone who had just purchased the software.
 

Jonny

Well-known member
The "sfx_noteLife" and "sfx_noteDead" in your SFX list are auto-generated by the NESmaker tool. It's specific to the development of Mystic Searches. Don't ask me why Joe / Josh didn't just disable that.
I'm guessing they don't make any difference to memory? Do you know where I would need to look to delete them from the list?
 

CutterCross

Active member
I'm guessing they don't make any difference to memory? Do you know where I would need to look to delete them from the list?
The data for those SFX are in ExtraSFX.asm. Best case is to leave the labels, delete the actual data. The whole ExtraSFX thing in itself I'm a bit iffy on how it all ties together with the tool's integration. They don't take up enough data to be significant, so it really shouldn't matter whether you keep them in or not.
 

Barry2

Member
Sorry im late to the party on this one. I understand how to code the sound effect. But im not sure where i need to place it in the script. Can any of you help
@CutterCross Im trying to get my sfx for when i shoot
 
Top Bottom