|
|
fahrstuhl stoppen?? |
|
Hi,
ich hab für deinen arbeitskollegen Matrixpro ein script ausgearbeitet mit dem man 4 trigger hat.
der 1. trigger ist im eg und hat als targetname fs_trig1
im 1. stockwerk sind 2 trigger einer für rauf:fs_trig2 ;
und natürlich für runter fs_trig3
im 2 stockwerk ist nur ein trigger für runter: fs_trig4
der lift hat als targetname fs.
der lift fährt jedesmal 128 WEs rauf/runter
hier das script dazu:
main()
{
level.fs_moving = false;
level.fs_et1 = true;
level.fs_et2 = false;
level.fs_et3 = false;
thread fs1();
thread fs2();
thread fs3();
thread fs4();
}
fs1()
{
fs = getent ("fs","targetname");
fs_trig1 = getent ("fs_trig1","targetname");
while (1)
{
fs_trig1 waittill ("trigger");
if (level.fs_moving == true)
{
thread fs1();
return;
}
else if (level.fs_moving == false)
{
if (level.fs_et1 == true)
{
level.fs_moving = true;
fs movez (128, 3);
fs waittill ("movedone");
level.fs_et1 = false;
level.fs_et2 = true;
level.fs_et3 = false;
level.fs_moving = false;
thread fs1();
return;
}
else if (level.fs_et2 == true)
{
level.fs_moving = true;
fs movez (-128, 3);
fs waittill ("movedone");
level.fs_et3 = false;
level.fs_et1 = true;
level.fs_et2 = false;
level.fs_moving = false;
thread fs1();
return;
}
else if (level.fs_et3 == true)
{
level.fs_moving = true;
fs movez (-256, 6);
fs waittill ("movedone");
level.fs_et2 = false;
level.fs_et1 = true;
level.fs_et3 = false;
level.fs_moving = false;
thread fs1();
return;
}
}
}
}
fs2()
{
fs = getent ("fs","targetname");
fs_trig2 = getent ("fs_trig2","targetname");
while (1)
{
fs_trig2 waittill ("trigger");
if (level.fs_moving == true)
{
thread fs2();
return;
}
else if (level.fs_moving == false)
{
if (level.fs_et1 == true)
{
level.fs_moving = true;
fs movez (128, 3);
fs waittill ("movedone");
level.fs_et1 = false;
level.fs_et2 = true;
level.fs_et3 = false;
level.fs_moving = false;
thread fs2();
return;
}
else if (level.fs_et2 == true)
{
level.fs_moving = true;
fs movez (-128, 3);
fs waittill ("movedone");
level.fs_et3 = false;
level.fs_et1 = true;
level.fs_et2 = false;
level.fs_moving = false;
thread fs2();
return;
}
else if (level.fs_et3 == true)
{
level.fs_moving = true;
fs movez (-128, 3);
fs waittill ("movedone");
level.fs_et1 = false;
level.fs_et2 = true;
level.fs_et3 = false;
level.fs_moving = false;
thread fs2();
return;
}
}
}
}
fs3()
{
fs = getent ("fs","targetname");
fs_trig3 = getent ("fs_trig3","targetname");
while (1)
{
fs_trig3 waittill ("trigger");
if (level.fs_moving == true)
{
thread fs3();
return;
}
else if (level.fs_moving == false)
{
if (level.fs_et1 == true)
{
level.fs_moving = true;
fs movez (128, 3);
fs waittill ("movedone");
level.fs_et1 = false;
level.fs_et2 = true;
level.fs_et3 = false;
level.fs_moving = false;
thread fs3();
return;
}
else if (level.fs_et2 == true)
{
level.fs_moving = true;
fs movez (128, 3);
fs waittill ("movedone");
level.fs_et1 = false;
level.fs_et3 = true;
level.fs_et2 = false;
level.fs_moving = false;
thread fs3();
return;
}
else if (level.fs_et3 == true)
{
level.fs_moving = true;
fs movez (-128, 3);
fs waittill ("movedone");
level.fs_et1 = false;
level.fs_et2 = true;
level.fs_et3 = false;
level.fs_moving = false;
thread fs3();
return;
}
}
}
}
fs4()
{
fs = getent ("fs","targetname");
fs_trig4 = getent ("fs_trig4","targetname");
while (1)
{
fs_trig4 waittill ("trigger");
if (level.fs_moving == true)
{
thread fs4();
return;
}
else if (level.fs_moving == false)
{
if (level.fs_et1 == true)
{
level.fs_moving = true;
fs movez (256, 6);
fs waittill ("movedone");
level.fs_et2 = false;
level.fs_et3 = true;
level.fs_et3 = false;
level.fs_moving = false;
thread fs4();
return;
}
else if (level.fs_et2 == true)
{
level.fs_moving = true;
fs movez (128, 3);
fs waittill ("movedone");
level.fs_et1 = false;
level.fs_et3 = true;
level.fs_et2 = false;
level.fs_moving = false;
thread fs4();
return;
}
else if (level.fs_et3 == true)
{
level.fs_moving = true;
fs movez (-128, 3);
fs waittill ("movedone");
level.fs_et1 = false;
level.fs_et2 = true;
level.fs_et3 = false;
level.fs_moving = false;
thread fs4();
return;
}
}
}
}
ich nehme zwar jetzt mal an dass dein arbeitskollege dir das script auch gegeben hat, aber es gibt ja auch sicherlich noch andere die das hier interressieren wird...
MfG -=CCL=-DESTROYER
|
|
|
|
|
|
@CCL_DESTROYER
Also wenn man damit beliebig zwischen den Stockwerken rumfahren kann, dann ist das mal eine saubere Script Arbeit. Respekt!
Grüße
Private Grob
(Micka)
|
|
|
|
|
|
Wie schon gesagt, man hat 4 trigger:
unten um eine etage raufzufahren
2 in der mitte also einen um rauf oder runter und einen oben um eine etage runter.
wenn mann auf einer anderen etage, also der lift entweder unten oder oben ist, dann wird der lift auf die ebene gerufen wo sich der player befindet.
ich hab das script zwar nicht selbst getestet aber matrixpro hat mir bestätigt dass es funktioniert.
Dass man dierekt zb. vom EG auf den 2 ten stock fahren kann, würde auch funtzen, das würde jedoch probleme mit den triggern geben, da man beide ja dann sehr nah beieinander hätte...
bei meinem script kommt man zwar auch vom EG auf's 2. stockwerk, jedoch muss man auf jeder etage den trigger betätigen, also vom EG auf's erste und da dann auf's 2.
man kann eigentlich frei herumfahren, also man kann wählen ob man z.b. vom 1 stockwerk rauf oder runter will, und oben und unten bleibt ja eigentlich jeweils nur eine richtung^^.
ausserdem wird, wenn der lift bereits benutzt ist(er sich also bewegt), der befehl abgebrochen, so dass er nicht irgenwie durcheinandergebracht wird wenn ein anderer player auf einer anderen etage den trigger bestätigt.
MfG -=CCL=-DESTROYER
p.s. thx für das lob hehe
Dieser Beitrag wurde 2 mal editiert, zum letzten Mal von CCL_DESTROYER: 29.06.2006 16:08.
|
|
|
|
|
|
hab's auch mal kurz auf 4 etagen erweitert
main()
{
level.fs_moving = false;
level.fs_et1 = true;
level.fs_et2 = false;
level.fs_et3 = false;
level.fs_et4 = false;
thread fs1();
thread fs2();
thread fs3();
thread fs4();
thread fs5();
thread fs6();
}
fs1()
{
fs = getent ("fs","targetname");
fs_trig1 = getent ("fs_trig1","targetname");
while (1)
{
fs_trig1 waittill ("trigger");
if (level.fs_moving == true)
{
thread fs1();
return;
}
else if (level.fs_moving == false)
{
if (level.fs_et1 == true)
{
level.fs_moving = true;
fs movez (128, 3);
fs waittill ("movedone");
level.fs_et1 = false;
level.fs_et2 = true;
level.fs_et3 = false;
level.fs_et4 = false;
level.fs_moving = false;
thread fs1();
return;
}
else if (level.fs_et2 == true)
{
level.fs_moving = true;
fs movez (-128, 3);
fs waittill ("movedone");
level.fs_et3 = false;
level.fs_et1 = true;
level.fs_et2 = false;
level.fs_et4 = false;
level.fs_moving = false;
thread fs1();
return;
}
else if (level.fs_et3 == true)
{
level.fs_moving = true;
fs movez (-256, 6);
fs waittill ("movedone");
level.fs_et2 = false;
level.fs_et1 = true;
level.fs_et3 = false;
level.fs_et4 = false;
level.fs_moving = false;
thread fs1();
return;
}
else if (level.fs_et4 == true)
{
level.fs_moving = true;
fs movez (-384, 9);
fs waittill ("movedone");
level.fs_et2 = false;
level.fs_et1 = true;
level.fs_et3 = false;
level.fs_et3 = false;
level.fs_et4 = false;
level.fs_moving = false;
thread fs1();
return;
}
}
}
}
fs2()
{
fs = getent ("fs","targetname");
fs_trig2 = getent ("fs_trig2","targetname");
while (1)
{
fs_trig2 waittill ("trigger");
if (level.fs_moving == true)
{
thread fs2();
return;
}
else if (level.fs_moving == false)
{
if (level.fs_et1 == true)
{
level.fs_moving = true;
fs movez (128, 3);
fs waittill ("movedone");
level.fs_et1 = false;
level.fs_et2 = true;
level.fs_et3 = false;
level.fs_et4 = false;
level.fs_moving = false;
thread fs2();
return;
}
else if (level.fs_et2 == true)
{
level.fs_moving = true;
fs movez (-128, 3);
fs waittill ("movedone");
level.fs_et3 = false;
level.fs_et1 = true;
level.fs_et2 = false;
level.fs_et4 = false;
level.fs_moving = false;
thread fs2();
return;
}
else if (level.fs_et3 == true)
{
level.fs_moving = true;
fs movez (-128, 3);
fs waittill ("movedone");
level.fs_et1 = false;
level.fs_et2 = true;
level.fs_et3 = false;
level.fs_et4 = false;
level.fs_moving = false;
thread fs2();
return;
}
else if (level.fs_et4 == true)
{
level.fs_moving = true;
fs movez (-256, 6);
fs waittill ("movedone");
level.fs_et1 = false;
level.fs_et2 = true;
level.fs_et3 = false;
level.fs_et4 = false;
level.fs_moving = false;
thread fs2();
}
}
}
fs3()
{
fs = getent ("fs","targetname");
fs_trig3 = getent ("fs_trig3","targetname");
while (1)
{
fs_trig3 waittill ("trigger");
if (level.fs_moving == true)
{
thread fs3();
return;
}
else if (level.fs_moving == false)
{
if (level.fs_et1 == true)
{
level.fs_moving = true;
fs movez (128, 3);
fs waittill ("movedone");
level.fs_et1 = false;
level.fs_et2 = true;
level.fs_et3 = false;
level.fs_et4 = false;
level.fs_moving = false;
thread fs3();
return;
}
else if (level.fs_et2 == true)
{
level.fs_moving = true;
fs movez (128, 3);
fs waittill ("movedone");
level.fs_et1 = false;
level.fs_et3 = true;
level.fs_et2 = false;
level.fs_et4 = false;
level.fs_moving = false;
thread fs3();
return;
}
else if (level.fs_et3 == true)
{
level.fs_moving = true;
fs movez (-128, 3);
fs waittill ("movedone");
level.fs_et1 = false;
level.fs_et2 = true;
level.fs_et3 = false;
level.fs_et4 = false;
level.fs_moving = false;
thread fs3();
return;
}
else if (level.fs_et4 == true)
{
level.fs_moving = true;
fs movez (-256, 6);
fs waittill ("movedone");
level.fs_et1 = false;
level.fs_et2 = true;
level.fs_et3 = false;
level.fs_et4 = false;
level.fs_moving = false;
thread fs3();
return;
}
}
}
}
fs4()
{
fs = getent ("fs","targetname");
fs_trig4 = getent ("fs_trig4","targetname");
while (1)
{
fs_trig4 waittill ("trigger");
if (level.fs_moving == true)
{
thread fs4();
return;
}
else if (level.fs_moving == false)
{
if (level.fs_et1 == true)
{
level.fs_moving = true;
fs movez (256, 6);
fs waittill ("movedone");
level.fs_et2 = false;
level.fs_et3 = true;
level.fs_et3 = false;
level.fs_et4 = false;
level.fs_moving = false;
thread fs4();
return;
}
else if (level.fs_et2 == true)
{
level.fs_moving = true;
fs movez (128, 3);
fs waittill ("movedone");
level.fs_et1 = false;
level.fs_et3 = true;
level.fs_et2 = false;
level.fs_et4 = false;
level.fs_moving = false;
thread fs4();
return;
}
else if (level.fs_et3 == true)
{
level.fs_moving = true;
fs movez (-128, 3);
fs waittill ("movedone");
level.fs_et1 = false;
level.fs_et2 = true;
level.fs_et3 = false;
level.fs_et4 = false;
level.fs_moving = false;
thread fs4();
return;
}
else if (level.fs_et4 == true)
{
level.fs_moving = true;
fs movez (-128, 3);
fs waittill ("movedone");
level.fs_et1 = false;
level.fs_et2 = true;
level.fs_et3 = false;
level.fs_et4 = false;
level.fs_moving = false;
thread fs4();
return;
}
}
}
}
fs5()
{
fs = getent ("fs","targetname");
fs_trig5 = getent ("fs_trig5","targetname");
while (1)
{
fs_trig5 waittill ("trigger");
if (level.fs_moving == true)
{
thread fs5();
return;
}
else if (level.fs_moving == false)
{
if (level.fs_et1 == true)
{
level.fs_moving = true;
fs movez (256, 6);
fs waittill ("movedone");
level.fs_et2 = false;
level.fs_et3 = true;
level.fs_et1 = false;
level.fs_et4 = false;
level.fs_moving = false;
thread fs5();
return;
}
else if (level.fs_et2 == true)
{
level.fs_moving = true;
fs movez (128, 3);
fs waittill ("movedone");
level.fs_et1 = false;
level.fs_et3 = true;
level.fs_et2 = false;
level.fs_et4 = false;
level.fs_moving = false;
thread fs5();
return;
}
else if (level.fs_et3 == true)
{
level.fs_moving = true;
fs movez (128, 3);
fs waittill ("movedone");
level.fs_et1 = false;
level.fs_et4 = true;
level.fs_et3 = false;
level.fs_et2 = false;
level.fs_moving = false;
thread fs5();
return;
}
else if (level.fs_et4 == true)
{
level.fs_moving = true;
fs movez (-128, 3);
fs waittill ("movedone");
level.fs_et1 = false;
level.fs_et3 = true;
level.fs_et2 = false;
level.fs_et4 = false;
level.fs_moving = false;
thread fs5();
return;
}
}
}
}
fs6()
{
fs = getent ("fs","targetname");
fs_trig6 = getent ("fs_trig6","targetname");
while (1)
{
fs_trig6 waittill ("trigger");
if (level.fs_moving == true)
{
thread fs6();
return;
}
else if (level.fs_moving == false)
{
if (level.fs_et1 == true)
{
level.fs_moving = true;
fs movez (384, 9);
fs waittill ("movedone");
level.fs_et2 = false;
level.fs_et4 = true;
level.fs_et1 = false;
level.fs_et3 = false;
level.fs_moving = false;
thread fs6();
return;
}
else if (level.fs_et2 == true)
{
level.fs_moving = true;
fs movez (256, 6);
fs waittill ("movedone");
level.fs_et1 = false;
level.fs_et4 = true;
level.fs_et2 = false;
level.fs_et3 = false;
level.fs_moving = false;
thread fs6();
return;
}
else if (level.fs_et3 == true)
{
level.fs_moving = true;
fs movez (128, 3);
fs waittill ("movedone");
level.fs_et1 = false;
level.fs_et4 = true;
level.fs_et3 = false;
level.fs_et2 = false;
level.fs_moving = false;
thread fs6();
return;
}
else if (level.fs_et4 == true)
{
level.fs_moving = true;
fs movez (-128, 3);
fs waittill ("movedone");
level.fs_et1 = false;
level.fs_et3 = true;
level.fs_et2 = false;
level.fs_et4 = false;
level.fs_moving = false;
thread fs6();
return;
}
}
}
}
|
|
|
|
|
|
Kein problem.
ich helf euch gerne, ich lern ja auch was dazu hehe.
Wie heist es so schön eine hand wäscht die andere.
MfG -=CCL=-DESTROYER
|
|
|
|
|
|
|
|
Impressum ||Datenschutzerklärung
|