Modme Forums
Menu:

any scripts for shootble open doors?

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


ModmeBot:

Thread By: Spirit I eagle
Hey im looking for a script for a shootble open door


ModmeBot:

Reply By: natesmithzombies
This is completely untested so report back with a confirmation if it works or if it doesn't:



Instructions:

--------------

1) Copy and paste the below code at the bottom of your mapname.gsc ( Example Location: C:\SteamLibrary\steamapps\common\Call of Duty Black Ops III\usermaps\zm_test\zone_source )

function shootable_trigs()
{
	level.shootable_door_count = 0; 
	trigs = GetEntArray( "shootable_door", "targetname" ); 
	level.shootable_door_goal = trigs.size; 
	foreach( trig in trigs )
		trig thread wait_for_shoot(); 
}

function wait_for_shoot()
{
	self waittill( "trigger", player ); 
	player PlayLocalSound( "zmb_cha_ching" ); 	// Change this to any sound alias you want
	level.shootable_door_count++; 
	if( level.shootable_door_count == level.shootable_door_goal )
		self open_door(); 
}

function open_door()
{
	doors = GetEntArray( "shootable_door_reward", "targetname" ); 
	
	foreach( door in doors )
		door PlaySound( "zmb_cha_ching" ); 
	wait(0.05); 
	foreach( door in doors )
		door delete(); 
	
	flag = doors[0].script_flag; 
	level flag::set( flag ); 
}



2) At the top of your mapname.gsc add the following code:

level shootable_trigs(); 

Underneath:

function main()
{



3) In 'Entity Browser' place a trigger>damage with the following KVP's ( Press N with the trigger selected to add KVPs )

targetname - shootable_door



Note: Place as many as you would like as long as they all have the same KVPs



4) Place a script>model or script>brushmodel with the following KVPs:

targetname - shootable_door_reward

script_flag - flag_to_start_spawners_in_this_zone



Note: Place as many doors as you would like just be sure they all have the same KVPs and that the script_flag is the name of the flag that you would normally put on the trigger of the door to initiate the spawners in that zone. The script_flag is intentionally on the door and not the trigger in this script DONT PUT THE SCRIPT_FLAG ON THE TRIGGERS



Thats it. Like I said it is untested so let me know if it works. I am too occupied to test myself lol


ModmeBot:

Reply By: Pedrehitor74
I tried it and it does not work when I start the game the door is already open


ModmeBot:

Reply By: natesmithzombies

Pedrehitor74I tried it and it does not work when I start the game the door is already open


Looks like I accidentally added an 's' to trig. I edited the original code and tested it myself. It does work now. Give it another try


ModmeBot:

Reply By: Pedrehitor74
I already tried it and now if that works perfect, it could be added instead of shooting a bear to shoot 3 bears and that there will be the door? Thanks


ModmeBot:

Reply By: natesmithzombies

Pedrehitor74I already tried it and now if that works perfect, it could be added instead of shooting a bear to shoot 3 bears and that there will be the door? Thanks


Not sure what you mean here


ModmeBot:

Reply By: Pedrehitor74
As would the script if instead of shooting a bear can shoot three bears and open the door


ModmeBot:

Reply By: natesmithzombies

Pedrehitor74As would the script if instead of shooting a bear can shoot three bears and open the door


The script already accounts for as many trigger>damages as you place. If you want 3 bears to be shot just place 3 trigger>damages with the KVPs I listed on top of a teddy bear


ModmeBot:

Reply By: Spirit I eagle
Thanks dude! it works perfect


ModmeBot:

Reply By: Pedrehitor74

natesmithzombies
Pedrehitor74As would the script if instead of shooting a bear can shoot three bears and open the door


The script already accounts for as many trigger>damages as you place. If you want 3 bears to be shot just place 3 trigger>damages with the KVPs I listed on top of a teddy bear


That should put in the script so that it works when shooting to three bears


ModmeBot:

Reply By: natesmithzombies

Pedrehitor74That should put in the script so that it works when shooting to three bears


Not sure what you mean here. Can you explain?


ModmeBot:

Reply By: Spirit I eagle

Pedrehitor74
natesmithzombies
Pedrehitor74As would the script if instead of shooting a bear can shoot three bears and open the door


The script already accounts for as many trigger>damages as you place. If you want 3 bears to be shot just place 3 trigger>damages with the KVPs I listed on top of a teddy bear


