Game Modding | Call of Duty: Black Ops 3 | Scripting
ModmeBot:
Thread By: Slysur
Is there any script that could create a keycard (you pick up) that will open a certain door or multiple ones? thanks in advanced
ModmeBot:
Reply By: natesmithzombies
I am at work and Uni all day. I cannot test myself but I believe this should work:
Instructions
--------------
1) Got to your mapname.gsc and at the bottom add this code:
2) Near the top mapname.gsc you will see the main function:
Underneath that add this line:
3) Open Radiant and open the "Entity Browser". Insert a trigger>use and give it the following KVP's by pressing "N" on your keyboard.
targetname - key_trigger
Place only one of these in your map. It is the trigger for your key.
4) Now place a script>model in "Entity Browser". Select the trigger you placed in Step 3 and then select the model you just placed. Press "W" on your keyboard and then you will notice the targetname of the script model is "auto#" where # is some number. The target of the trigger should be the same auto#.
5) Now you are to place a trigger for the doors. Place a trigger>use again and give it the following KVPs:
targetname - key_door
Place as many of these as you would like around the map.
6) For each placed door trigger, place a script>model or a script>brushmodel for your door. Select first the trigger and then the script>model or script>brushmodel and link them by pressing "W" like you did in Step 4. Additionally add a KVP to initiate the spawners in that zone by adding this KVP:
script_flag - spawner_flag
"spawner_flag" should be the flag that you would use in the add_adjacent_zone function when setting up zones. Be sure script_flag is on the model and not the trigger. Also note that if your door is in pieces do this for each piece of the door.
That should be all you need. Ideally you would want a HUD to show the player has a key, but thats a bit more in depth than I can do for you right now. It isn't hard to add at all though if you take a look at how hud functions work. Let me know if this works, as I cannot test myself.
ModmeBot:
Reply By: dj_jorn
==================================================
^1
^1^
^1ERR(6E) scripts/zm/zm_fabrik.gsc (481,0) : Compiler Internal Error : Uninitialized local variable 'model'
ModmeBot:
Reply By: natesmithzombies
dj_jorn==================================================
^1
^1^
^1ERR(6E) scripts/zm/zm_fabrik.gsc (481,0) : Compiler Internal Error : Uninitialized local variable 'model'
ModmeBot:
Reply By: Slysur
Now getting this error
^1}
^1^
^1ERR(6E) scripts/zm/zm_throwback.gsc (329,1) : Compiler Internal Error : Uninitialized local variable 'i'
ModmeBot:
Reply By: TheKillerey
I added this code:
Works for me now
ModmeBot:
Reply By: Blink-420
TheKillereyI added this code:
Works for me now
ModmeBot:
Reply By: natesmithzombies
Man thats what I get for rushing at work haha. I updated the code another time to work for future visitors to this post. Nice work guys!
ModmeBot:
Reply By: Slysur
Thanks everyone! This is working great
ModmeBot:
Reply By: Blink-420
natesmithzombiesMan thats what I get for rushing at work haha. I updated the code another time to work for future visitors to this post. Nice work guys!
ModmeBot:
Reply By: natesmithzombies
Blink-420natesmithzombiesMan thats what I get for rushing at work haha. I updated the code another time to work for future visitors to this post. Nice work guys!
Love this script, been very helpful. I've tried using playfx for and effect to happen on the origin of the model when the door is unlocked... Ive used this
But can't seem to get an fx to play.. do you mind giving me some direction to what I'm doing wrong or even how I can do this? Thanks, Nate!