Make door open after a certain amount of kills.

broken avatar :(
Created 1345 days ago
by Warheez
0 Members and 1 Guest are viewing this topic.
1,719 views
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 September 2015
Last active: 490 days ago
Posts
4
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
Warheez's Groups
Warheez's Contact & Social Links
I am currently working on a challenge map, and i want a door to open, after the player gets 200 kills. I'm really not onto scripting, and didn't find any script for this for BO3, so please help.
Marked as best answer by Warheez on Today at 06:22:13 pm
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 days 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
For this I would make a custom door script. Lets keep it simple at first. Have a trigger_use and a script_brushmodel. Select the trigger, then the brush, and press w. Make the trigger targetname totalkills.

In script you would get each trigger and thread a function on them. In this function you would get the triggers target, as an ent or as an array depending on your door. From here it depends how you want to open the door. Up, side, split? I find a friendly way to change you mind is to set a script_struct as the target of the door/brush, rather than using a script_vector kvp, and make it so the door will move to that structs origin from its origin.

I'm not sure how to check total kills, but I would guess checking each players kills would work, and there is stuff in _zm_stats.gsc for that.

Something like this might work, idk. I just wrote it up quick, could be fool of errors too, lol. Name script kill_doors.gsc
#using scripts\shared\array_shared;
#using scripts\codescripts\struct;

/*
#####################
by: M.A.K.E C E N T S
#####################
Script:

Add to main in mapname.gsc
kdoors::init(  );

Add to top of mapname.gsc
#using scripts\zm\kill_doors;

Add to zone file
scriptparsetree,scripts/zm/kill_doors.gsc

###############################################################################
Radiant:

trigger targers script brushmodel
targetname>totalkills
zombie_cost># of kills
script_flag>flag to set for zone

script brushmodel targets a struct (the brush will move to this origin - optional)
targetname will be auto#
target will be auto# matching structs targetname

structs targetname will also be auto# matching brushes target
###############################################################################
*/

#namespace kdoors;

function init()
{
level.totalkills = 20;
trigs = GetEntArray("totalkills","targetname");
array::thread_all(trigs, &SetupDoors);
}

function SetupDoors()
{
if(!IsDeflected(self.zombie_cost))
{
self.zombie_cost = level.totalkills;
}
self SetHintString("You must reach " + self.zombie_cost + " kills to open this door");
self SetCursorHint("HINT_NOICON");
self thread WaitForKills();
}

function WaitForKills()
{
self thread OperateDoor();
if(isdefined(self.scrpt_flag))
{
flag::init(self.script_flag);
}
while(1)
{
if(GetKills() >= self.zombie_cost)
{
self OperateDoor(true);
if(isdefined(self.script_flag))
{
flag::set(self.script_flag);
}
self Delete();
return;
}
wait(.1);
}
}

function GetKills()
{//not sure about this function, never go kills before
totalkills = 0;
players = GetPlayers();
for( i=0;i<players.size;i++ ){
if(isdefined(players[i].pers["kills"]))
{
totalkills += players[i].pers["kills"];
}
}
return totalkills;
}

function OperateDoor(open = false)
{
doors = GetEntArray(self.target,"targetname");
foreach(door in doors)
{
if(open)
{
door NotSolid();
door ConnectPaths();
door thread OpenDoor();
}
else
{
door DisconnectPaths();
}

}
}

function OpenDoor()
{
dest = self.origin + (0,0,80);
if(IsDeflected(self.target))
{
mystruct = struct::get(self.target, "targetname");
if(IsDeflected(mystruct))
{
dest = mystruct.origin;
}
}
if(isdefined(self.script_vector))
{
dest = self.origin + self.script_vector;
}
//play sound
//play fx
//change speed of door opening
self MoveTo(dest, 1);
}
Last Edit: December 05, 2016, 06:34:10 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: at
Date Registered: 26 November 2016
Last active: 712 days ago
Posts
45
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Signature
12 year old music critic, quadrasexual Minecrafter, Linkin Park fan, Hentai enthusiast, intelligent atheist and vegan.
×
Cxwh's Groups
Cxwh's Contact & Social LinksCxwhModsGodAspire
I know this may sound stupid, but can't I do this when the amount of kills is reached
trigger notify("trigger", self);

 

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
Loading ...