How to add(not change) new sounds with SNDINFO

Ask about editing graphics, sounds, models, music, etc here!
Shaders (GLSL) and SNDINFO questions also go here!

Moderators: GZDoom Developers, Raze Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Post Reply
User avatar
Stormwalker
Posts: 100
Joined: Mon Sep 05, 2011 10:22 pm

How to add(not change) new sounds with SNDINFO

Post by Stormwalker »

Hi, I would like to add about 5 new sounds to a wad that I'm making. The idea is to have these sounds be played at certain key points in the level. When the player crosses a certain line, 80(ACS_Execute) would be triggered, and the script would call PlaySound in order to play the new sound. I added the sound files to my wad, gave them all 8-character names, but the script will not compile. I believe that this is because the PlaySound function is looking for a sound that is defined in SNDINFO. I don't want to replace an existing sound, I want to add completely new sounds and define them somehow in SNDINFO so that PlaySound will be able to access the sound and the script will compile. Is this possible and can anyone help? Thanks!
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: How to add(not change) new sounds with SNDINFO

Post by Enjay »

Put your sound in the file (let's say it's called MEH1) and then give it a name in SNDINFO

SNDINFO

Code: Select all

Stormwalker1 MEH1
ACS

Code: Select all

ambientsound ("Stormwalker1", 127);
Or, if you just want the sound to be heard by the player who activates the script:

Code: Select all

localambientsound ("Stormwalker1", 127);
User avatar
Stormwalker
Posts: 100
Joined: Mon Sep 05, 2011 10:22 pm

Re: How to add(not change) new sounds with SNDINFO

Post by Stormwalker »

Worked flawlessly. Thanks Enjay!
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: How to add(not change) new sounds with SNDINFO

Post by Enjay »

No problem. :)
Post Reply

Return to “Assets (and other stuff)”