UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Shootable Doors, weapon specific, modify-able (Updated 12-11-14)

broken avatar :(
Created 10 years ago
by MakeCents
0 Members and 1 Guest are viewing this topic.
4,409 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Update 12-11-14, added connectpaths

Shootable Doors, that you can make weapon specific. (Meaning you have to shoot it with a certain weapon) You can also modify the script to do other things. See other.

I have included three prefabs for examples.

The following script should be placed at the bottom of your nazi_zombie_mapname.gsc:
(Be sure to thread the ShootTrigger() up in the init function. See here if you need help where to thread the function.)

Code Snippet
Plaintext
ShootTrigger(){
shoot = getentarray("shoot_door", "targetname");
requiredWeapon = "none"; //change to weapon specific name
for(trig=0;trig<shoot.size;trig++){
door = getentarray(shoot[trig].target, "targetname");
for(d=0;d<door.size;d++){
door[d] thread TrigAction(shoot[trig],requiredWeapon,"door"); //change for other action
}
shoot[trig] thread TrigAction(shoot[trig],requiredWeapon,"sound"); //change for other action
}
}
TrigAction(trig,requiredWeapon,action){
while(1){
trig waittill("trigger", player);
weapon = player getcurrentweapon();
if(requiredWeapon == "none" || weapon==requiredWeapon){
break;
}
wait(.1);
}
if(action=="door"){
move = (0,0,100);
if(isdefined(self.script_vector)){ //adjust in radiant or the door will just move up 100
move = self.script_vector;
}
speed = 1;
self moveto(self.origin + move,1);
self ConnectPaths();
trig delete();
wait(1);
// self delete(); //if you want to delete the door after it moves
}else if(action=="sound"){
play_sound_at_pos("door_slide_open", self.origin);
}
// else if(action=="other"){ //un-comment these lines and add your own action for something if you want
// //do something else, and so on
// }
}

In radiant, if you make your own doors/prefabs, you will need:
Trigger_damage with kvps:
 - targetname>shoot_door
 - target>auto138 (this number just makes it so you can put as many in as you want without the same kvp name)
Script_brushmodel with kvps:
 - targetname>auto138 (make sure this matches your trigger_damages target)
 - script_vector>x y z (script vector is optional. replace x y z with the amount of units you want to move in that direction

Last Edit: December 11, 2014, 08:58:54 pm by MakeCents

 
Loading ...