Modme Forums

Making Prefabs appear on a certain round

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


ModmeBot:

Thread By: Noah Gamerscore

Im making an old map that was in WaW custom zombies and it had the Nuketown style perks where they spawn in on a certain round.

Can anyone help me make that script. I will give 100% credit when i publish the map.


ModmeBot:

Reply By: soul-toktzt

Noah

Im making an old map that was in WaW custom zombies and it had the Nuketown style perks where they spawn in on a certain round.

Can anyone help me make that script. I will give 100% credit when i publish the map.

I know you can have models / brushes hidden and make them show up when you turn on the power, but i have no idea how to modify the script so it would be on a certain round.

Want me to give you the script to make something show up after power's on?

Maybe you can put a script_brushmodel with a texture in front of it so it's "not there". :p and delete / hide the brush after a certain round.


ModmeBot:

Reply By: CT8918

Noah Gamerscore
Im making an old map that was in WaW custom zombies and it had the Nuketown style perks where they spawn in on a certain round.Can anyone help me make that script. I will give 100% credit when i publish the map.

Here you go.

Test Footage/Demonstration:
(Note: I made it into one function since then for simplicity)


Instructions:

1. Open your map's gsc file. Go to:
C:\Program Files (x86)\Steam\steamapps\common\Call of Duty Black Ops III\usermaps\your_map\scripts\zm\your_map.gsc

2. Put this in your map gsc's main() function. Near the bottom should suffice. Calls the function.
- Replace this with the round number you want everything to be shown at.
level thread show_at_round();


3. Add this function to your map's gsc file. It is filled with an example for a prefab, a model, and a brushmodel.

//*************************************************************************************************************************************************************************************
// SHOW_AT_ROUND
//*************************************************************************************************************************************************************************************
/*
Author: CT8918
Waits until a designated round and then shows the hidden entities.
round - integer that designates what round entities will be shown at.
*/
function show_at_round(round)
{
	/***START HIDING THINGS***/
	
	//PREFAB example. Commented out. 
	//Rename the variable(whatever_you_want). Make sure to get all 3.
	//Rename the targetname string(whatever_you_use_as_the_targetname) to what you use in Radiant. 
	//Copy and paste this code block somewhere in this section below. 
	/*
	whatever_you_want = GetEntArray("whatever_you_use_as_the_targetname", "targetname");
	for( i=0; i < whatever_you_want.size; i++ )
	{
		whatever_you_want[i] Hide();
	}
	*/
	
	//MODEL example. Commented out. 
	//Rename the variable(whatever_you_want). Make sure to get all 2.
	//Rename the targetname string(whatever_you_use_as_the_targetname) to what you use in Radiant. 
	//Copy and paste this code block somewhere in this section below. 
	/*
	whatever_you_want = GetEnt("whatever_you_use_as_the_targetname", "targetname"); // Gets the entity with the targetname.
	whatever_you_want Hide();
	*/
	
	//BRUSHMODEL example. Commented out. 
	//Rename the variable(whatever_you_want). Make sure to get all 2.
	//Rename the targetname string(whatever_you_use_as_the_targetname) to what you use in Radiant. 
	//Copy and paste this code block somewhere in this section below. 
	/*
	whatever_you_want = GetEnt("whatever_you_use_as_the_targetname", "targetname"); // Gets the entity with the targetname.
	whatever_you_want Hide();
	*/
	
	//Paste below and before the END HIDING THINGS
	
	
	//---END HIDING THINGS---//
	
	/***START WAITING FOR ROUND - DO NOT EDIT***/
	
	while(1)
	{
		level waittill("between_round_over");
		if(level.round_number  >= round)
		{
			break;
		}
	}
	
	//---END WAITING FOR ROUND - YOU BETTER HAVE NOT EDITED THIS UNLESS YOU KNEW WHAT YOU WERE DOING!---//

	/***START SHOWING THINGS***/
	
	//PREFAB example. Commented out. 
	//Rename the variable(whatever_you_want). 2 instances.
	//Rename the targetname string(whatever_you_use_as_the_targetname) to what you use in Radiant.
	//Copy and paste this code block somewhere in this section below. 
	/*
	for( i=0; i < whatever_you_want.size; i++ )
	{
		whatever_you_want[i] Show();
	}
	*/
	
	//MODEL example. Commented out. 
	//Rename the variable(whatever_you_want). Make sure to get all 2.
	//Rename the targetname string(whatever_you_use_as_the_targetname) to what you use in Radiant. 
	//Copy and paste this code block somewhere in this section below. 
	/*
	whatever_you_want Hide();
	*/
	
	//BRUSHMODEL example. Commented out. 
	//Rename the variable(whatever_you_want). Make sure to get all 2.
	//Rename the targetname string(whatever_you_use_as_the_targetname) to what you use in Radiant. 
	//Copy and paste this code block somewhere in this section below. 
	/*
	whatever_you_want Hide();
	*/
	
	//Paste below and before the END SHOWING THINGS

		
	//---END SHOWING THINGS---//
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// END SHOW_AT_ROUND
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

4. This is where things vary. I have examples above. Add as many as you need.
a) If you want to to do this to a prefab:
1. Go into prefab within Radiant.
2. Make sure everything within the prefab is a script_model or script_brushmodel.
3. Have nothing selected and press I to select everything.
4. Give it a unique targetname.
5. Go into your gsc file.
6. In the Hiding Things section (I have provided an example):
1. Get all the entities with that targetname.
2. Use a for-loop to hide all of those entities.

7. In the Show Things section (I have provided an example):
1. Use a for-loop to show all of those entities.
8. Do this for all prefabs you have.

b) If you want to to do this to a model or brushmodel:
1. Select entity within Radiant.
2. Make sure it is a script_model or script_brushmodel..
3. Give it a unique targetname.
4. Go into your gsc file.
5. In the Hiding Things section (I have provided an example):
1. Get the entity with that targetname.
2. Use hide function to hide the entity.

6. In the Show Things section (I have provided an example):
1. Use hide function to show the entity.
7. Do this for all entities you have.


If you need help, just ask. I have tried my best to provide a template.