| Author |
Topic: connecting stuff in script? |
| Maddogg8472 |
General Member Since: Jun 18, 2004 Posts: 55 Last: Aug 22, 2008 [view latest posts] |
|
|
|
Category: CoDUO Mapping Posted: Saturday, Mar. 11, 2006 08:57 pm |
 |
ok im making a lift in my map with doors that will have to move with the elevator as it moves. anyone know how i can connect my lift doors to the lift brush_model in my lift gsc file please?
here my lift script can you show me where in the script i should put it also:
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_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;
sound1 = getent("lift2doorstop","targetname");
sound2 = getent("lift2doorsbottom","targetname");
sound3 = getent("elevatornoise2","targetname");
sound3 playsound ("liftnoise");
level.gate5 movez (608,11,1.5,1.5,8); //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
sound1 playsound ("metalgates");
level.gate3 movez (-59,4.5,0.5,0.5); //top door lower opens
level.gate4 movez (83,4.5,0.5,0.5); //top door upper opens
wait (5); //get into the lift
sound1 playsound ("metalgates");
level.gate3 movez (59,4.5,0.5,0.5); //top door lower closes
level.gate4 movez (-83,4.5,0.5,0.5); //top door upper closes
wait (5);
sound3 playsound ("liftnoise");
level.gate5 movez (-608,11,1.5,1.5,8); //the lift goes back down
//now you need to wait on the gate5 move again
level.gate5 waittill ("movedone");
//ok gate5 has stopped, now open upper doors
sound2 playsound ("gatesopen");
level.gate1 rotateto ((0,-90,0),4); //the bottom left door opens
level.gate2 rotateto ((0,90,0),4); //the bottom right door opens
wait (8); //this is the time to get in lift at bottom
sound2 playsound ("gatesopen");
level.gate1 rotateto ((0,0,0),4); //the bottom left door closes
level.gate2 rotateto ((0,0,0),4); //the bottom right door closes
//wait (2);
level.gatemoving=false;
}
thanks![[wave]](images/BBCode/smilies/wave.gif) |
 |
|
|
| WHC_Grassy |
General Member Since: Apr 20, 2005 Posts: 1426 Last: Aug 25, 2007 [view latest posts] |
|
|
|
|
| Maddogg8472 |
General Member Since: Jun 18, 2004 Posts: 55 Last: Aug 22, 2008 [view latest posts] |
|
|
|
Category: CoDUO Mapping Posted: Sunday, Mar. 12, 2006 09:45 pm |
 |
well i tried it but the doors dont seem to move with the lift but i may have made an error. Also i didnt say that i have 8 doors to move about, and four door to link to the lift. Heres my lift gsc for anyone who can help.
Also i have a hatch in the top of the lift that opens closes..is there a way i can link a portal to the lift as well?
main()
{
thread gate_init();
}
gate_init(){
level.gatemoving=false;
level.gate1b = getent("passliftdoor_a1","targetname");
level.gate2b = getent("passliftdoor_a2","targetname");
level.gate3b = getent("passliftdoor_b1","targetname");
level.gate4b = getent("passliftdoor_b2","targetname");
level.gate5b = getent("door_ainner2","targetname");
level.gate6b = getent("door_ainner1","targetname");
level.gate7b = getent("door_binner2","targetname");
level.gate8b = getent("door_binner1","targetname");
level.gate9b = getent("passliftdoor2_a1","targetname");
level.gate10b = getent("passliftdoor2_a2","targetname");
level.gate11b = getent("passliftdoor2_b1","targetname");
level.gate12b = getent("passliftdoor2_b2","targetname");
level.gate13b = getent("passlift","targetname");
level.trig = getentarray("passlift_sw1","targetname");
//level.gate14b = getent("lifthatch","targetname");
//level.gate14b linkto(level.passlift);
level.gate5b linkto(level.passlift);
level.gate6b linkto(level.passlift);
level.gate7b linkto(level.passlift);
level.gate8b linkto(level.passlift);
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.gate1b movex (24,2,0.5,0.5); //the outer door opens
level.gate3b movex (-24,2,0.5,0.5); //the outer door opens
level.gate2b movex (23,2,0.5,0.5); //the outer door opens
level.gate4b movex (-23,2,0.5,0.5); //the outer door opens
level.gate5b movex (22,2,0.5,0.5); //the inner door opens
level.gate7b movex (-22,2,0.5,0.5); //the inner door opens
level.gate6b movex (22,2,0.5,0.5); //the inner door opens
level.gate8b movex (-22,2,0.5,0.5); //the inner door opens
wait (12); //time to get in the lift
level.gate1b movex (-24,3,0.5,0.5); //the outer door closes
level.gate3b movex (24,3,0.5,0.5); //the outer door closes
level.gate2b movex (-23,3,0.5,0.5); //the outer door closes
level.gate4b movex (23,3,0.5,0.5); //the outer door closes
level.gate5b movex (-22,3,0.5,0.5); //the inner door closes
level.gate7b movex (22,3,0.5,0.5); //the inner door closes
level.gate6b movex (-22,3,0.5,0.5); //the inner door closes
level.gate8b movex (22,3,0.5,0.5); //the inner door closes
wait (4);
level.gate13b movez (-486,8,1.5,1.5,5); //the lift moves down
//now you need a wait on the gate13b move
level.gate13b waittill ("movedone");
//ok gate13b has stopped, now open lower doors
level.gate6b movex (-22,3,0.5,0.5); //the inner door opens
level.gate8b movex (22,3,0.5,0.5); //the inner door opens
level.gate5b movex (-22,3,0.5,0.5); //the inner door opens
level.gate7b movex (22,3,0.5,0.5); //the inner door opens
level.gate10b movex (-24,3,0.5,0.5); //the outer door opens
level.gate12b movex (24,3,0.5,0.5); //the outer door opens
level.gate9b movex (-23,3,0.5,0.5); //the outer door opens
level.gate11b movex (23,3,0.5,0.5); //the outer door opens
wait (12);
level.gate9b movex (23,3,0.5,0.5); //the outer door closes
level.gate11b movex (-23,3,0.5,0.5); //the outer door closes
level.gate10b movex (24,3,0.5,0.5); //the outer door closes
level.gate12b movex (-24,3,0.5,0.5); //the outer door closes
level.gate5b movex (22,3,0.5,0.5); //the inner door closes
level.gate7b movex (-22,3,0.5,0.5); //the inner door closes
level.gate6b movex (22,3,0.5,0.5); //the inner door closes
level.gate8b movex (-22,3,0.5,0.5); //the inner door closes
wait (4);
level.gate13b movez (486,8,1.5,1.5,5); //the lift goes back up
//now you need to wait on the gate13b move again
level.gate13b waittill ("movedone");
//wait (2);
level.gatemoving=false;
}
any helps always apreciated![[drink]](images/BBCode/smilies/drink.gif) |
 |
