Probleme mit moveTo();

Kiran Müller

Commander Keen
Hey, ich bins nochmal, ich habe mit einer meiner Maschienen probleme ;-)

Und habe ich ein Lager mit Automatischer Ein- und Auslagerung gebaut! Funktioniert soweit auch ;-)

Allerdings bevor er eine Kiste auslagert, fährt er aktuell an die Anfangsposition zurück, weil ich alles per x und z move gemacht habe!

Damit ich einfach mitten in den Regalen zur Auslagerung fahren kann, wollte ich das mit moveTo(); machen! Allerdings weiß ich noch net so genau, wie das läuft! Also ich habe noDraw-Cubes zu func_static gemacht, diese benannt und mit den Punkten genau an die Stelle gebracht, wo der Punkt vom func_mover landen soll! Das ganze sieht so aus:


PHP:
void alpha_machine1_move(float slot) {
    entity lift=$alpha_machine1_lift;
    entity raiser=$alpha_machine1_raiser;
    
    entity lift_slot=sys.getEntity("alpha_machine1_lift_slot_" +slot);
    entity raiser_slot=sys.getEntity("alpha_machine1_raiser_slot_" +slot);
    
    raiser.moveTo(raiser_slot);
    lift.moveTo(lift_slot);
    sys.waitFor(lift);
    sys.waitFor(raiser);
}

void alpha_machine1() {
    setup_alpha_machine1();
    
    while(1) {
    //alpha_machine1_store(1, 0);
    //alpha_machine1_send(1, 0);
    alpha_machine1_move(7);
    alpha_machine1_move(0);    
    alpha_machine1_move(15);
    alpha_machine1_move(2);
    alpha_machine1_move(16);
    alpha_machine1_move(7);
    alpha_machine1_move(3);
    alpha_machine1_move(14);
    }
}
Das Spiel startet auch soweit, aber das Teil bewegt sich jetzt keinen Zentimeter....
Weiß da einer, wo der Fehler ist ;-)

Und ja ;-) das ist im void main() drin ;-)

EDIT: Also bewegen tut er jetzt schon mal ;-) Allerdings bleibt der lift stehen, mit der Fehlermeldung Entity not found for moveTo()! Der existiert aber... Der raiser macht keine Mucken!

