Its been over a year since I made this, got bored so I've decided to remake it from scratch. With newer games releasing, BO3 isn't really as popular anymore but I'm sure this tutorial will still help someone.
I have tested this multiple times, if for some reason it doesn't work then let me know.
Useful Info
Spoiler: click to open...
"Entity Browser" Shortcut = B "Entity Info" Shortcut = N
Let me know if you think I should add anything else here.
Tutorial
Spoiler: click to open...
Part 1 - Radiant
Place the models you would like to use for your Shootables, these can be anything you want.
Select all of your models.
Go into the "Entity Browser" window.
Click "Scripts" and double-click "model".
Deselect everything.
Go back into the "Entity Browser" window.
Click "Trigger" and drag "damage" onto your map.
Resize this trigger to cover your model.
Go into the "Entity Info" window. Note: Make sure you keep the trigger selected
Double-click the "Value" field of the "targetname" property.
Type "shootable_trigger" then press Enter.
With the trigger selected, copy it and put it on any other models you have.
Select ONE trigger THEN select the model that it is covering.
Press "W" to link them.
Repeat the last two steps for each pair of triggers and models you have.
This is a short youtube video for anyone who is confused.
Spoiler: click to open...
Part 2 - Scripting
Open Windows Explorer or any other file browser.
Navigate to "root/share/raw/scripts" where "root" is your BO3 game folder.
Create a new folder named "custom".
Create a new file named "shootable.gsc". Note: You might need to have "show known file extensions" enabled to make it a .gsc
Open the newly created file.
Paste the code below into that file.
Save the file.
Code
Spoiler: click to open...
Code Snippet
Plaintext
// Credit to Archaicvirus for the updated code. I modified it a tiny bit. // I also changed some variable & function names to make it more easily readable and added simple comments.
// If you spot any optimizations that could be made let me know, at a glance it seems fine.
function init() { // Get all the entities with the targetname "shootable_trigger" then assign them to a variable. triggerArray = GetEntArray("shootable_trigger", "targetname");
// Create the shootablesNeeded level variable then set it to the amount of entities in the triggerArray variable. level.shootablesNeeded = triggerArray.size;
// Create the shootablesCollected level variable and set it to 0. level.shootablesCollected = 0;
// Loop through all the entites in triggerArray foreach(trigger in triggerArray) { // Set the HintString to "". trigger SetHintString("");
// Set the CursorHint to "HINT_NOICON". trigger SetCursorHint("HINT_NOICON");
// Create a new property on the trigger named "bottle". // Get the target entity then assign it to "bottle". trigger.bottle = GetEnt(trigger.target, "targetname");
// Call the trigger_wait function on this trigger entity. trigger thread trigger_wait(); } }
function trigger_wait() { // Wait for the trigger to be activated. self waittill("trigger");
// Delete the bottle(AKA model). self.bottle Delete();
// Increment the shootablesCollected variable. level.shootablesCollected++;
// Check if shootablesCollected is greater than or equal to shootablesNeeded. if (level.shootablesCollected >= level.shootablesNeeded) { // Call the give_reward function on the level. level thread give_reward(); }
// Print info to the screen. IPrintLnBold("Shootables Collected = [" + level.shootablesCollected + "]"); }
function give_reward() { // Print info to the screen. IPrintLnBold("Reward Given");
// Insert reward code here }
Part 3 - Finishing Touches & Compiling
Open Windows Explorer or any other file browser.
Navigate to "root/usermaps/zm_mapname/scripts/zm" where "root" is your BO3 game folder and "mapname" is your map name.
Open "zm_mapname.gsc" where "mapname" is your map name.
Thanks for fixing all the problems, should have tested it sooner since I wrote this from memory cause I couldn't get on steam at the time.
**** 1 script error(s): "function_shootable_1" with 0 parameters in "scripts/custom/shootable.gsc" at line 7 **** **** Unresolved external "function_shootable_1" with 0 parameters in "scripts/custom/shootable.gsc" ****
Idk if you changed the script but I'm getting this new error now since I recopied and pasted it.
88ninjastar's Contact & Social LinksiPhone888ninjastar
I've updated the script and changed the 2 threads at the top, but now when I run the map and shoot the triggers and models in the game, it says "Lost Connection" and the game freezes and eventually crashes.