Author |
Topic: door is brush and does not move |
|
Category: CoD4 MP Mapping Posted: Thursday, Jan. 6, 2011 11:54 pm |
|
Hi again,
just making another map and since it is a fallout vault i`d like to have moving doors. Looked at tutorials here (and others around the web), but somehow i fail to make it move? All tutorials are telling about rotating here and there, and if tutorials about slide, then with ready made prefabs, not with a brush. I`d like to slide the brush up and down.
What i`ve done is:
- made a brush, textured it, gave it targetname door_slide, 2D>dyn>brushmodel
- made a trigger_use around it and named it door_trig
- selected both and pressed W to connect
then i have this as moving script:
Code:
main()
{
thread slidedoor_slider ();
}
slidedoor_slider()
{
slidedoor = getent( "door_slide", "targetname" );
trig = getent( "door_trig", "targetname" );
while(true)
{
trig waittill ("trigger");
//wait 4;
slidedoor movey ( 512.0,-4.0,80.0);
slidedoor waittill ("movedone");
wait 4;
//trig waittill ("trigger");
slidedoor movey( 512.0,-4.0,64.0);
slidedoor waittill ("movedone");
}
}
The file is in the zone_file and called in the mp_mapname.gsc
The best i could get after several hours of try and error was, that the door remained completely transparent. I mean, it`s there, but i can walk throu it, but i guess that is connected with the error that no physic preset is specified for the dynmodel.
Thanks for any help or ideas :) |
|
|
|
DeekCiti |
|
General Member Since: Mar 13, 2008 Posts: 1293 Last: Jul 9, 2016 [view latest posts] |
|
|
|
SQUISHY44 |
|
General Member Since: Apr 16, 2007 Posts: 213 Last: Jul 20, 2011 [view latest posts] |
|
|
|
|
|
|
Category: CoD4 MP Mapping Posted: Friday, Jan. 7, 2011 11:09 pm |
|
Um... is there something i could be missing? I mean, the door moves, but like 1mm per second and it never stops moving :D
... and it moves away from me, not up, but i guess i just change the movey to movez, right? The coords can stay the same, or do they change, when i change the movey to movez? I tried a bit to play around, but got not very smart out of it yet (my first moving door).
Thanks again for any ideas
edited on Jan. 7, 2011 06:22 pm by CHS
BTW, does it matter, that the door has to go throu some other brushes or should that not be an issue? I mean, if the door has to have free movement space? |
|
|
|
SQUISHY44 |
|
General Member Since: Apr 16, 2007 Posts: 213 Last: Jul 20, 2011 [view latest posts] |
|
|
|
TexasRebel |
General Member Since: May 1, 2006 Posts: 373 Last: Aug 20, 2013 [view latest posts] |
|
|
|
|
|
|
|
COLMAC |
|
General Member Since: Sep 15, 2006 Posts: 914 Last: Jan 27, 2012 [view latest posts] |
|
|
Category: CoD4 MP Mapping Posted: Saturday, Jan. 8, 2011 07:02 pm |
|
here 1 that i used in cod mw for double sliding doors
main()
{
thread door_start();
}
door_start()
{
doortrigger = getentarray("doortrig","targetname");
for(i=0;i
doortrigger thread door_think();
}
door_think()
{
stuff = getentarray(self.target,"targetname");
for(i=0;i
{
if(!isDefined(stuff.script_noteworthy))
continue;
if(stuff.script_noteworthy == "g_left_door")
self.left_door = stuff;
else if(stuff.script_noteworthy == "g_right_door")
self.right_door = stuff;
}
self.doorMoving = false;
while (1)
{
self waittill("trigger");
if(!self.doorMoving)
self thread door_move();
}
}
door_move()
{
self.doorMoving = true;
self.right_door movey(31,2,0.5,0.5);
self.left_door moveY(-31,2,0.5,0.5);
wait 3.5;
self.right_door movey(-31,2,0.5,0.5);
self.left_door moveY(31,2,0.5,0.5);
wait 3.5;
self.doorMoving = false;
}
remember that your brush is .script_noteworthy, named (g_left_door)&(g_right_door) you can use your own name
these are like star trek doors
hope this helps
also if you want malty door though out your map
you will need more scripts like thread door_1(); , thread door_2(); thread door_3(); and each door needs it own brush name
main()
{
thread door_1();
}
door_1()
{
doortrigger = getentarray("doortrig_1","targetname");
for(i=0;i
doortrigger thread door_1_think();
}
door_1_think()
{
stuff = getentarray(self.target,"targetname");
for(i=0;i
{
if(!isDefined(stuff.script_noteworthy))
continue;
if(stuff.script_noteworthy == "glass_left_door")
self.left_door = stuff;
else if(stuff.script_noteworthy == "glass_right_door")
self.right_door = stuff;
}
self.doorMoving = false;
while (1)
{
self waittill("trigger");
if(!self.doorMoving)
self thread door_1_move();
}
}
door_1_move()
{
self.doorMoving = true;
self.right_door movex(31,2,0.5,0.5);
self.left_door moveX(-31,2,0.5,0.5);
wait 2.5;
self.right_door movex(-31,2,0.5,0.5);
self.left_door moveX(31,2,0.5,0.5);
wait 2.5;
self.doorMoving = false;
}
|
|
|
|