Allerdings ist mir jetzt aufgefallen, dass der aus dem Lift rausfährt ;-( Kann man den moveTo() auf eine Achse begrenzen?



So, ich habe jetzt mir die Arbeit gemacht dass ganze per Hand einzutippen mit move:
PHP:
// Wert start_slot wird in Lift gespeichert
void alpha_machine1_move(float target_slot) {
    float slot = target_slot;
    float x;
    float x2;
    float x3;
    float x_dir;
    
    float z;
    float z2;
    float z3;
    float z_dir;
    
    if($alpha_machine1_lift.getKey("start_slot") == "0") {
        if(slot == "1")     {x2=4*88;        x3=270;        z2=96*2;        z3=UP;}
        if(slot == "2")     {x2=3*88;        x3=270;        z2=96*2;        z3=UP;}
        if(slot == "3")     {x2=2*88;        x3=270;        z2=96*2;        z3=UP;}
        if(slot == "4")     {x2=1*88;        x3=270;        z2=96*2;        z3=UP;}
        if(slot == "5")     {x2=0;            x3=270;        z2=96*2;        z3=UP;}
        if(slot == "6")     {x2=4*88;        x3=270;        z2=96*1;        z3=UP;}
        if(slot == "7")     {x2=3*88;        x3=270;        z2=96*1;        z3=UP;}
        if(slot == "8")     {x2=2*88;        x3=270;        z2=96*1;        z3=UP;}
        if(slot == "9")     {x2=1*88;        x3=270;        z2=96*1;        z3=UP;}
        if(slot == "10")     {x2=0;            x3=270;        z2=96*1;        z3=UP;}
        if(slot == "11")     {x2=4*88;        x3=270;        z2=0;            z3=UP;}
        if(slot == "12")     {x2=3*88;        x3=270;        z2=0;            z3=UP;}
        if(slot == "13")     {x2=2*88;        x3=270;        z2=0;            z3=UP;}
        if(slot == "14")     {x2=1*88;        x3=270;        z2=0;            z3=UP;}
        if(slot == "15")     {x2=0;            x3=270;        z2=0;            z3=UP;}
        if(slot == "16")     {x2=(4*88)+32;    x3=270;        z2=96*2;        z3=UP;}
        x        =    x2+128;
        x_dir    =    x3;
        z        =    z2+72;
        z_dir    =    z3;
    }
    if($alpha_machine1_lift.getKey("start_slot") == "1") {
        if(slot == "0")     {x2=(4*88)+128;    x3=90;        z2=(96*2)+72;    z3=DOWN;}
        if(slot == "2")     {x2=1*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "3")     {x2=2*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "4")     {x2=3*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "5")     {x2=4*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "6")     {x2=0;            x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "7")     {x2=1*88;        x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "8")     {x2=2*88;        x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "9")     {x2=3*88;        x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "10")     {x2=4*88;        x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "11")     {x2=0;            x3=90;        z2=96*2;        z3=DOWN;}
        if(slot == "12")     {x2=1*88;        x3=90;        z2=96*2;        z3=DOWN;}
        if(slot == "13")     {x2=2*88;        x3=90;        z2=96*2;        z3=DOWN;}
        if(slot == "14")     {x2=3*88;        x3=90;        z2=96*2;        z3=DOWN;}
        if(slot == "15")     {x2=4*88;        x3=90;        z2=96*2;        z3=DOWN;}
        if(slot == "16")     {x2=32;            x3=270;        z2=0;            z3=DOWN;}
        x        =    x2;
        x_dir    =    x3;
        z        =    z2;
        z_dir    =    z3;
    }
    if($alpha_machine1_lift.getKey("start_slot") == "2") {
        if(slot == "0")     {x2=(3*88)+128;    x3=90;        z2=(96*2)+72;    z3=DOWN;}
        if(slot == "1")     {x2=1*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "3")     {x2=1*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "4")     {x2=2*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "5")     {x2=3*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "6")     {x2=1*88;        x3=270;        z2=96*1;        z3=DOWN;}
        if(slot == "7")     {x2=0;            x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "8")     {x2=1*88;        x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "9")     {x2=2*88;        x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "10")     {x2=3*88;        x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "11")     {x2=1*88;        x3=270;        z2=96*2;        z3=DOWN;}
        if(slot == "12")     {x2=0;            x3=90;        z2=96*2;        z3=DOWN;}
        if(slot == "13")     {x2=1*88;        x3=90;        z2=96*2;        z3=DOWN;}
        if(slot == "14")     {x2=2*88;        x3=90;        z2=96*2;        z3=DOWN;}
        if(slot == "15")     {x2=3*88;        x3=90;        z2=96*2;        z3=DOWN;}
        if(slot == "16")     {x2=(1*88)+32;    x3=270;        z2=0;            z3=DOWN;}
        x        =    x2;
        x_dir    =    x3;
        z        =    z2;
        z_dir    =    z3;
    }
    if($alpha_machine1_lift.getKey("start_slot") == "3") {
        if(slot == "0")     {x2=(2*88)+128;    x3=90;        z2=(96*2)+72;    z3=DOWN;}
        if(slot == "1")     {x2=2*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "2")     {x2=1*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "4")     {x2=1*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "5")     {x2=2*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "6")     {x2=2*88;        x3=270;        z2=96*1;        z3=DOWN;}
        if(slot == "7")     {x2=1*88;        x3=270;        z2=96*1;        z3=DOWN;}
        if(slot == "8")     {x2=0;            x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "9")     {x2=1*88;        x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "10")     {x2=2*88;        x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "11")     {x2=2*88;        x3=270;        z2=96*2;        z3=DOWN;}
        if(slot == "12")     {x2=1*88;        x3=270;        z2=96*2;        z3=DOWN;}
        if(slot == "13")     {x2=0;            x3=90;        z2=96*2;        z3=DOWN;}
        if(slot == "14")     {x2=1*88;        x3=90;        z2=96*2;        z3=DOWN;}
        if(slot == "15")     {x2=2*88;        x3=90;        z2=96*2;        z3=DOWN;}
        if(slot == "16")     {x2=(2*88)+32;    x3=270;        z2=0;            z3=DOWN;}
        x        =    x2;
        x_dir    =    x3;
        z        =    z2;
        z_dir    =    z3;
    }
    if($alpha_machine1_lift.getKey("start_slot") == "4") {
        if(slot == "0")     {x2=(1*88)+128;    x3=90;        z2=(96*2)+72;    z3=DOWN;}
        if(slot == "1")     {x2=3*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "2")     {x2=2*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "3")     {x2=1*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "5")     {x2=1*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "6")     {x2=3*88;        x3=270;        z2=96*1;        z3=DOWN;}
        if(slot == "7")     {x2=2*88;        x3=270;        z2=96*1;        z3=DOWN;}
        if(slot == "8")     {x2=1*88;        x3=270;        z2=96*1;        z3=DOWN;}
        if(slot == "9")     {x2=0;            x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "10")     {x2=1*88;        x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "11")     {x2=3*88;        x3=270;        z2=96*2;        z3=DOWN;}
        if(slot == "12")     {x2=2*88;        x3=270;        z2=96*2;        z3=DOWN;}
        if(slot == "13")     {x2=1*88;        x3=270;        z2=96*2;        z3=DOWN;}
        if(slot == "14")     {x2=0;            x3=90;        z2=96*2;        z3=DOWN;}
        if(slot == "15")     {x2=1*88;        x3=90;        z2=96*2;        z3=DOWN;}
        if(slot == "16")     {x2=(3*88)+32;    x3=270;        z2=0;            z3=DOWN;}
        x        =    x2;
        x_dir    =    x3;
        z        =    z2;
        z_dir    =    z3;
    }
    if($alpha_machine1_lift.getKey("start_slot") == "5") {
        if(slot == "0")     {x2=128;        x3=90;        z2=(96*2)+72;    z3=DOWN;}
        if(slot == "1")     {x2=4*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "2")     {x2=30;            x3=270;        z2=0;            z3=DOWN;}
        if(slot == "3")     {x2=2*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "4")     {x2=1*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "6")     {x2=4*88;        x3=270;        z2=96*1;        z3=DOWN;}
        if(slot == "7")     {x2=3*88;        x3=270;        z2=96*1;        z3=DOWN;}
        if(slot == "8")     {x2=2*88;        x3=270;        z2=96*1;        z3=DOWN;}
        if(slot == "9")     {x2=1*88;        x3=270;        z2=96*1;        z3=DOWN;}
        if(slot == "10")     {x2=0;            x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "11")     {x2=4*88;        x3=270;        z2=96*2;        z3=DOWN;}
        if(slot == "12")     {x2=3*88;        x3=270;        z2=96*2;        z3=DOWN;}
        if(slot == "13")     {x2=2*88;        x3=270;        z2=96*2;        z3=DOWN;}
        if(slot == "14")     {x2=1*88;        x3=270;        z2=96*2;        z3=DOWN;}
        if(slot == "15")     {x2=0;            x3=90;        z2=96*2;        z3=DOWN;}
        if(slot == "16")     {x2=(4*88)+32;    x3=270;        z2=0;            z3=DOWN;}
        x        =    x2;
        x_dir    =    x3;
        z        =    z2;
        z_dir    =    z3;
    }
    if($alpha_machine1_lift.getKey("start_slot") == "6") {
        if(slot == "0")     {x2=(4*88)+128;    x3=90;        z2=(96x1)+72;    z3=DOWN;}
        if(slot == "1")     {x2=0;            x3=90;        z2=96*1;        z3=UP;}
        if(slot == "2")     {x2=1*88;        x3=90;        z2=96*1;        z3=UP;}
        if(slot == "3")     {x2=2*88;        x3=90;        z2=96*1;        z3=UP;}
        if(slot == "4")     {x2=3*88;        x3=90;        z2=96*1;        z3=UP;}
        if(slot == "5")     {x2=4*88;        x3=90;        z2=96*1;        z3=UP;}
        if(slot == "7")     {x2=1*88;        x3=90;        z2=0;            z3=UP;}
        if(slot == "8")     {x2=2*88;        x3=90;        z2=0;            z3=UP;}
        if(slot == "9")     {x2=3*88;        x3=90;        z2=0;            z3=UP;}
        if(slot == "10")     {x2=4*88;        x3=90;        z2=0;            z3=UP;}
        if(slot == "11")     {x2=0;            x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "12")     {x2=1*88;        x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "13")     {x2=2*88;        x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "14")     {x2=3*88;        x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "15")     {x2=4*88;        x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "16")     {x2=32;            x3=270;        z2=96*1;        z3=UP;}
        x        =    x2;
        x_dir    =    x3;
        z        =    z2;
        z_dir    =    z3;
    }
    if($alpha_machine1_lift.getKey("start_slot") == "7") {
        if(slot == "0")     {x2=(3*88)+128;    x3=90;        z2=(96*2)+72;    z3=DOWN;}
        if(slot == "1")     {x2=1*88;        x3=270;        z2=96*1;        z3=UP;}
        if(slot == "2")     {x2=0;            x3=90;        z2=96*1;        z3=UP;}
        if(slot == "3")     {x2=1*88;        x3=90;        z2=96*1;        z3=UP;}
        if(slot == "4")     {x2=2*88;        x3=90;        z2=96*1;        z3=UP;}
        if(slot == "5")     {x2=3*88;        x3=90;        z2=96*1;        z3=UP;}
        if(slot == "6")     {x2=1*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "8")     {x2=1*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "9")     {x2=2*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "10")     {x2=3*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "11")     {x2=1*88;        x3=270;        z2=96*1;        z3=DOWN;}
        if(slot == "12")     {x2=0;            x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "13")     {x2=1*88;        x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "14")     {x2=2*88;        x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "15")     {x2=3*88;        x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "16")     {x2=(1*88)+32;    x3=270;        z2=96*1;        z3=UP;}
        x        =    x2;
        x_dir    =    x3;
        z        =    z2;
        z_dir    =    z3;
    }
    if($alpha_machine1_lift.getKey("start_slot") == "8") {
        if(slot == "0")     {x2=(2*88)+128;    x3=90;        z2=(96x1)+72;    z3=DOWN;}
        if(slot == "1")     {x2=2*88;        x3=270;        z2=96*1;        z3=UP;}
        if(slot == "2")     {x2=1*88;        x3=270;        z2=96*1;        z3=UP;}
        if(slot == "3")     {x2=0;            x3=90;        z2=96x1            z3=UP;}
        if(slot == "4")     {x2=1*88;        x3=90;        z2=96*1;        z3=UP;}
        if(slot == "5")     {x2=2*88;        x3=90;        z2=96*1;        z3=UP;}
        if(slot == "6")     {x2=2*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "7")     {x2=1*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "9")     {x2=1*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "10")     {x2=2*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "11")     {x2=2*88;        x3=270;        z2=96*1;        z3=DOWN;}
        if(slot == "12")     {x2=1*88;        x3=270;        z2=96*1;        z3=DOWN;}
        if(slot == "13")     {x2=0;            x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "14")     {x2=1*88;        x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "15")     {x2=2*88;        x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "16")     {x2=(2*88)+32;    x3=270;        z2=96*1;        z3=UP;}
        x        =    x2;
        x_dir    =    x3;
        z        =    z2;
        z_dir    =    z3;
    }
    if($alpha_machine1_lift.getKey("start_slot") == "9") {
        if(slot == "0")     {x2=(1*88)+128;    x3=90;        z2=(96x1)+72;    z3=DOWN;}
        if(slot == "1")     {x2=3*88;        x3=270;        z2=96*1;        z3=UP;}
        if(slot == "2")     {x2=2*88;        x3=270;        z2=96*1;        z3=UP;}
        if(slot == "3")     {x2=1*88;        x3=270;        z2=96*1;        z3=UP;}
        if(slot == "4")     {x2=0;            x3=90;        z2=96*1;        z3=UP;}
        if(slot == "5")     {x2=1*88;        x3=90;        z2=96*1;        z3=UP;}
        if(slot == "6")     {x2=3*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "7")     {x2=2*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "8")     {x2=1*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "10")     {x2=1*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "11")     {x2=3*88;        x3=270;        z2=96*1;        z3=DOWN;}
        if(slot == "12")     {x2=2*88;        x3=270;        z2=96*1;        z3=DOWN;}
        if(slot == "13")     {x2=1*88;        x3=270;        z2=96*1;        z3=DOWN;}
        if(slot == "14")     {x2=0;            x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "15")     {x2=1*88;        x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "16")     {x2=(3*88)+32;    x3=270;        z2=96*1;        z3=UP;}
        x        =    x2;
        x_dir    =    x3;
        z        =    z2;
        z_dir    =    z3;
    }
    if($alpha_machine1_lift.getKey("start_slot") == "10") {
        if(slot == "0")     {x2=128;        x3=90;        z2=(96x1)+72;    z3=DOWN;}
        if(slot == "1")     {x2=4*88;        x3=270;        z2=96*1;        z3=UP;}
        if(slot == "2")     {x2=30;            x3=270;        z2=96*1;        z3=UP;}

        if(slot == "3")     {x2=2*88;        x3=270;        z2=96*1;        z3=UP;}
        if(slot == "4")     {x2=1*88;        x3=270;        z2=96*1;        z3=UP;}
        if(slot == "5")     {x2=0;            x3=90;        z2=96*1;        z3=UP;}
        if(slot == "6")     {x2=4*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "7")     {x2=3*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "8")     {x2=2*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "9")     {x2=1*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "11")     {x2=4*88;        x3=270;        z2=96*1;        z3=DOWN;}
        if(slot == "12")     {x2=3*88;        x3=270;        z2=96*1;        z3=DOWN;}
        if(slot == "13")     {x2=2*88;        x3=270;        z2=96*1;        z3=DOWN;}
        if(slot == "14")     {x2=1*88;        x3=270;        z2=96*1;        z3=DOWN;}
        if(slot == "15")     {x2=0;            x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "16")     {x2=(4*88)+32;    x3=270;        z2=96*1;        z3=UP;}
        x        =    x2;
        x_dir    =    x3;
        z        =    z2;
        z_dir    =    z3;
    }
    if($alpha_machine1_lift.getKey("start_slot") == "11") {
        if(slot == "0")     {x2=(4*88)+128;    x3=90;        z2=72;            z3=DOWN;}
        if(slot == "1")     {x2=0;            x3=90;        z2=96*2;        z3=UP;}
        if(slot == "2")     {x2=1*88;        x3=90;        z2=96*2;        z3=UP;}
        if(slot == "3")     {x2=2*88;        x3=90;        z2=96*2;        z3=UP;}
        if(slot == "4")     {x2=3*88;        x3=90;        z2=96*2;        z3=UP;}
        if(slot == "5")     {x2=4*88;        x3=90;        z2=96*2;        z3=UP;}
        if(slot == "6")     {x2=0;            x3=90;        z2=96*1;        z3=UP;}
        if(slot == "7")     {x2=1*88;        x3=90;        z2=96*1;        z3=UP;}
        if(slot == "8")     {x2=2*88;        x3=90;        z2=96*1;        z3=UP;}
        if(slot == "9")     {x2=3*88;        x3=90;        z2=96*1;        z3=UP;}
        if(slot == "10")     {x2=4*88;        x3=90;        z2=96*1;        z3=UP;}
        if(slot == "12")     {x2=1*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "13")     {x2=2*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "14")     {x2=3*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "15")     {x2=4*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "16")     {x2=32;            x3=270;        z2=0;            z3=UP;}
        x        =    x2;
        x_dir    =    x3;
        z        =    z2;
        z_dir    =    z3;
    }
    if($alpha_machine1_lift.getKey("start_slot") == "12") {
        if(slot == "0")     {x2=(3*88)+128;    x3=90;        z2=72;            z3=DOWN;}
        if(slot == "1")     {x2=1*88;        x3=270;        z2=96*2;        z3=UP;}
        if(slot == "2")     {x2=0;            x3=90;        z2=96*2;        z3=UP;}
        if(slot == "3")     {x2=1*88;        x3=90;        z2=96*2;        z3=UP;}
        if(slot == "4")     {x2=2*88;        x3=90;        z2=96*2;        z3=UP;}
        if(slot == "5")     {x2=3*88;        x3=90;        z2=96*2;        z3=UP;}
        if(slot == "6")     {x2=1*88;        x3=270;        z2=96*1;        z3=UP;}
        if(slot == "7")     {x2=0;            x3=90;        z2=96*1;        z3=UP;}
        if(slot == "8")     {x2=1*88;        x3=90;        z2=96*1;        z3=UP;}
        if(slot == "9")     {x2=2*88;        x3=90;        z2=96*1;        z3=UP;}
        if(slot == "10")     {x2=3*88;        x3=90;        z2=96*1;        z3=UP;}
        if(slot == "11")     {x2=1*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "13")     {x2=1*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "14")     {x2=2*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "15")     {x2=3*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "16")     {x2=(1*88)+32;    x3=270;        z2=0;            z3=UP;}
        x        =    x2;
        x_dir    =    x3;
        z        =    z2;
        z_dir    =    z3;
    }
    if($alpha_machine1_lift.getKey("start_slot") == "13") {
        if(slot == "0")     {x2=(2*88)+128;    x3=90;        z2=72;            z3=DOWN;}
        if(slot == "1")     {x2=2*88;        x3=270;        z2=96*2;        z3=UP;}
        if(slot == "2")     {x2=1*88;        x3=270;        z2=96*2;        z3=UP;}
        if(slot == "3")     {x2=0;            x3=90;        z2=96*2;        z3=UP;}
        if(slot == "4")     {x2=1*88;        x3=90;        z2=96*2;        z3=UP;}
        if(slot == "5")     {x2=2*88;        x3=90;        z2=96*2;        z3=UP;}
        if(slot == "6")     {x2=2*88;        x3=270;        z2=96*1;        z3=UP;}
        if(slot == "7")     {x2=1*88;        x3=270;        z2=96*1;        z3=UP;}
        if(slot == "8")     {x2=0;            x3=90;        z2=96*1;        z3=UP;}
        if(slot == "9")     {x2=1*88;        x3=90;        z2=96*1;        z3=UP;}
        if(slot == "10")     {x2=2*88;        x3=90;        z2=96*1;        z3=UP;}
        if(slot == "11")     {x2=2*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "12")     {x2=1*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "14")     {x2=1*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "15")     {x2=2*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "16")     {x2=(2*88)+32;    x3=270;        z2=0;            z3=UP;}
        x        =    x2;
        x_dir    =    x3;
        z        =    z2;
        z_dir    =    z3;
    }
    if($alpha_machine1_lift.getKey("start_slot") == "14") {
        if(slot == "0")     {x2=(1*88)+128;    x3=90;        z2=72;            z3=DOWN;}
        if(slot == "1")     {x2=3*88;        x3=270;        z2=96*2;        z3=UP;}
        if(slot == "2")     {x2=2*88;        x3=270;        z2=96*2;        z3=UP;}
        if(slot == "3")     {x2=1*88;        x3=270;        z2=96*2;        z3=UP;}
        if(slot == "4")     {x2=0;            x3=90;        z2=96*2;        z3=UP;}
        if(slot == "5")     {x2=1*88;        x3=90;        z2=96*2;        z3=UP;}
        if(slot == "6")     {x2=3*88;        x3=270;        z2=96*1;        z3=UP;}
        if(slot == "7")     {x2=2*88;        x3=270;        z2=96*1;        z3=UP;}
        if(slot == "8")     {x2=1*88;        x3=270;        z2=96*1;        z3=UP;}
        if(slot == "9")     {x2=0;            x3=90;        z2=96*1;        z3=UP;}
        if(slot == "10")     {x2=1*88;        x3=90;        z2=96*1;        z3=UP;}
        if(slot == "11")     {x2=3*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "12")     {x2=2*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "13")     {x2=1*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "15")     {x2=1*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "16")     {x2=(3*88)+32;    x3=270;        z2=0;            z3=UP;}
        x        =    x2;
        x_dir    =    x3;
        z        =    z2;
        z_dir    =    z3;
    }
    if($alpha_machine1_lift.getKey("start_slot") == "15") {
        if(slot == "0")     {x2=128;        x3=90;        z2=72;            z3=DOWN;}
        if(slot == "1")     {x2=4*88;        x3=270;        z2=96*2;        z3=UP;}
        if(slot == "2")     {x2=30;            x3=270;        z2=96*2;        z3=UP;}
        if(slot == "3")     {x2=2*88;        x3=270;        z2=96*2;        z3=UP;}
        if(slot == "4")     {x2=1*88;        x3=270;        z2=96*2;        z3=UP;}
        if(slot == "5")     {x2=0;            x3=90;        z2=96*2;        z3=UP;}
        if(slot == "6")     {x2=4*88;        x3=270;        z2=96*1;        z3=UP;}
        if(slot == "7")     {x2=3*88;        x3=270;        z2=96*1;        z3=UP;}
        if(slot == "8")     {x2=2*88;        x3=270;        z2=96*1;        z3=UP;}
        if(slot == "9")     {x2=1*88;        x3=270;        z2=96*1;        z3=UP;}
        if(slot == "10")     {x2=0;            x3=90;        z2=96*1;        z3=UP;}
        if(slot == "11")     {x2=4*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "12")     {x2=3*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "13")     {x2=2*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "14")     {x2=1*88;        x3=270;        z2=0;            z3=DOWN;}
        if(slot == "16")     {x2=(4*88)+32;    x3=270;        z2=0;            z3=UP;}
        x        =    x2;
        x_dir    =    x3;
        z        =    z2;
        z_dir    =    z3;
    }
    if($alpha_machine1_lift.getKey("start_slot") == "16") {
        if(slot == "0")     {x2=(4*88)+128;    x3=90;        z2=(96*2)+72;    z3=DOWN;}
        if(slot == "1")     {x2=0;            x3=270;        z2=0;            z3=DOWN;}
        if(slot == "2")     {x2=1*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "3")     {x2=2*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "4")     {x2=3*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "5")     {x2=4*88;        x3=90;        z2=0;            z3=DOWN;}
        if(slot == "6")     {x2=0;            x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "7")     {x2=1*88;        x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "8")     {x2=2*88;        x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "9")     {x2=3*88;        x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "10")     {x2=4*88;        x3=90;        z2=96*1;        z3=DOWN;}
        if(slot == "11")     {x2=0;            x3=90;        z2=96*2;        z3=DOWN;}
        if(slot == "12")     {x2=1*88;        x3=90;        z2=96*2;        z3=DOWN;}
        if(slot == "13")     {x2=2*88;        x3=90;        z2=96*2;        z3=DOWN;}
        if(slot == "14")     {x2=3*88;        x3=90;        z2=96*2;        z3=DOWN;}
        if(slot == "15")     {x2=4*88;        x3=90;        z2=96*2;        z3=DOWN;}
        x        =    x2+32;
        x_dir    =    x3;
        z        =    z2;
        z_dir    =    z3;
    }
    
    $alpha_machine1_left.setKey("start_slot", slot);
    
    $alpha_machine1_lift.move(x_dir, x);
    $alpha_machine1_raiser.move(z_dir, z);
    sys.waitFor($alpha_machine1_lift);
    sys.waitFor($alpha_machine1_raiser);
}

void alpha_machine1() {
    setup_alpha_machine1();
    
    while(1) {
    //alpha_machine1_store(1, 0);
    //alpha_machine1_send(1, 0);
    alpha_machine1_move(7);
    alpha_machine1_move(2);    
    alpha_machine1_move(15);
    alpha_machine1_move(2);
    alpha_machine1_move(16);
    alpha_machine1_move(7);
    alpha_machine1_move(3);
    alpha_machine1_move(14);
    }
}


Jetzt bekomm ich aber die ganze Zeit "type mismatch for '=='":
Die Zeile:
PHP:
if(slot == "1")     {x2=4*88;        x3=270;        z2=96*2;        z3=UP;}


Weiß da einer was da dran falsch ist?
 
Last edited:

MacX

Light Guard
if( slot == 1 ) <-- ohne ", ist ja keine Zeichenkette.

Mit moveToPos solltest du die Bewegung auf einer Achse begrenzen können. Schau einfach mal in die Datei "doom_events.script". Da stehen alle möglichen Funktionen drin.
 
Last edited:

Kiran Müller

Commander Keen
Aber mein Float nicht dass es ne Kette ist? Ich probiers nochmal aus!

EDIT: moveToPos ist ja wieder was anderes ;-) Dann müsste ich ja dann mir die Origins raussuchen...

