Game Modding | Call of Duty: Black Ops 3 | Scripting
ModmeBot:
Thread By: Pepergogo
I was wondering, is there a way to stop the time in the "PaP room" when you activate a trigger and then resume it?
I want to put a radio in the PaP room, but I don't want to change the time that you stay in there because is going to be like 2 - 3 minutes and I don't want like, everytime you go you need to stay that time even if you don't activate the radio.
Something like: You get to the room from the teleporter and the 60 seconds start (for example), but if you activate the radio, that time stops and when the radio sound stop, the 60 seconds resume so you can leave.
I know is like super complicated, but if anyone know how to do it I'll super really apreciated.
Sorry about the title, it's the "_NSZ Kino Teleporter"
ModmeBot:
Reply By: ihmiskeho
Open nsz_kino_teleporter.gsc and find this function:
You should see this line there:
Replace that with:
Then paste this at the bottom of the script:
You also have to edit your radio script. Make your your script sets level.radio_playing to true, when the audio starts.
This was not tested, so if it doesn't work, let me know and I'll try to fix it
ModmeBot:
Reply By: Pepergogo
ihmiskeho
Open nsz_kino_teleporter.gsc and find this function: function tele_to_room( time, num ) You should see this line there: wait( time ); Replace that with: tele_timeout( time ) Then paste this at the bottom of the script: function tele_timeout( time ) { level endon("intermission"); if(!isdefined(time)) return; time_passed = 0; while(1) { wait(1); if(!IS_TRUE(level.radio_playing)) { time_passed++; } if( time_passed >= time) break; } } You also have to edit your radio script. Make your your script sets level.radio_playing to true, when the audio starts. This was not tested, so if it doesn't work, let me know and I'll try to fix it
ModmeBot:
Reply By: Pepergogo
Ok so, I'm using the Ice Granade audio trigger:
//Trigger sound
Trig = getEnt("triggerStringhere", "targetname"); //Trigger targetname
Trig setHintString("Press &&1 to enable audio"); //Message in game
Trig waittill("trigger", action);
action playsound("audioIDhere"); //Audio ID
I have to set the "Trig" to make the "level.radio_playing" to TRUE, right?
I'm looking how to do it, but if you know how that would be awesome xD
ModmeBot:
Reply By: tom5300
Pepergogo
Ok so, I'm using the Ice Granade audio trigger: //Trigger sound Trig = getEnt("triggerStringhere", "targetname"); //Trigger targetname Trig setHintString("Press &&1 to enable audio"); //Message in game Trig waittill("trigger", action); action playsound("audioIDhere"); //Audio ID I have to set the "Trig" to make the "level.radio_playing" to TRUE, right? I'm looking how to do it, but if you know how that would be awesome xD
ModmeBot:
Reply By: ihmiskeho
What tom posted should be correct. You also have to set the level.radio_playing to false after the audio is done playing. So add these to what tom posted
So it should look something like this:
Also forgot to mention one thing in the _nzs.kino_teleporter.gsc. At the top of the file, you'll see these:
Add this below these:
ModmeBot:
Reply By: Pepergogo
You're absolutely awesomeee!!!
I'm gonna try it right away and come back in a couple of minutes.
Thanks a lot both of you! :D
ModmeBot:
Reply By: Pepergogo
ihmiskeho
What tom posted should be correct. You also have to set the level.radio_playing to false after the audio is done playing. So add these to what tom posted wait(audio_lenght); //check how many seconds long your audio file is and add it here level.radio_playing = false; So it should look something like this: Trig = getEnt("radio_audio_trigger", "targetname"); Trig setHintString("Press &&1 to turn on radio"); Trig waittill("trigger", player); player playsound("radio_sound_alias"); level.radio_playing = true; wait(audio_lenght); level.radio_playing = false; Also forgot to mention one thing in the _nzs.kino_teleporter.gsc. At the top of the file, you'll see these: // Kino Teleporter by NSZ #using scripts\zm\_zm_score; #using scripts\codescripts\struct; #using scripts\shared\flag_shared; Add this below these: #insert scripts\shared\shared.gsh;