MODSonline
  Welcome Guest to MODSonline Home | Forums | Register | Login
Main-Menu
Home
Login
Register
Add Download
Add News
Add Tutorial *
Forums

Advertise
Affiliate Store US *
Affiliate Store UK *
Affiliate Store CA *
Angry Letter Generator
Avatar Upload
Calendar of Games
Contact
Downloads
FAQs
Forums
Member List
Member Projects
News
News Grabber *
Policy
Polls
Private Messages
Reviews
Screenshot Gallery
Search
Servers - Game
Store - Shirts *
Subscribe
Topics
Tutorials
Weblinks
Wiki *
Tutorials
CoD Mapping
CoDUO Mapping
CoD2 Mapping
CoD4 Mapping
CoD FAQs
HL2 Mapping
HL2 FAQs
SOF1 Mapping
Crysis Mapping
Q4 Mapping
Doom 3 Mapping
Doom 3 FAQs
UT2K3 Mapping
SOF2 Mapping
SOF2 FAQs

Lightray Modeling
General Modeling
General Modding
Adobe Photoshop
Common Mapping Errors

Readme.txt Generator
Members-Online
Spikenaylor [Forum]
cz_squishy [Forum]
Morphisnb [Forum]
Welshy [Today]
MasterChief [Today]

5 Members and 8 Guests
Chat MODSonline
0 People Now Chatting
MODSOnline TeamSpeak

download TeamSpeak

In-The-News
Sunday, Oct. 12th
MODSonair 149 Live
Friday, Oct. 10th
Far Cry 2 Money, Diamonds, and Blood Trailer
Friday, Oct. 10th
MODSonair Episode 148
Thursday, Oct. 9th
Multiplayer Game Modes Interview
Sunday, Oct. 5th
Help MODSonline Heal Kids and Fight Cancer!
Latest Poll
Would you pay for mod tools?
I would pay a one time fee for mod tools for my favorite title 11.71%
I would pay a monthly/yearly subsrciption fee for mod tools for my favorite title 0%
I already paid for the game - Tools should come bundled because I am just fixing what the developers broke 61.26%
100% definitely NOT! 21.62%
I haven't seen a game yet that wasn't 100% perfect when the developers released it 3.6%
Games are the devil! 1.8%
Read More...
11 comments

Newsletter
Name:
Email:
Newsletter Archives
Your Membership
User Name:
Password:
Register.
In The Forums
S&D bombzone label 'C'
CoD 4 Level Desi.. Posts: (1) Views: (9) by bashup
xmodels
CoD 4 Level Desi.. Posts: (4) Views: (54) by Squit
Far Cry 2 SecuROM DRM Details
News Around the .. Posts: (4) Views: (20) by techno2sl
[Release] mp_cc & mp_cc_night Final
CoD4 Custom Map .. Posts: (5) Views: (77) by CptCool
Extra Life - Save Kids Half-Life 2 Mods for Dummies
Forums
MODSonline.com Forums

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 4
Category: CoD 4 Level Design
CoD 4 mapping and level design.
Moderators: foyleman, rEdrUmMDK, Foxhound, Rasta, StrYdeR, The_Caretaker, batistablr, playername, Welshy
Latest Posts
Subscribed Posts
Search
Restricted Access Restricted Access
Page
Next Page
subscribe
Author Topic: [Tutorial]Open Doors with Use Key
paulb39
General Member
Since: Jan 2, 2006
Posts: 412
Last: Sep 22, 2008
[view latest posts]
Level 5
Category: CoD 4 Level Design
Posted: Thursday, Mar. 6, 2008 07:25 pm
first - I take NO RESPONISIBLITY for this tutorial

Was over at IW forums- thought modsonline should post it

the guy wrote it at his site and linked it from IW forums

http://itoeunited.net/forum/viewtopic.php?t=1235

Author: ITOE Swatter


_______________________________________________________

Description- How to make a door be able to be opened via the use key


*Note*

In his code he has code for adding sound to the door- he doesnt have it in his tut, but you can use this CODUO sound tut to add the code

http://www.modsonline.com/Tutorials-read-276.html

and more detailed 1

http://www.modsonline.com/Tutorials-read-197.html




paulb39
General Member
Since: Jan 2, 2006
Posts: 412
Last: Sep 22, 2008
[view latest posts]
Level 5
Category: CoD 4 Level Design
Posted: Friday, Mar. 7, 2008 09:12 pm
bump for admin
HarkoninVSC
General Member
Since: Jan 25, 2008
Posts: 294
Last: Apr 24, 2008
[view latest posts]
Level 5
Category: CoD 4 Level Design
Posted: Friday, Mar. 7, 2008 10:13 pm
Theres another here.

