| WHC_Grassy |
General Member Since: Apr 20, 2005 Posts: 1426 Last: Aug 25, 2007 [view latest posts] |
|
|
|
Category: CoDUO Mapping Posted: Sunday, Feb. 19, 2006 01:48 am |
 |
move_gate() {
level.gatemoving = true;
level.gate1 rotateto ((0,-90,0),2); //the bottom left door opens
level.gate2 rotateto ((0,90,0),2); //the bottom right door opens
wait (10); //this is the time to get in lift at top
level.gate1 rotateto ((0,0,0),2); //the bottom left door closes
level.gate1 rotateto ((0,0,0),2); //the bottom right door closes
wait (4);
level.gate5 movez (608,8,0,0,6); //the lift moves up
//this dosnt make sense, you are telling the gates to rotate
//but then waiting on movedone?? the other gates below
//move rather than rotate, so which is it? rotate or move?
//I have remmed out the wait lines as you already have a
//wait 4 line above
//level.gate1 waittill ("movedone");
//level.gate2 waittill ("movedone");
//now you need a wait on the gate5 move
level.gate5 waittill ("movedone");
//ok gate5 has stopped, now open upper doors
level.gate3 movez (-59,2,0.5,0.5); //top door lower opens
level.gate4 movez (83,2,0.5,0.5); //top door upper opens
wait (10);
level.gate3 movez (59,2,0.5,0.5); //top door lower closes
level.gate3 movez (-83,2,0.5,0.5); //top door upper closes
wait (4);
level.gate5 movez (-608,8,0,0,6); //the lift goes back down
//now you need to wait on the gate5 move again
level.gate5 waittill ("movedone");
//not sure why you have these wait commands here again
//so I remmed them out
//level.gate1 waittill ("movedone");
//level.gate2 waittill ("movedone");
level.gate1 rotateto ((0,-90,0),2); //the bottom left door opens
level.gate2 rotateto ((0,90,0),2); //the bottom right door opens
wait (10);
level.gate1 rotateto ((0,0,0),2); //the bottom left door closes
level.gate1 rotateto ((0,0,0),2); //the bottom right door closes
//wait (3);
level.gatemoving=false;
}
Does that make sense? Double check your move - rotate commands as well.
Grassy |
 |
|
|
| Maddogg8472 |
General Member Since: Jun 18, 2004 Posts: 55 Last: Aug 22, 2008 [view latest posts] |
|
|
|
Category: CoDUO Mapping Posted: Monday, Feb. 20, 2006 12:12 pm |
 |
ok ive had to have two scripts for each lift but they work fine heres theye are for anyone else whos stuck...
main()
{
thread gate_init();
}
gate_init(){
level.gatemoving=false;
level.gate1 = getent("lift1DL","targetname");
level.gate2 = getent("lift1DR","targetname");
level.gate3 = getent("lift2bottom","targetname");
level.gate4 = getent("lift2top","targetname");
level.gate5 = getent("elevatormodel_2","targetname");
level.trig = getentarray ("elevatorswitchleft_2","targetname");
if (isdefined(level.trig))
for (i=0;i
level.trig thread gate_handler();
}
gate_handler() {
while (1) {
self waittill ("trigger");
if (!level.gatemoving)
thread move_gate();
wait(1);
}
}
move_gate() {
level.gatemoving = true;
level.gate5 movez (608,8,0,0,6); //the lift moves up
//now you need a wait on the gate5 move
level.gate5 waittill ("movedone");
level.gate3 movez (-59,2,0.5,0.5); //the top lower door opens
level.gate4 movez (83,2,0.5,0.5); //the top upper door opens
wait (6); //this is the time to get in lift at top
level.gate3 movez (59,2,0.5,0.5); //the door closes
level.gate4 movez (-83,2,0.5,0.5); //the door closes
wait (3);
level.gate5 movez (-608,8,0,0,6); //the lift moves down
//now you need a wait on the gate5 move
level.gate5 waittill ("movedone");
level.gate1 rotateto ((0,-90,0),2); //the bottom left door opens
level.gate2 rotateto ((0,90,0),2); //the bottom right door opens
wait (6);
level.gate1 rotateto ((0,00,0),2); //the bottom left door closes
level.gate2 rotateto ((0,00,0),2); //the bottom right door closes
//wait (3);
level.gatemoving=false;
}
Script 2:
main()
{
thread gate_init();
}
gate_init(){
level.gatemoving=false;
level.gate1 = getent("lift2DL","targetname");
level.gate2 = getent("lift2DR","targetname");
level.gate3 = getent("lift1bottom","targetname");
level.gate4 = getent("lift1top","targetname");
level.gate5 = getent("elevatormodel_2","targetname");
level.trig = getentarray ("elevatorswitchleft_1","targetname");
if (isdefined(level.trig))
for (i=0;i
level.trigthread gate_handler();
}
gate_handler() {
while (1) {
self waittill ("trigger");
if (!level.gatemoving)
thread move_gate();
wait(1);
}
}
move_gate() {
level.gatemoving = true;
level.gate1 rotateto ((0,-90,0),2); //the bottom left door opens
level.gate2 rotateto ((0,90,0),2); //the bottom right door opens
wait (6); //this is the time to get in lift at top
level.gate1 rotateto ((0,0,0),2); //the bottom left door closes
level.gate2 rotateto ((0,0,0),2); //the bottom right door closes
wait (3);
level.gate5 movez (608,8,0,0,6); //the lift moves up
//now you need a wait on the gate5 move
level.gate5 waittill ("movedone");
//ok gate5 has stopped, now open upper doors
level.gate3 movez (-59,2,0.5,0.5); //top door lower opens
level.gate4 movez (83,2,0.5,0.5); //top door upper opens
wait (6);
level.gate3 movez (59,2,0.5,0.5); //top door lower closes
level.gate4 movez (-83,2,0.5,0.5); //top door upper closes
wait (4);
level.gate5 movez (-608,8,0,0,6); //the lift goes back down
//now you need to wait on the gate5 move again
level.gate5 waittill ("movedone");
level.gate1 rotateto ((0,-90,0),2); //the bottom left door opens
level.gate2 rotateto ((0,90,0),2); //the bottom right door opens
wait (6);
level.gate1 rotateto ((0,0,0),2); //the bottom left door closes
level.gate2 rotateto ((0,0,0),2); //the bottom right door closes
//wait (3);
level.gatemoving=false;
} |
 |
|
|