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

closable door

broken avatar :(
Created 8 years ago
by Fire Level One
0 Members and 1 Guest are viewing this topic.
4,609 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 17 October 2015
Last active: 3 years ago
Posts
47
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Groups
More
My Contact & Social Links
More
×
Fire Level One's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Fire Level One's Contact & Social LinksFireLevelOneFireLevelOne
Does anybody know how to make a door that can be activated again to close or make a trigger_use decide where a script_brushmodel moves?
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
Location: br
Date Registered: 10 December 2013
Last active: 2 years ago
Posts
159
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
Linoxet's Groups
Linoxet's Contact & Social LinksTutizillalinoxetbanguela
Code Snippet
Plaintext
thread move_door(); //add this below maps\_zombiemode::main(); in _nazi_zombie_mapname.gsc

Code Snippet
Plaintext
move_door() //add this to the bottom of _nazi_zombie_mapname.gsc
{
door = GetEnt("YourDoorNameHere", "targetname"); //change YourDoorNameHere to your door targetname kvp
trigger = GetEnt("YourTriggerNameHere", "targetname"); //change YourTriggerNameHere to your trigger targetname kvp

pos_closed = ""; //change here to your door closed position
pos_open = ""; //change here to your door open position

door_is = true; //I'm assuming your door starts closed, if don't, change this to false

while(1)
{
trigger waittill("trigger");

if (door_is)
{
door MoveTo(pos_open, 0.5);
}
else
{
door MoveTo(pos_closed, 0.5);
}
wait .1;
}
}

Should work :p
Last Edit: June 22, 2016, 11:02:34 pm by Linoxet
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 17 October 2015
Last active: 3 years ago
Posts
47
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Groups
More
My Contact & Social Links
More
×
Fire Level One's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Fire Level One's Contact & Social LinksFireLevelOneFireLevelOne
By
Code Snippet
Plaintext
pos_closed = ""; //change here to your door closed position
pos_open = ""; //change here to your door open position

you mean change the coordinates of the door and not the script_vector right?
broken avatar :(
×
broken avatar :(
Location: br
Date Registered: 10 December 2013
Last active: 2 years ago
Posts
159
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
Linoxet's Groups
Linoxet's Contact & Social LinksTutizillalinoxetbanguela
By
Code Snippet
Plaintext
pos_closed = ""; //change here to your door closed position
pos_open = ""; //change here to your door open position

you mean change the coordinates of the door and not the script_vector right?

Sorry for not being very clear, I've done some changes in the code, use this one, is better :D
Code Snippet
Plaintext
move_door() //add this to the bottom of _nazi_zombie_mapname.gsc
{
door = GetEnt("YourDoorNameHere", "targetname"); //change YourDoorNameHere to your door targetname kvp
trigger = GetEnt("YourTriggerNameHere", "targetname"); //change YourTriggerNameHere to your trigger targetname kvp

door_is = true; //I'm assuming your door starts closed, if don't, change this to false

while(1)
{
trigger waittill("trigger");

if (door_is)
{
door MoveTo(door.origin + (door.script_vector * -1), 0.5);
}
else
{
door MoveTo(door.origin + (door.script_vector), 0.5);
}
wait .1;
}
}

Just set the script_vector kvp in your door like a normal door.
Last Edit: June 23, 2016, 12:15:34 am by Linoxet
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 17 October 2015
Last active: 3 years ago
Posts
47
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Groups
More
My Contact & Social Links
More
×
Fire Level One's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Fire Level One's Contact & Social LinksFireLevelOneFireLevelOne
Sorry for not being very clear, I've done some changes in the code, use this one, is better :D
Code Snippet
Plaintext
move_door() //add this to the bottom of _nazi_zombie_mapname.gsc
{
door = GetEnt("YourDoorNameHere", "targetname"); //change YourDoorNameHere to your door targetname kvp
trigger = GetEnt("YourTriggerNameHere", "targetname"); //change YourTriggerNameHere to your trigger targetname kvp

door_is = true; //I'm assuming your door starts closed, if don't, change this to false

while(1)
{
trigger waittill("trigger");

if (door_is)
{
door MoveTo(door.origin + (door.script_vector * -1), 0.5);
}
else
{
door MoveTo(door.origin + (door.script_vector), 0.5);
}
wait .1;
}
}

Just set the script_vector kvp in your door like a normal door.

I'm a toldler when it comes to writing code, so thank you for your help!
I can't test it since I'm on vacation, but I'm sure it works.
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
Don't forget to connect and disconnect paths on the door, and make sure the zombies have an alternative path around to the active zone the player could be in, or remove the zone that no player(s) is/are in.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 17 October 2015
Last active: 3 years ago
Posts
47
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Groups
More
My Contact & Social Links
More
×
Fire Level One's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Fire Level One's Contact & Social LinksFireLevelOneFireLevelOne
Sorry for not being very clear, I've done some changes in the code, use this one, is better :D
Code Snippet
Plaintext
move_door() //add this to the bottom of _nazi_zombie_mapname.gsc
{
door = GetEnt("YourDoorNameHere", "targetname"); //change YourDoorNameHere to your door targetname kvp
trigger = GetEnt("YourTriggerNameHere", "targetname"); //change YourTriggerNameHere to your trigger targetname kvp

door_is = true; //I'm assuming your door starts closed, if don't, change this to false

while(1)
{
trigger waittill("trigger");

if (door_is)
{
door MoveTo(door.origin + (door.script_vector * -1), 0.5);
}
else
{
door MoveTo(door.origin + (door.script_vector), 0.5);
}
wait .1;
}
}

Just set the script_vector kvp in your door like a normal door.

there's a problem, when I use this code the door keeps sliding further and further away instead of coming back.  :derp:
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
there's a problem, when I use this code the door keeps sliding further and further away instead of coming back.  :derp:

use this code (its the exact same apart from Linoxet fogot to add the state changes to make it open / close)

Code Snippet
Plaintext
move_door() //add this to the bottom of _nazi_zombie_mapname.gsc
{
door = GetEnt("YourDoorNameHere", "targetname"); //change YourDoorNameHere to your door targetname kvp
trigger = GetEnt("YourTriggerNameHere", "targetname"); //change YourTriggerNameHere to your trigger targetname kvp

door_is = true; //I'm assuming your door starts closed, if don't, change this to false

while(1)
{
trigger waittill("trigger");

if (door_is)
{
door MoveTo(door.origin + (door.script_vector * -1), 0.5);
door_is = false; // WARDOGSK93 - Door will slide other direction next time its triggered
}
else
{
door MoveTo(door.origin + (door.script_vector), 0.5);
door_is = true; // WARDOGSK93 - Door will slide other direction next time its triggered
}
wait .1;
}
}
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 17 October 2015
Last active: 3 years ago
Posts
47
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Groups
More
My Contact & Social Links
More
×
Fire Level One's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Fire Level One's Contact & Social LinksFireLevelOneFireLevelOne
use this code (its the exact same apart from Linoxet fogot to add the state changes to make it open / close)

Code Snippet
Plaintext
move_door() //add this to the bottom of _nazi_zombie_mapname.gsc
{
door = GetEnt("YourDoorNameHere", "targetname"); //change YourDoorNameHere to your door targetname kvp
trigger = GetEnt("YourTriggerNameHere", "targetname"); //change YourTriggerNameHere to your trigger targetname kvp

door_is = true; //I'm assuming your door starts closed, if don't, change this to false

while(1)
{
trigger waittill("trigger");

if (door_is)
{
door MoveTo(door.origin + (door.script_vector * -1), 0.5);
door_is = false; // WARDOGSK93 - Door will slide other direction next time its triggered
}
else
{
door MoveTo(door.origin + (door.script_vector), 0.5);
door_is = true; // WARDOGSK93 - Door will slide other direction next time its triggered
}
wait .1;
}
}

It works! (kinda) if you hit the button again while it's transitioning it will move it too far putting it out of place.  :'(
I don't know if you can fix this or not but if you can I'd appreciate it.
Marked as best answer by Fire Level One 8 years ago
broken avatar :(
×
broken avatar :(
Location: br
Date Registered: 10 December 2013
Last active: 2 years ago
Posts
159
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
Linoxet's Groups
Linoxet's Contact & Social LinksTutizillalinoxetbanguela
It works! (kinda) if you hit the button again while it's transitioning it will move it too far putting it out of place.  :'(
I don't know if you can fix this or not but if you can I'd appreciate it.

Oh, really sorry about that, I was very sleepy when I did the code, forgot some things  :(
Should work without any problems now

Code Snippet
Plaintext
move_door() //add this to the bottom of _nazi_zombie_mapname.gsc
{
door = GetEnt("YourDoorNameHere", "targetname"); //change YourDoorNameHere to your door targetname kvp
trigger = GetEnt("YourTriggerNameHere", "targetname"); //change YourTriggerNameHere to your trigger targetname kvp

door_is = true; //I'm assuming your door starts closed, if don't, change this to false
door_can_move = true;

while(1)
{
trigger waittill("trigger");

if (door_can_move)
{
if (door_is)
{
door_can_move = false;
door MoveTo(door.origin + (door.script_vector * -1), 0.5);
wait 0.5;
door_can_move = true;
door_is = false; // WARDOGSK93 - Door will slide other direction next time its triggered
}
else
{
door_can_move = false;
door MoveTo(door.origin + (door.script_vector), 0.5);
wait 0.5;
door_can_move = true;
door_is = true; // WARDOGSK93 - Door will slide other direction next time its triggered
}
}
wait .1;
}
}
Last Edit: June 25, 2016, 05:50:58 pm by Linoxet
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 17 October 2015
Last active: 3 years ago
Posts
47
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Groups
More
My Contact & Social Links
More
×
Fire Level One's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Fire Level One's Contact & Social LinksFireLevelOneFireLevelOne
Oh, really sorry about that, I was very sleepy when I did the code, forgot some things  :(
Should work without any problems now

Code Snippet
Plaintext
move_door() //add this to the bottom of _nazi_zombie_mapname.gsc
{
door = GetEnt("YourDoorNameHere", "targetname"); //change YourDoorNameHere to your door targetname kvp
trigger = GetEnt("YourTriggerNameHere", "targetname"); //change YourTriggerNameHere to your trigger targetname kvp

door_is = true; //I'm assuming your door starts closed, if don't, change this to false
door_can_move = true;

while(1)
{
trigger waittill("trigger");

if (door_can_move)
{
if (door_is)
{
door_can_move = false;
door MoveTo(door.origin + (door.script_vector * -1), 0.5);
wait 0.5;
door_can_move = true;
door_is = false; // WARDOGSK93 - Door will slide other direction next time its triggered
}
else
{
door_can_move = false;
door MoveTo(door.origin + (door.script_vector), 0.5);
wait 0.5;
door_can_move = true;
door_is = true; // WARDOGSK93 - Door will slide other direction next time its triggered
}
}
wait .1;
}
}

100% works now, thank you!

 
Loading ...