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

[Tutorial] Power/Pap Doors

broken avatar :(
Created 9 years ago
by alaurenc9
0 Members and 1 Guest are viewing this topic.
4,530 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2012
Last active: 9 months ago
Posts
577
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
My preferred name is "xSanchez78".
Check me out here: www.steamcommunity.com/id/xSanchez78
×
alaurenc9's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
alaurenc9's Contact & Social LinksxSanchez78xSanchez78xSanchez78xSanchez78xSanchez78xSanchez78
Hello Guys.
Today I have created a small yet useful script.
This covers power and pap doors.
What is a power door?
A power door is a door that opens after the power is activated.
Isn't that already in the game like verruckt and der riese?
Yes it is but I'm pretty sure almost no one, not even I, knows how to use it.
Therefore I just created a script that is simpler and is seperated from all the other complex scripts in the game.
What is a pap door?
A pap door is a door that opens after all der riese style teleporters are linked.
This part of the script only applies to people using der riese style teleporting in their map.
Isn't that also already in world at war in the map der riese?
Yes it is, but I have some reasons that I think people will understand for making a new script.
1. The original pap door is basically the script_model for the pap door and an invisible clip infront of it so that nobody can walk through the model. In the original dlc3_teleporter script, the script model will move down a little on the first link, again on the second, and then all the way down on the third followed by the clip deleting. That is a bit complicated for those who want to just simply add a pap door.
2. The script_model used in der riese is a certain size. The treyarch map makers have made the dlc3_teleporter script make the model move down certain amounts of units. Therefore it will only look proper when you use the pap door script_model or another script_model/script_brushmodel that is the exact same size as the pap door model. Some may want a different model, that is a different size. But the movement for it will not look good unless you go in and re-count the units you want the door to move and then edit that in the dlc3_teleporter script. I know I dont want to do that, and Im sure others dont aswell. My script just waits for all teleporters to be linked, and then gives an easy way to make the door move where ever YOU want it to, no hassle required.
Those are my reasons for remaking the power/pap doors. Now lets get to installation.

Get a ".gsc" file.
Name it "power_pap_door.gsc".
Put the following in it:
Code Snippet
Plaintext
//================================================================================================
// Script Name : Door That Opens After Power is Activated, Door That Opens After All Three Teleporters Are Linked
// Author : xSanchez78
// Moving Door Help : Gamer9294
// Online Link : http://ugx-mods.com/forum/index.php?topic=4613.0
// Notes : call "maps\power_pap_door::main();" after "maps\_zombiemode::main();" in "mapname.gsc".
//================================================================================================
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;

main()
{
//make sure to edit this --------------------------
self.power_dr_z = -150; //value = amount of units the door moves on the Z axis. Positive values move the door UP; negative values move the door DOWN.
self.power_dr_x = 0; //value = amount of units the door moves on the X axis. Positive values move the door RIGHT; negative values move the door LEFT.
self.power_dr_y = 0; //value = amount of units the door moves on the Y axis. Positive values move the door FORWARD; negative values move the door BACKWARD.
self.pap_dr_z = -150; //value = amount of units the door moves on the Z axis. Positive values move the door UP; negative values move the door DOWN.
self.pap_dr_x = 0; //value = amount of units the door moves on the X axis. Positive values move the door RIGHT; negative values move the door LEFT.
self.pap_dr_y = 0; //value = amount of units the door moves on the Y axis. Positive values move the door FORWARD; negative values move the door BACKWARD.

//don't edit this ---------------------------------
thread power_door();
thread pap_door();
}

power_door()
{
hintstring_trigger1 = getEnt("power_door1_hintstring", "targetname");
hintstring_trigger1 UseTriggerRequireLookat();
hintstring_trigger1 setCursorHint( "HINT_NOICON" );
hintstring_trigger1 sethintstring( "Power must be activated first" ); //hintstring text to notify player of what needs to occur for the door to open
flag_wait("electricity_on");
wait 1;
hintstring_trigger1 delete();
players = get_players();
for( i = 0; i < players.size; i++ )
{
players[i] playsound("door_slide_open");
}
power_door1 = getEnt("power_door1", "targetname");
power_door1 notsolid();
power_door1 moveZ( self.power_dr_z, 2);
power_door1 moveX( self.power_dr_x, 2);
power_door1 moveY( self.power_dr_y, 2);
wait 2.2;
power_door1 delete();
}

pap_door()
{
hintstring_trigger1 = getEnt("pap_door1_hintstring", "targetname");
hintstring_trigger1 UseTriggerRequireLookat();
hintstring_trigger1 setCursorHint( "HINT_NOICON" );
hintstring_trigger1 sethintstring( "All Three Teleporters Must Be Linked First" ); //hintstring text to notify player of what needs to occur for the door to open
flag_wait( "teleporter_pad_link_3" );
wait 1;
hintstring_trigger1 delete();
players = get_players();
for( i = 0; i < players.size; i++ )
{
players[i] playsound("door_slide_open");
}
pap_door1 = getEnt("pap_door1", "targetname");
pap_door1 notsolid();
pap_door1 moveZ( self.pap_dr_z, 2);
pap_door1 moveX( self.pap_dr_x, 2);
pap_door1 moveY( self.pap_dr_y, 2);
wait 2.2;
pap_door1 delete();
}



Add "maps\power_pap_door::main();" after "maps\_zombiemode::main();" in "mapname.gsc".
Adding a second/third/fourth/cont. door should be self explanitory after reading the script.
Make sure at the top to change how you want the door to move after it has been told to open.
Go into radiant.
Make either a script_model or script_brushmodel for your door(s).
Make the power door this:
targetname = power_door1

Make the pap door this:
targetname = pap_door1

Now put a trigger_use infront of each door.
These will not be for using, only for showing a hintstring that informs the players what action needs to occur for the door to open.
Example: "The power must be activated first"
Trying to use the trigger_use will have no effect, do not worry.
They will also be deleted along with the door, so no worries about extra unneeded entities on your map.
Make the trigger_use infront of the power door this:
targetname = power_door1_hintstring

Make the one in front of the pap door this:
targetname - pap_door1_hintstring

Save & Close.
Compile Map.
In mod builder, make sure to check the following:
power_pap_door.gsc
mapname.gsc

Build Mod.

Credit me, xSanchez78, for this tutorial.
By the way, some people thought alaurenc9 and xSanchez78 were two different people.
Well my zombiemodding name is alaurenc9, my steam, ps3, ps4, xbox, and any other thing's name is xSanchez78.
So dont think we are to different people, Lol.
Credits to Gamer9294 for helping with the moving door ideas.
And the setup for people to easily make the door move wherever they want it to.
Example video, NOT MADE BY ME!, it was made by Gamer9294.
www.youtube.com/watch?v=Ulnxi_UwRkM
Enjoy and peace.
Last Edit: November 07, 2014, 05:46:53 am by alaurenc9

 
Loading ...