Also dass mit der Kette und so stimmt schonmal:
Das Level lädt jetzt wieder, nachdem ich nen loop noch drin hatte, aber ka wo, habs jetzt anders aufgerufen! Doch leider bewegt sich wieder nix...

EDIT: Kann es sein dass doom3 rechenoperationen wie 4*88 falsch errechnet? Mein Lift ist kilometer weit weg....
 
Last edited by a moderator:

MacX

Light Guard
Hab noch nicht gehört, dass der ScriptInterpreter mit so einfachen Rechenaufgaben Probleme hat. Sieht aber ziemlich kompliziert aus, was du da vor hast.
So stehts im SDK:
Code:
		case OP_MUL_F:
			var_a = GetVariable( st->a );
			var_b = GetVariable( st->b );
			var_c = GetVariable( st->c );
			*var_c.floatPtr = *var_a.floatPtr * *var_b.floatPtr;
			break;
Denke nicht, dass sich da jemand verrechnet.
----------------------------------------------------

Muss man vor dem Einsatz von ".move(...)" nicht "$func_mover.time( x )" benutzen?
 
Last edited:

Kiran Müller

Commander Keen
So also habe das ganze jetzt hinbekommen ;-) lag an einem Key, was nicht sauber abgefragt wurde beim lift ;-)

Zum mover:

ein func_mover hat eine standartmaßige Geschwindigkeit von 1er Sekunde bis zum Ziel! Du kannst aber weiter vorher im Script, wenn das Script lädt, sowas schon festlegen. Das gilt dann solange, bis es erneut festgelegt wird. Deswegen ist es bei meinem Script net zu sehen, weil ich den Bereich rausgelassen habe ;-)

Trotzdem Danke! Ohne die Hilfe wär ich da noch morgen dran ;-)
Habe jetzt knapp 12 Stunden an dem Script gehangen, bis dass die Sortieranlage jetzt funktioniert ;-)
 
Top