I hope this is enough information to help me....

Moderator: Core Staff
Code: Select all
while(1)
{
//Get trig ent and door ents here
trig waittill("trigger");
if(door1.position == 1)
//close the door here
if(door2.position == 1)
//close door
//etc
trig waittill("trigger");
if(door1.position == 0)
//open the door
//etc
}
Code: Select all
main()
{
thread jail1_1();
thread jail1_2();
thread jail2_1();
thread jail2_2();
}
jail1_1()
{
jail1_1door = getent ("jail1door","targetname");
trigger = getent ("jail1_1trig","targetname");
while(1)
{
trigger waittill ("trigger");
jail1_1door moveto ((-34,857,124), 1);
jail1_1door waittill ("movedone");
}
}
jail1_2()
{
jail1_2door = getent ("jail1door","targetname");
trigger = getent ("jail1_2trig","targetname");
while(1)
{
trigger waittill ("trigger");
jail1_2door moveto ((-96,857,124), 1);
jail1_2door waittill ("movedone");
}
}
jail2_1()
{
jail2_1door = getent ("jail2door","targetname");
trigger = getent ("jail2_1trig","targetname");
while(1)
{
trigger waittill ("trigger");
jail2_1door moveto ((158,857,124), 1);
jail2_1door waittill ("movedone");
}
}
jail2_2()
{
jail2_2door = getent ("jail2door","targetname");
trigger = getent ("jail2_2trig","targetname");
while(1)
{
trigger waittill ("trigger");
jail2_2door moveto ((96,857,124), 1);
jail2_2door waittill ("movedone");
}
}
moveTo literally does what it says, it move to a set coordinate. The reason it seems to move how you think Luke, eg -37 on X, is because the brushmodel doe not know where its own origin is so set its origin as 0,0,0. So the coordinate 1,1,1 may not be the same as the actual coordinates. you can counter this, but tbh, just use MoveX/Y/Z much simpler commands.Luke wrote:I don't think you understand what the moveto command is actually doing. The first 3 numbers are for moving the object from its origin along a specified axis. so jail1_1door moveto ((-34,857,124), 1); is going to make it move from its origin to -34 on the x axis, 857 on the y axis and 124 on the z axis at the same time.
First 3 numbers = x,y,z only put in the unit number on the axis you want it to move along, and put a 0 on the axis you dont want it to move along. I think you must of entered the maps coordinates of the place you wanted it to move, which isn't how this works.
If you're going to use drofders method for opening and closing all the doors(recommended) then you should use movex/y/z instead of moveto, otherwise it won't work very well.
Code: Select all
main()
{
jaildoor = getentarray("jaildoor","targetname");
for(i=0;i<jaildoor.size;i++)
{
temp = jaildoor.target;
jaildoor thread door_move(temp);
}
}
door_move(trig)
{
while(1)
{
trig waittill("trigger");
self moveZ(100, 2);
trig waittill("trigger");
self moveZ(-100, 2);
}
}
Users browsing this forum: No registered users and 1 guest