I have recently added radios to my map and for some reason the sound/music will not play after activating the radio trigger.
I have converted the sounds correctly, ticked them in the IWD file list etc.
This is the script in the mapname.gsc
Code Snippet
Plaintext
radio1() { radio = getEnt("radio1", "targetname"); //this is the radio model that the sound will come from radio_trigger = getEnt("radio1_trigger", "targetname"); //the trigger that you will use to start the sound
radio_trigger setCursorHint("HINT_NOICON"); radio_trigger UseTriggerRequireLookAt(); radio_trigger setHintString("Press &&1 to activate radio"); //remove this if you don't want a hintstring
I have recently added radios to my map and for some reason the sound/music will not play after activating the radio trigger.
I have converted the sounds correctly, ticked them in the IWD file list etc.
This is the script in the mapname.gsc
Code Snippet
Plaintext
radio1() { radio = getEnt("radio1", "targetname"); //this is the radio model that the sound will come from radio_trigger = getEnt("radio1_trigger", "targetname"); //the trigger that you will use to start the sound
radio_trigger setCursorHint("HINT_NOICON"); radio_trigger UseTriggerRequireLookAt(); radio_trigger setHintString("Press &&1 to activate radio"); //remove this if you don't want a hintstring
self SetHintString("Press ^3&&1^7 to activate radio"); self waittill("trigger", player); self SetHintString("This radio is currently playing");
if(radio_is_playing == false) { radio_is_playing = true; self PlaySound(self.script_sound); wait(9); // sound playback time in seconds radio_is_playing = false; } else if(radio_is_playing == true) { self SetHintString("Another radio is currently playing!"); wait(1.5); } } }
Make sure you have your sound converted correctly if you have to just reconvert it if this doesn't work, I just tested it and it works 100%. If you have any questions please let me know.
Check your kvp's and scripts again if something doesn't work. Or use this to check if your radio can be found:
Code Snippet
Plaintext
if ( !IsDefined(radio1) ) { iPrintLnBold("Radio not found!"); }
My bad, I meant that I have two differient radios. The first one has the kvp "radio1" and the second one "radio2". The game does recognise the radios and the trigger can be activated but the sound/music does not play.
It can be a few things: 1, I am not sure if your soundalias is right, if you aren't using a default one then pick one or use the one below the reply. 2, The range is really low, set it to 8000 or something. 3, You can also try this:
Code Snippet
Plaintext
radio = getEnt("radio1", "targetname"); playsoundatposition("radio1", radio.origin);
For one of my maps I used this soundalias to make it working, you can copy it if you like:
It can be a few things: 1, I am not sure if your soundalias is right, if you aren't using a default one then pick one or use the one below the reply. 2, The range is really low, set it to 8000 or something. 3, You can also try this:
Code Snippet
Plaintext
radio = getEnt("radio1", "targetname"); playsoundatposition("radio1", radio.origin);
For one of my maps I used this soundalias to make it working, you can copy it if you like: