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

Members Online

»
0 Active | 104 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

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 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: How to open doors/windows help?
swiggy99
General Member
Since: Jun 11, 2006
Posts: 89
Last: Jul 21, 2007
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Monday, Jan. 1, 2007 02:39 pm
I would like to make a trap door, like the one off the Ramelle map, where you go up to it press a button and it opens, and plays a sound like a creak. Could anyone post a tutorial or pm me.
Share |
DadofAzz
General Member
Since: May 24, 2005
Posts: 1233
Last: Oct 17, 2009
[view latest posts]
Level 8
MODSCON
Category: CoD2 Scripting
Posted: Monday, Jan. 1, 2007 03:44 pm
Have a look around this swiggy, it may help you. The .map file is included so you can load that in the editor and peruse that.

http://www.modsonline.com/Downloads-full-3469.html

Also check out the "moving things" tutorial by stryder in the cod section. The scripting is much the same for cod2

doa
Share |
swiggy99
General Member
Since: Jun 11, 2006
Posts: 89
Last: Jul 21, 2007
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Tuesday, Jan. 2, 2007 11:52 am
Thanks mate, will download it now.
Thanks for the help.
Share |
-Ghost-
General Member
Since: Jun 21, 2006
Posts: 36
Last: Oct 31, 2007
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Tuesday, Jan. 2, 2007 11:59 am
thanks

Ghost
Share |
swiggy99
General Member
Since: Jun 11, 2006
Posts: 89
Last: Jul 21, 2007
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Tuesday, Jan. 2, 2007 01:01 pm
Right i downloaded what you told me and im trying to make a norm door. So i changed the normdoor.gsc. And i got an error.

Heres my script:
Code:
main()
{
thread door1 ();
}

door1()
{
door1=getent("door1","targetname");
trig=getent("open","targetname");
while(1)
{
trig waittill ("trigger");
door1 rotateto( (0,-90,0),2);
door1 waittill ("rotatedone");
wait (3);
//trig waittill ("trigger");
door1 rotateto( (0,0,0),2);
door1 waittill ("rotatedone");
} 
}


And heres my error:
Code:
undefined is not an object: (file 'maps/mp/mp_swiggy_doors.gsc', line 12)
trig waittill ("trigger");
Share |
DadofAzz
General Member
Since: May 24, 2005
Posts: 1233
Last: Oct 17, 2009
[view latest posts]
Level 8
MODSCON
Category: CoD2 Scripting
Posted: Tuesday, Jan. 2, 2007 01:48 pm
There are many posts on making working doors swiggy m8 and I dont have time to go over most of it all again, there are also more tuts, including a video one. There are also more than one way to make a working door, its horses for courses.

However briefly here goes, make your door, and texture it, create another small long thin brush, give it an origin texture, place it down the side of the door you require the door to hinge on. Select the door and origin together, right click and make them a script_model, press n with them selected and give them a targetname of door1.
Create a brush in front of the door (quite large about 24X cube) with that selected give it a trigger texture, still with it selected right click, and make it a trigger_use. Still with it selected press n and give it a targetname of open.

Press esc., compile, create the .gsc for the door script (just use the normdoor .gsc from that lil download.
Dont forget to add the line in yourmapname.gsc to call on that normdoor.gsc
Share |
swiggy99
General Member
Since: Jun 11, 2006
Posts: 89
Last: Jul 21, 2007
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Tuesday, Jan. 2, 2007 03:42 pm
Ok i got my door to work just fine. I can open it, go inside my building and close it. However becuase my trigger is outside, i can't open the door from the inside, lol.

Heres my script:
Code:
main()
{
thread door1_open ();
}

door1_open()
{
door1=getent("door1","targetname");
trig=getent("open","targetname");
while(1)
{
trig waittill ("trigger");
door1 rotateto( (0,-90,0),2);
trig waittill ("trigger"); 	
door1 rotateto( (0,0,0),2);
door1 waittill("rotatedone");

}
}
Share |
{GITS}Cleaner
General Member
Since: May 23, 2006
Posts: 778
Last: Apr 23, 2011
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Tuesday, Jan. 2, 2007 04:01 pm
Make the trigger bigger so It's inside the building as well[wink]

Try adding sounds to the door as well, one for opening, and a different one for closing.

Here's my door.cfg

Code:

main() 
{
maps\mp\_load::main();

thread door1_rotate();
thread door2_rotate();
}


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 playsound ("dooropen"); 
door1 waittill("rotatedone");
wait (3);
door1 rotateYaw(-90, 1.5, 0.7, 0.7);
door1 playsound ("doorclose");
door1 waittill("rotatedone"); 
}
}

door2_rotate()
{
door2 = getent("door2", "targetname");
trig = getent("door_trigger2", "targetname");
while (1)
{
trig waittill("trigger");
door2 rotateYaw(90, 1.5, 0.7, 0.7);
door2 playsound ("dooropen"); 
door2 waittill("rotatedone");
wait (3);
door2 rotateYaw(-90, 1.5, 0.7, 0.7);
door2 playsound ("doorclose");
door2 waittill("rotatedone"); 
}
}


edited on Jan. 2, 2007 11:07 am by The_Preacher
Share |
swiggy99
General Member
Since: Jun 11, 2006
Posts: 89
Last: Jul 21, 2007
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Tuesday, Jan. 2, 2007 07:01 pm
Hi Preacher. I tried the script you posted but it doesnt work. I made my trigger bigger so it fits on the outside and inside. But i think that because the trigger is going through my door its causing it not to work. My door is closed at first, I want it so I can open it, then the door stays open untill i press it again, which will close my door.
Any help will be great.
Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
Category: CoD2 Scripting
Posted: Tuesday, Jan. 2, 2007 07:45 pm
the trigger going through the door shouldn't cause the script to fail. If it worked with the trigger on one side, it should work with the trigger going through.

Just use your original script, get it to work before adding sounds and stuff like that.
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

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

»