Hey! I've got another problem here.
Pretty much the same as what I needed before, but even simpler, and for sound files this time.
This is probably a dumb question, the answer to which should be obvious to those more experienced than I, but alas, I can't decipher bldoc.nullable.se to find the information I seek, soo...
For the same reasons as before, I want to make a /command to make the player(not the client or server) play a 3d sound. Specifically, I was trying to make it randomly select a sound from a list, which I sampled Player_Overwatch for, since that Tracer playertype can play multiple random sounds for its blink ability. But I obviously messed something simple up here, I just don't know what it is.
This is the test addon's code in its entirety.
//Emote_Alarm.cs
datablock AudioProfile(chrys_scream1Sound)
{
filename = "./chrys_scream1.wav";
description = AudioClosest3d;
preload = false;
};
datablock AudioProfile(chrys_scream2Sound : chrys_scream1Sound)
{
filename = "./painis_2.wav";
};
datablock AudioProfile(chrys_scream3Sound : chrys_scream1Sound)
{
filename = "./duckn_alert.wav";
};
datablock AudioProfile(chrys_scream4Sound : chrys_scream1Sound)
{
filename = "./skel_buzz_skeletonalarm.wav";
};
function serverCmdhorrortest(%client)
{
if(isObject(%client.player))
%pl.schedule(1,playAudio,4,chrys_scream @ getRandom(1,4) @ Sound);
}
Clearly a simple error, as the console spits this out when I try the test command.
Add-Ons/Script_PlayerHorrorSounds/horrorsounds.cs (0): Unable to find object: '' attempting to call function 'schedule'
BackTrace: ->serverCmdhorrortest
And of course, it doesn't play the sound. To clarify, I did check that the sounds worked. They do... even though it took me like two days to figure out that they had to be 16-bit PCM wavs.