That should put in the script so that it works when shooting to three bears


the scripts works like you put 3 teddy bears with 3 trigger damage. you place 3 teddys with a trigger damage around the teddys. the trigger must be called shootable_door_reward. then you pick a script model for a door and you you call that shootable_door with the script flag incl.

so you can put so many teddys with trigger damages. and you need to shoot them all and then the door opens


ModmeBot:

Reply By: Pedrehitor74

natesmithzombies
Pedrehitor74That should put in the script so that it works when shooting to three bears


Not sure what you mean here. Can you explain?


I have three bears placed on my map and I want the third bear to open the door, but with this script the door opens when I shoot the first bear


ModmeBot:

Reply By: Pedrehitor74

Spirit
Pedrehitor74
natesmithzombies
Pedrehitor74As would the script if instead of shooting a bear can shoot three bears and open the door


The script already accounts for as many trigger>damages as you place. If you want 3 bears to be shot just place 3 trigger>damages with the KVPs I listed on top of a teddy bear


That should put in the script so that it works when shooting to three bears


the scripts works like you put 3 teddy bears with 3 trigger damage. you place 3 teddys with a trigger damage around the teddys. the trigger must be called shootable_door_reward. then you pick a script model for a door and you you call that shootable_door with the script flag incl.

so you can put so many teddys with trigger damages. and you need to shoot them all and then the door opens


It does not work, On my map I have it this way

1 teddy bear- targetname:shootable_door 2 teddy bear- targetname:shootable_door 3 teddy bear- targetname:shootable_door

and at the door targetname: shootable_door_reward

I want the door to open when shooting the third bear but I always open the door when shooting the first bear


ModmeBot:

Reply By: Spirit I eagle

Pedrehitor74
Spirit
Pedrehitor74
natesmithzombies
Pedrehitor74As would the script if instead of shooting a bear can shoot three bears and open the door


The script already accounts for as many trigger>damages as you place. If you want 3 bears to be shot just place 3 trigger>damages with the KVPs I listed on top of a teddy bear


That should put in the script so that it works when shooting to three bears


the scripts works like you put 3 teddy bears with 3 trigger damage. you place 3 teddys with a trigger damage around the teddys. the trigger must be called shootable_door_reward. then you pick a script model for a door and you you call that shootable_door with the script flag incl.

so you can put so many teddys with trigger damages. and you need to shoot them all and then the door opens


It does not work, On my map I have it this way

1 teddy bear- targetname:shootable_door 2 teddy bear- targetname:shootable_door 3 teddy bear- targetname:shootable_door

and at the door targetname: shootable_door_reward

I want the door to open when shooting the third bear but I always open the door when shooting the first bear


Dont give the bear the kvp make a trigger-damage (go in radiant press b, go to trigger find trigger_damage) give that the kvp targetname:shootable_door


ModmeBot:

Reply By: natesmithzombies

SpiritDont give the bear the kvp make a trigger-damage (go in radiant press b, go to trigger find trigger_damage) give that the kvp targetname:shootable_door


What he is saying is correct. You can not give the bear the KVPs of a triggger_damage


ModmeBot:

Reply By: Pedrehitor74

natesmithzombies
SpiritDont give the bear the kvp make a trigger-damage (go in radiant press b, go to trigger find trigger_damage) give that the kvp targetname:shootable_door


What he is saying is correct. You can not give the bear the KVPs of a triggger_damage


So I have it, I have three models of bears and in each bear I have a trigger_damage, all three trigger_damage I have them target targetname: shootable_door, I only work by firing the first trigger_damage, I want you to open the door when shooting the third trigger_damage


ModmeBot:

Reply By: natesmithzombies

Pedrehitor74So I have it, I have three models of bears and in each bear I have a trigger_damage, all three trigger_damage I have them target targetname: shootable_door, I only work by firing the first trigger_damage, I want you to open the door when shooting the third trigger_damage


Then this should work for you


ModmeBot:

Reply By: hazzy155
does anybody have a list of sound aliases? or how to get them.


ModmeBot:

Reply By: natesmithzombies

hazzy155does anybody have a list of sound aliases? or how to get them.


I have always found it easier to make my own than to dig for them. I remade alot of stock aliases such as meteor_loop, deny, cha_ching. The tools are just so incomplete due to licensing issues that they cant seem to even give us the sounds to listen to anyway