Modme Forums

A radio script Treyarch Style?

Game Modding | Call of Duty: Black Ops 3 | Scripting


ModmeBot:

Thread By: fedkerr6
Hello, can someone make a script for a radio usable with a trigger use?
I want an Treyarch Style radio with:
1. Only one Activation for match
2. Multiple radios

|--------------------------------------------------------------------------------------------------------|
|if you help me i add you to map developers and give credits when i publish it ;)|
|--------------------------------------------------------------------------------------------------------|

Steam: fedkerr6
Sorry for my bad english, I hope you understand :P


ModmeBot:

Reply By: im_shyote
I do believe its just a sound trigger over a model:

[ICE_GRENADE'S TUT]


ModmeBot:

Reply By: ZombieKid164

fedkerr6
Hello, can someone make a script for a radio usable with a trigger use?I want an Treyarch Style radio with:1. Only one Activation for match2. Multiple radios |--------------------------------------------------------------------------------------------------------||if you help me i add you to map developers and give credits when i publish it ;)||--------------------------------------------------------------------------------------------------------| Steam: fedkerr6 Sorry for my bad english, I hope you understand :P

Hello! Hopefully you can read and/or translate this to your language (It said Italian on your steam profile I think). Anyways, what you need to do is add a trigger_use next to your radio model. give it the targetname "radio_1_trig", "radio_2_trig", and so on for each of your radios. You will also need to make each of the radio models a script_model and giving it the targetname "radio_1" and so on for the sound to play out of.

Next you will need to add an alias for your sound. You can do this by going into root\share\raw\sound\aliases and opening user_aliases.csv, and add this line to the bottom:
radio_1,,,yorsoundfolder\yoursoundname.wav,,,UIN_MOD,,,,,BUS_FX,,,,,,80,80,50,550,551,,,,,3,oldest,,,1,1,,,,,,3d,wpn_all,,NONLOOPING,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
where yoursoundfolder\yousoundname.wav would be the path to your sound from the root\sound_assets folder. You may need to mess with the volume (the 80's I believe are minimum volume and maximum volume). For all of your radio sounds, copy and paste but change "radio_1" to "radio_2" or "radio_3" and so on...

Next add the following in the main function of root\usermaps\yourmapname\scripts\yourmapname.gsc:
level thread radio_1();

and copy and paste it for each of your radios changing the number.

Then, add this to the bottom of the same script, which I've typed up for you:
function radio_1()
{
	radio_noise = "radio_1"; //This will be the name of the alias that we created earlier
	trig = GetEnt("radio_1_trig", "targetname"); //This will be the name we gave the trigger earlier
	radio = GetEnt("radio_1", "targetname");//This will be the name we gave the radio model earlier

	trig SetHintString( "Hold ^3&&1^7 to use radio" );
	trig waittill( "trigger", player );
        trig SetHintString( "" );
	radio PlaySound(radio_noise);
	//That's it!
}
Finally, copy and paste this for each of your radios replacing the radio_noise, trig, and radio variables to the correct ones for each radio, and changing the function from "function radio_1()" to "function radio_2()" and so on. Hope this helps you!

Edit: I haven't tested this, but if it doesn't work reply with what happened or your problems