Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 84 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Tutorials

»
CoD4 Mapping
ratings:
Awful Rating
Poor Rating
Average Rating
Good Rating
Excellent Rating
How to make an opening door.
Versions: You must be logged in to view history.
HarkoninVSC shows you how to make an opening door

Here I will try to explain how to create a working door.

Step #1) Assuming you have a "door" cut out of your wall you need to make a "door" which will be a textured brush fitting in your wall hole.
For this tutorial well use ch_door_18.
(If you would like a door frame as well you can add one from your prefabs I like to use prefabs/zipline/door_64_frame_02.)

Step #2) Our next step is to create a "hinge" brush with the origin texture found in your tool textures. Your origin brush will act as the "hinge" so place it accordingly to where your door will open and shut from.

Step #3) Select both your "door" and "hinge" in your 2D view window and right click. Once you've right clicked scroll down to script and select brushmodel.

Step #4) We now need to make a trigger to open the door. Create a brush where you would like the player to be able to open the door from. Once the brush is created right click the 2D window and scroll down to trigger and select use_touch.

Step #5) Now that our trigger is created we will hit the N key to bring up the entity screen. Here we will give the trigger a key of Targetname and a value of doortrig. If you would like a hint to appear as well you can give it another key of hintstring with a value of "your selected message".

Step #6) Select your trigger and then your door, hit the W key to link them.

We're all done in the editor, here comes the scripting.

1st) Assuming you already have a yourmapname.gsc open it up and add the line:

maps\mp\_door::main();

above

maps\mp\_load::main();

2nd) Copy paste this script into a new text file and name it _door.gsc then save it in your maps/mp folder.

main()
{
*map stuff here*

doortriggers = getentarray("doortrig","targetname");
for(i=0;i<doortriggers.size;i++)
doortriggers[i] thread door_think();
}

door_think()
{
self.doormoving = false;
self.doorclosed = true;
self.doormodel = getent(self.target, "targetname");

while (1)
{
self waittill("trigger");
if(!self.doormoving)
self thread door_move();
}
}

door_move()
{
self.doormoving = true;
if(self.doorclosed)
{
self.doormodel rotateyaw(-90,1,0.5,0.5);
self.doormodel waittill("rotatedone");
self.doorclosed = false;
}
else
{
self.doormodel rotateyaw(90,1,0.5,0.5);
self.doormodel waittill("rotatedone");
self.doorclosed = true;
}
self.doormoving = false;
}

 

Make sure to update your zone file after you compile your bsp.

Relevant items;
rotateyaw (degree of turn, time of turn, accel time, decel time);
doorclosed and doormoving lets the script know if the door is open/closed or in motion.

doortrig is the name of your trigger.


you can also change rotateyaw to

rotateto for up and down rotation.
moveto for ((x,y,z),time)
movex to slide on an x axis
movey to slide on a y axis
movez to slide on a z axis

On a side note if you use 360 degrees for rotation you can make a revolving door.

Hopefully this helps.
Hark

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»