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!
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.

How to add(not change) new sounds with SNDINFO

Postby Stormwalker » Sat Sep 15, 2018 3:41 am

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
Stormwalker
 
Joined: 05 Sep 2011

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

Postby Enjay » Sat Sep 15, 2018 4:17 am

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

SNDINFO
Code: Select allExpand view
Stormwalker1 MEH1


ACS
Code: Select allExpand view
ambientsound ("Stormwalker1", 127);


Or, if you just want the sound to be heard by the player who activates the script:

Code: Select allExpand view
localambientsound ("Stormwalker1", 127);
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

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

Postby Stormwalker » Sat Sep 15, 2018 2:29 pm

Worked flawlessly. Thanks Enjay!
User avatar
Stormwalker
 
Joined: 05 Sep 2011

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

Postby Enjay » Sat Sep 15, 2018 2:54 pm

No problem. :)
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland


Return to Assets (and other stuff)

Who is online

Users browsing this forum: No registered users and 1 guest