http://www.modsonline.com/Forums-top-75630.html
Rasta
Preferred Member
Since: Apr 10, 2004
Posts: 4252
Last: Oct 15, 2008
[view latest posts]
Level 9
Forum Moderator
Category: CoD 4 Level Design
Posted: Saturday, Mar. 8, 2008 04:22 am
I can't add this tutorials without permission from the author.
Go ahead... You Play I Mod : MODSonline.com
Support Modsonline by becoming a PREFERRED MEMBER today
Have you heard the MODSonair Podcast?: www.modsonair.com
We are game enthusiasts from the MODSonline.com community bringing you news, updates and opinions of the week's current events. Tune in every Friday for a new episode.
ITOE_Swatter
General Member
Since: Dec 18, 2007
Posts: 10
Last: Apr 8, 2008
[view latest posts]
Level 0
Category: CoD 4 Level Design
Posted: Sunday, Mar. 9, 2008 08:18 am
Rasta writes...
Quote:
I can't add this tutorials without permission from the author.


Tell you the truth I made the tutorial for one of our members who asked how to make a door open. I Have gotten a lot of e-mails about this tutorial i made. I never relized that people were having door problems in cod4.

Tell you the truth when I was making maps in cod2, I read the cod2 tutorial here on how to make a door and it stuck with me. When I started making maps for cod4 I just did it the same way as it is done in cod2. Even the script is the same ones i used for cod2.

If you think that this tutorial would be helpful over here Be my guest and you can do with it as you wish. As far as the pictures go they are linked to my site. I dont mind helping anyone out over here because i use modonline tutorals as much as the next person, besides if we didnt work together map making would be for a select few. Here is my tutorial that i posted on my site.


ITOE Swatter

edited on Mar. 9, 2008 08:21 am by ITOE_Swatter
ITOE_Swatter
General Member
Since: Dec 18, 2007
Posts: 10
Last: Apr 8, 2008
[view latest posts]
Level 0
Category: CoD 4 Level Design
Posted: Sunday, Mar. 9, 2008 08:23 am
Okay Here is my first attempt at a full blown tutorial on how to make a door. I will assume that you have a wall built and you have cut out and have fitted your doors in. In cod4 the doors are a bit of a pain to get to open. There are a lot of scripts out there and I will show you which ones worked for me.

After you make your brushes cut them and texture them. This can also be used for hidden doors.
1. add the origin brush to the side you want the door to swing. Think of it as a hinge.



2. Next select both the door and the origin and right click on the 2d and select script then brushmodel.



3. Hit the n key to bring up the entity. Make sure the script_brushmodel is highlighted and you have to type targetname in the key field and in the value field give it a name like door1. Hit enter.You will notice it will change to light blue lines on the 2d view after you unselect them.



4. The next step you have to do is use the trigger brush. I put this trigger brush at the door. The trigger can be anywhere in the map. Make sure you extend the trigger brush thru the door so you can open it on the other side.

5. In the 2d view right click select trigger use_touch. Hit n and bring up the entity and type targetname in the key field and in the value field give it a name like door_trigger1.
If you want to have a hint for your door add Key: Hintstring Value: Press [Use] to open door in the entity box. Thanks to colcorpse for pointing this out.





6. Save your map and that is all you have to do. Remember do not use any spaces use the underline key for spaces or don’t use anything for a space it’s up to you. Remember every trigger or brushmodel has to have a name.

Now we have to make a script to get a door to work. Open that gsc file that you made. I will use my gsc file I created.

1. Your gsc file should look like this. It is in the raw maps mp folder of cod4 if you don’t remember.

main() {
//maps\mp\mp_backlot_fx::main();
//maps\createart\mp_backlot_art::main();
maps\mp\_load::main();

//maps\mp\_compass::setupMiniMap("compass_map_mp_backlot");

setExpFog(500, 2200, 0.81, 0.75, 0.63, 0);
//VisionSetNaked( "mp_backlot" );
ambientPlay("ambient_backlot_ext");

game["allies"] = "marines";
game["axis"] = "opfor";
game["attackers"] = "axis";
game["defenders"] = "allies";
game["allies_soldiertype"] = "desert";
game["axis_soldiertype"] = "desert";

setdvar( "r_specularcolorscale", "1" );

setdvar("r_glowbloomintensity0","1");
setdvar("r_glowbloomintensity1","1");
setdvar("r_glowskybleedintensity0",".3");
setdvar("compassmaxrange","1800");

2. Now for the scripting.

}
door1_rotate()
{
door1 = getent("door1", "targetname");
trig = getent("door_trigger1", "targetname");
while (1)
{
trig waittill("trigger");
door1 rotateyaw(90, 1.5, 0.7, 0.7);
door1 waittill("rotatedone");
wait (3);
door1 rotateyaw(-90, 1.5, 0.7, 0.7);
door1 waittill("rotatedone");
}
}