|
|
| WHC_Grassy |
General Member Since: Apr 20, 2005 Posts: 1426 Last: Aug 25, 2007 [view latest posts] |
|
|
|
Category: CoDUO Mapping Posted: Sunday, Mar. 12, 2006 10:22 pm |
 |
you are linking them to the wrong name.
Quote: level.gate13b = getent("passlift","targetname");
level.trig = getentarray("passlift_sw1","targetname");
//level.gate14b = getent("lifthatch","targetname");
//level.gate14b linkto(level.passlift);
level.gate5b linkto(level.passlift);
level.gate6b linkto(level.passlift);
level.gate7b linkto(level.passlift);
level.gate8b linkto(level.passlift);
If the actual elevator that you move is this part
level.gate13b = getent("passlift","targetname");
then your linkto lines should be,
//level.gate14b = getent("lifthatch","targetname");
//level.gate14b linkto(level.gate13b);
level.gate5b linkto(level.gate13b);
level.gate6b linkto(level.gate13b);
level.gate7b linkto(level.gate13b);
level.gate8b linkto(level.gate13b);
You have to refer to the alias you assign an entity
Grassy
edited on Mar. 12, 2006 05:26 pm by WHC_Grassy
Appologies as well, I see my other post was not correct and might have caused some confusion.
edited on Mar. 12, 2006 05:29 pm by WHC_Grassy |
 |
|
|
| Maddogg8472 |
General Member Since: Jun 18, 2004 Posts: 55 Last: Aug 22, 2008 [view latest posts] |
|
|
|
Category: CoDUO Mapping Posted: Sunday, Mar. 12, 2006 10:55 pm |
 |
well i was too polite to say anyting ![[lol]](images/BBCode/smilies/lol.gif) lol...
i spose i should have asked this before but after i link doors to the lift do i need to unlink them for the doors to be able to open?
as it stands the doors and hatch move with lift perfectly, but the doors dont open.
|
 |
|
|
| WHC_Grassy |
General Member Since: Apr 20, 2005 Posts: 1426 Last: Aug 25, 2007 [view latest posts] |
|
|
|
Category: CoDUO Mapping Posted: Sunday, Mar. 12, 2006 11:02 pm |
 |
Erm, ok........ ahh! have you used an origin brush for each script_model?
Each script_brushmodel should comprise the actual textured brush/s and a brush textured with origin, select them all and assign them as the brushmodel.
If your doors still wont move, then I suppose you will have to unlink them, move them, then link again before the elevator moves off...
To unlink use: FirstEnt unlink(OtherEnt);
Grassy
edited on Mar. 12, 2006 06:06 pm by WHC_Grassy |
 |
|
|
| Maddogg8472 |
General Member Since: Jun 18, 2004 Posts: 55 Last: Aug 22, 2008 [view latest posts] |
|
|
|
|