lobolmart
3rd April 2016, 20:32
hello,
TL;DR: the common method (way of playing a sound at a location) PlaySoundAtLocation() which uses a "script_origin" entity isn't working for me, for some odd reason.
i do see usage of that in the old AWE for COD1 and also in the main pk3's (e.g. _utils::PlaySoundAtLocation()), so i must be doing something wrong here.
setup (creating a test mod):
- i copy the default "mp/gametypes/tdm.gsc" (from the bundled pk3) into a new mod folder called "test"
- i add the following two lines of code in tdm.gsc::spawnPlayer():
self iprintlnbold("spawned");
self thread test();
- the contents of test() are pretty simple:
test()
{
self endon("death");
self endon("disconnect");
self endon("spectate");
self iprintlnbold("enter thread");
wait 1.0;
self playsound("whizby");
wait 1.0;
while (1) {
org = spawn("script_origin", origin);
org playsound("whizby"); // <----------- no working
wait 1.0;
org delete();
}
}
testcase:
- i start the sever with "CoDMP.exe +set fs_game test"
- then i enter in the console:
set g_gametype "tdm"
map mp_carentan
entering a team:
- "spawned" is printed
- "enter thread" is printed
- a "whizby" sound is played only once (i.e. only the "self playsound(...)" one)
any ideas why the script entity isn't playing sound?
notes:
- my goals is pretty much to play a non-client, non-looping, sound at a specific location
- i've also tried with "script_model' and the model spawns but...no sound.
- i've tried with many different sound aliases including some bundled ones that AWE seems to use like "generic_pain_*", to no avail.
cheers
TL;DR: the common method (way of playing a sound at a location) PlaySoundAtLocation() which uses a "script_origin" entity isn't working for me, for some odd reason.
i do see usage of that in the old AWE for COD1 and also in the main pk3's (e.g. _utils::PlaySoundAtLocation()), so i must be doing something wrong here.
setup (creating a test mod):
- i copy the default "mp/gametypes/tdm.gsc" (from the bundled pk3) into a new mod folder called "test"
- i add the following two lines of code in tdm.gsc::spawnPlayer():
self iprintlnbold("spawned");
self thread test();
- the contents of test() are pretty simple:
test()
{
self endon("death");
self endon("disconnect");
self endon("spectate");
self iprintlnbold("enter thread");
wait 1.0;
self playsound("whizby");
wait 1.0;
while (1) {
org = spawn("script_origin", origin);
org playsound("whizby"); // <----------- no working
wait 1.0;
org delete();
}
}
testcase:
- i start the sever with "CoDMP.exe +set fs_game test"
- then i enter in the console:
set g_gametype "tdm"
map mp_carentan
entering a team:
- "spawned" is printed
- "enter thread" is printed
- a "whizby" sound is played only once (i.e. only the "self playsound(...)" one)
any ideas why the script entity isn't playing sound?
notes:
- my goals is pretty much to play a non-client, non-looping, sound at a specific location
- i've also tried with "script_model' and the model spawns but...no sound.
- i've tried with many different sound aliases including some bundled ones that AWE seems to use like "generic_pain_*", to no avail.
cheers