3. Here is the script put in the final product. Remember // tells the computer to ignore anything after.


main() {
//maps\mp\mp_backlot_fx::main();
//maps\createart\mp_backlot_art::main();
maps\mp\_load::main();



thread door1_rotate(); //definition --> script contains the function scripted_door. You have to add one for every door.



//maps\mp\_compass::setupMiniMap("compass_map_mp_backlot");

setExpFog(500, 2200, 0.81, 0.75, 0.63, 0);
//VisionSetNaked( "mp_backlot" );
ambientPlay("ambient_backlot_ext");

game["allies"] = "marines";
game["axis"] = "opfor";
game["attackers"] = "axis";
game["defenders"] = "allies";
game["allies_soldiertype"] = "desert";
game["axis_soldiertype"] = "desert";

setdvar( "r_specularcolorscale", "1" );

setdvar("r_glowbloomintensity0","1");
setdvar("r_glowbloomintensity1","1");
setdvar("r_glowskybleedintensity0",".3");
setdvar("compassmaxrange","1800");


}
door1_rotate() //definition -->the function scripted_door starts
{
door1 = getent("door1", "targetname"); //definition --> the object (the door) with the targetname door that has the name door
trig = getent("door_trigger1", "targetname"); //definition --> the object (the trigger) with the targetname door_trigger1 that has the name trig
while (1) //definition --> the function should would grind run in one that it is again again usable after every process
{
trig waittill("trigger"); //definition --> after the activity of the triggers
//door playsound ("keys_jingle"); //definition --> play the sound "keys_jingle". I do not use this because of the .iwd file is not set up
//wait (2); //definition --> wait 2 seconds. I don’t want to wait till the door opens so I don’t use this either. Maybe after I will use it if I put sound of keys jingleing.
door1 rotateyaw(90, 1.5, 0.7, 0.7); //definition --> trick the door around 90 degrees, in 1.5 seconds, with an acceleration of 0.7 seconds and a deceleration of 0.7 seconds
door1 waittill("rotatedone");
//door playsound ("openloop"); //definition --> play the sound "openloop" no sound again so I do not use this
//door waittill ("rotatedone"); //definition --> wait on the end of the rotation
wait (3); //definition --> wait 3 seconds. how long before the door closes.
//door playsound ("door_close"); //definition --> play the sound "door_close" again no sound files.
door1 rotateyaw(-90, 1.5, 0.7, 0.7); //definition --> trick the door around -90 degrees, in 1.5 seconds, with an acceleration of 0.7 seconds and a deceleration of 0.7 seconds
door1 waittill("rotatedone"); //definition --> end of my script
}
}


Whew we got thru all of that mumbo jumbo! Here are some more scripts for different style doors.



1. Draglift Door

main()
{
thread diaglift_slider ();
}

diaglift_slider()
{
diaglift=getent("diaglift","targetname");
wait (5);
while(1)
{
//trig waittill ("trigger");
diaglift moveto ((104,-125,124),6,2,2);
diaglift waittill ("movedone");
wait (5);
//trig waittill ("trigger");
diaglift moveto ((-35,-125,204),6,2,2);
diaglift waittill ("movedone");
wait (5);
}
}



2. Draw bridge
main()
{
thread drawbridge_open ();
}

drawbridge_open()
{
drawbridge=getent("drawbridge","targetname");
trig=getent("lower_bridge","targetname");
while(1)
{
trig waittill ("trigger");
drawbridge rotateto( (-90,0,0),6);
drawbridge waittill ("rotatedone");
wait (3);
trig waittill ("trigger");
drawbridge rotateto( (0,0,0),6);
drawbridge waittill ("rotatedone");
}
}



3. Lift Pad
main()
{
thread liftpad_slider ();
}

liftpad_slider()
{
liftpad=getent("liftpad","targetname");
trig=getent("lift_trigger","targetname");
while(1)
{
trig waittill ("trigger");
//wait (4);
liftpad movez (106,5,0,0.6);
liftpad waittill ("movedone");
wait (4);
//trig waittill ("trigger");
liftpad movez(-106,4,0,0.6);
liftpad waittill ("movedone");

}
}


4. Roller Door

main()
{
thread door_slider ();
}

door_slider()
{
door=getent("door","targetname");
trig=getent("openthedoor","targetname");
while(1)
{
trig waittill ("trigger");
//wait (4);
door movez (94,5,0,0.6);
door waittill ("movedone");
wait (4);
//trig waittill ("trigger");
door movez(-94,4,0,0.6);
door waittill ("movedone");

}
}


