Results 1 to 10 of 26

Thread: cod1-1.4: "script_origin" can't playsound()?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Private
    Join Date
    Mar 2016
    Posts
    18
    Thanks
    0
    Thanked 2 Times in 1 Post

    Question cod1-1.4: "script_origin" can't playsound()?

    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():
    Code:
    self iprintlnbold("spawned");
    self thread test();
    - the contents of test() are pretty simple:
    Code:
    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:
    Code:
    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
    Last edited by lobolmart; 3rd April 2016 at 20:35.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •