Author |
Topic: How to open doors/windows help? |
swiggy99 |
General Member Since: Jun 11, 2006 Posts: 89 Last: Jul 21, 2007 [view latest posts] |
|
|
|
DadofAzz |
General Member Since: May 24, 2005 Posts: 1233 Last: Oct 17, 2009 [view latest posts] |
|
|
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 |
|
|
|
swiggy99 |
General Member Since: Jun 11, 2006 Posts: 89 Last: Jul 21, 2007 [view latest posts] |
|
|
|
-Ghost- |
General Member Since: Jun 21, 2006 Posts: 36 Last: Oct 31, 2007 [view latest posts] |
|
|
|
swiggy99 |
General Member Since: Jun 11, 2006 Posts: 89 Last: Jul 21, 2007 [view latest posts] |
|
|
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");
|
|
|
|
DadofAzz |
General Member Since: May 24, 2005 Posts: 1233 Last: Oct 17, 2009 [view latest posts] |
|
|
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 |
|
|
|
swiggy99 |
General Member Since: Jun 11, 2006 Posts: 89 Last: Jul 21, 2007 [view latest posts] |
|
|
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");
}
} |
|
|
|
{GITS}Cleaner |
General Member Since: May 23, 2006 Posts: 778 Last: Apr 23, 2011 [view latest posts] |
|
|
Category: CoD2 Scripting Posted: Tuesday, Jan. 2, 2007 04:01 pm |
|
Make the trigger bigger so It's inside the building as well
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 |
|
|
|
swiggy99 |
General Member Since: Jun 11, 2006 Posts: 89 Last: Jul 21, 2007 [view latest posts] |
|
|
|
The_Caretaker |
General Member Since: Jun 8, 2004 Posts: 11625 Last: Jul 7, 2009 [view latest posts] |
|
|
|