playing sound for actor doesnt work

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom 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.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
User avatar
Beetow Brode
Posts: 69
Joined: Sat Sep 24, 2016 1:46 pm
Graphics Processor: nVidia (Modern GZDoom)
Location: "We've Got Hostiles"

playing sound for actor doesnt work

Post by Beetow Brode »

Code: Select all

script 2 (void) {
void PlaySound (int 1, str brain/death [, int CHAN_BODY [, 1.0 [, bool FALSE [, ATTN_NORM [, bool FALSE]]]]]);
}
I'm trying to make an actor play a sound on death thats different because its a scripted marine and I want a boss death noise instead of the regular sound. So im wondering why this doesnt work. Not the script but the sound.
Blue Shadow
Posts: 5018
Joined: Sun Nov 14, 2010 12:59 am

Re: playing sound for actor doesnt work

Post by Blue Shadow »

Beetow Brode wrote:

Code: Select all

script 2 (void) {
void PlaySound (int 1, str brain/death [, int CHAN_BODY [, 1.0 [, bool FALSE [, ATTN_NORM [, bool FALSE]]]]]);
}
That's not how you write a function call. This is how:

Code: Select all

script 1 (void)
{
    PlaySound(1, "brain/death", CHAN_BODY, 1.0, FALSE, ATTN_NORM, FALSE);
}
Also, don't forget to compile the code.

Return to “Scripting”