Page 1 of 1

Playsound

Posted: Tue Feb 04, 2003 7:01 pm
by Rookie One.pl
It's me again,

I have a problem with playsound command. I want to play a radio message for all players (in multiplayer). So I followed jv_map's 'Ubersound Workaround' tutorial and made this TIKI:

Code: Select all

TIKI 

setup
{
        path models/fx/dummy
        skelmodel dummy3.skd
}

init
{
        server
        {
                classname ScriptModel
                rendereffects +dontdraw
                notsolid
        }
        client
        {
                settiki none
                aliascache en_hostage_rescued sound/dialogue/Multiplayer/a/hostage_rescued.wav soundparms 1.2 0.0 1.0 0.0 10000 10000 local streamed subtitle "A hostage has been rescued!" maps "dm obj"
        }
}

animations
{
                idle dummy3.skc
}
which is called hostage_mp_dialogue.tik and placed in models/sound, and a for loop in the script:

Code: Select all

// Play radio message for all players
	for(local.playernum = 1; local.playernum <= $player.size; local.playernum++)
		$player[local.playernum] playsound en_hostage_rescued
What's wrong with it? I can't see.

Rookie One

Ooops...

Posted: Tue Feb 04, 2003 7:04 pm
by Rookie One.pl
I forgot to write what's wrong with it :oops: Well, the sound isn't played, and there's no error messages in console (I alwas run MoHAA in developer mode).

Posted: Tue Feb 04, 2003 7:05 pm
by jv_map
1. Where is that for loop located? Are there any players on the server when it plays the sound?

2. Have you precached your sound TIKI?

Posted: Tue Feb 04, 2003 7:13 pm
by Rookie One.pl
1. The loop is located in my hostage script a thread called when a hostage reaches safe zone (trigger_multiple).

Code: Select all

// Show message that the hostage has been rescued
iprintlnbold "A hostage has been rescued!"
// Play radio message for all players
And you know the rest. There aren't any other players on the server, because I don't have any friends over my LAN who have MoHAA :cry: (they have either too slow comp or no disk space :cry: ).

2. Yes, this is my precache script:

Code: Select all

cache models/sound/hostage_mp_dialogue.tik
That's all!

Rookie One

Posted: Tue Feb 04, 2003 7:15 pm
by jv_map
Do you get an error message when you remove that line from the precache script?

Yup

Posted: Tue Feb 04, 2003 7:38 pm
by Rookie One.pl
Yup, when I either remove that line from the script or remove the file.

Posted: Tue Feb 04, 2003 8:31 pm
by jv_map
Maybe try some different soundparms :?

Sound file should be 22050 or 44100 Hz 16-bit mono.

If it's in a .pk3, change 'streamed' to 'loaded'.

I don't get it

Posted: Wed Feb 05, 2003 10:59 am
by Rookie One.pl
Now, I ran the map and the sound worked! I really don't know what's happening with that game... I hate compilers (these for programming/scripting, not for mapping, although they are awful, too!)!!! Even if there's everything OK on the code they always find an error...

Rookie One