5. Slide Door

main()
{
thread slidedoor_slider ();
}

slidedoor_slider()
{
slidedoor=getent("slidedoor","targetname");
trig=getent("slideopen","targetname");
while(1)
{
trig waittill ("trigger");
//wait (4);
slidedoor movey (-64,2,0.5,0.5);
slidedoor waittill ("movedone");
wait (4);
//trig waittill ("trigger");
slidedoor movey(64,2,0.5,0.5);
slidedoor waittill ("movedone");

}
}


6. Train door

main()
{
thread train_slider ();
}

train_slider()
{
train=getent("train","targetname");
trig=getent("start_train","targetname");
while(1)
{
trig waittill ("trigger");
//wait (4);
train movex (-464,8,0.3,0.3);
train waittill ("movedone");
wait (4);
//trig waittill ("trigger");
train movex(464,8,0.3,0.3);
train waittill ("movedone");

}
}


7. Train door2

main()
{

thread traindoor_traindoor ();
}

traindoor_traindoor()
{
door=getent("traindoor","targetname");
wait (20);
trig=getent("traindoor_trigger","targetname");
while(1)
{
trig waittill ("trigger");
door movey (2,1,0.5,0.5);
door waittill ("movedone");
wait (1);
door movex (-50,4,1,1);
door waittill ("movedone");
wait (4);
door movex (50,4,1,1);
door waittill ("movedone");
wait (1);
door movey (-2,1,0.5,0.5);
door waittill ("movedone");
}
}


8. Trap Door

main()
{
thread trapdoor_droptrapdoor ();
}

trapdoor_droptrapdoor()
{
trapdoor=getent("trapdoor","targetname");
trig=getent("droptrapdoor","targetname");
while(1)
{
trig waittill ("trigger");
trapdoor rotateto( (0,0,-90),0.3);
trapdoor waittill ("rotatedone");
wait (3);
trapdoor rotateto( (0,0,0),1.7);
trapdoor waittill ("rotatedone");
}
}

If you need any help just ask. Oh if you just want to tweek the setting just edit the gsc file and rebuild the fast file and retest it.

edited on Mar. 9, 2008 08:27 am by ITOE_Swatter
paulb39
General Member
Since: Jan 2, 2006
Posts: 412
Last: Sep 22, 2008
[view latest posts]
Level 5
Category: CoD 4 Level Design
Posted: Monday, Mar. 10, 2008 05:21 pm
Bump- this should go in tuts along with other 1
hivemind
General Member
Since: Mar 8, 2008
Posts: 13
Last: Apr 12, 2008
[view latest posts]
Level 1
Category: CoD 4 Level Design
Posted: Thursday, Mar. 27, 2008 05:35 pm
I have followed this tut to the letter, and it does work, but my door is invisible.
Any thoughts anyone ?
(I am using Vista, which runs the program just fine btw)
paulb39
General Member
Since: Jan 2, 2006
Posts: 412
Last: Sep 22, 2008
[view latest posts]
Level 5
Category: CoD 4 Level Design
Posted: Thursday, Mar. 27, 2008 05:48 pm
hivemind writes...
Quote:
I have followed this tut to the letter, and it does work, but my door is invisible.
Any thoughts anyone ?
(I am using Vista, which runs the program just fine btw)


Is the texture for the door a nodraw texture? or textured in caulk
hivemind
General Member
Since: Mar 8, 2008
Posts: 13
Last: Apr 12, 2008
[view latest posts]
Level 1
Category: CoD 4 Level Design
Posted: Friday, Mar. 28, 2008 12:12 pm
No, I used textures>wood>ch_door_18.
Restricted Access Restricted Access
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 4 : CoD 4 Level Design
All logos and trademarks and information in this site are property of MODSonline LLC © 2008.
The comments are property of their posters.
RSS news feeds for MODSonline can be found News.php.
Art of War Central
Partners
Battle for Europe COD2
Call of Duty Headquarters
The Firing Box
CODAddicts - Call of Duty News & Downloads
modbase.be
XoXide
Frag Universe
Ask About
Advertising
Friends
After Life Gaming
Canada Kicks Ass Clan
ModTheater
Ask About
Advertising
Link to Us
MODSonair
View in iTunes
Please help us to raise in the ranks of podcasting and subscribe to our itunes feed using the link above.
MODSonair Releases
MODSonair Episode 148
MODSonair Episode 147
MODSonair Episode 146
MODSonair Episode 145
MODSonair Episode 144
Next Show
The next MODSonair show will air LIVE on:
10/19/2008 11:00 EDT

Time remaining:
Copyright © 2008 MODSonline
Tresware Content Management System Copyright © 2008 Tresware
Website Designed and Hosted   Tresware