Kyren
14.01.2010, 15:36
Guten Abend!
Ich bin grad auf einen Fehler bei einem Script für ein Zusatzmenü gestoßen.. Nun, Fehler ist vielleicht nicht ganz zutreffend - Auf jeden Fall reagiert das betreffende Menü zu langsam. Ich verwende das selbe Script für alle anderen Menüs in meinem Spiel und hab damit soweit keine Probleme, aber in dem Fall wird das Schalten vom 5ten Menüpunkt auf den 4ten Menüpunkt verzögert, wenn man vom 6ten Menüpunkt aus hinauf schaltet. Quasi 6 Menüpunkt -> 5 Menüpunkt -Verzögerung-> 4 Menüpunkt
Das Problem tritt auf wenn man schnell hinaufschalten will, der Tastendruck auf den Pfeil nach oben wird einfach nicht bemerkt - erst beim zweiten mal. Wenn man die Sache langsamer angeht funktioniert alles.
Aber lässt sich das ausbessern? Oder frisst mein Menüscript etwas viel Leistung?
Der entsprechende Code(befindet sich in einem Parallelen Prozess):
- SCRIPT -
<> Comment: ----Zusatzmenüsteuerung----
<> Show Picture: #9, zusatzmenu, (275, 126), Mgn 100%, Tsp 0%, No trans. color
<> Show Picture: #10, zusatzmenu_cursor, (275, 38), Mgn 100%, Tsp 0%
<> Loop
. <> Comment: Auswahl startet bei obersten Zusatzmenüfeld
. <> Comment: ------Menüpunkt 1 -> Hinunter zu Menüpunkt 2----
. <> Key Input Processing: Var. [4], Wait until key pressed, Keys: Directional keys
. <> Fork Condition: If Variable [5] == 17 then ...
. . <> Fork Condition: If Variable [4] == 1 then ...
. . . <> Move Picture: #10, (275, 54), Mgn 100%, Tsp 0%, 0,0 sec., Wait
. . . <> Change Variable: [5] = 18
. . . <> Change Variable: [4] = 0
. . . <>
. . : End of fork
. . <>
. : End of fork
. <> Comment: ------Menüpunkt 2 -> Hinauf zu Menüpunkt 1----
. <> Fork Condition: If Variable [5] == 18 then ...
. . <> Fork Condition: If Variable [4] == 4 then ...
. . . <> Move Picture: #10, (275, 38), Mgn 100%, Tsp 0%, 0,0 sec., Wait
. . . <> Change Variable: [5] = 17
. . . <> Change Variable: [4] = 0
. . . <>
. . : End of fork
. . <>
. : End of fork
. <> Comment: ------Menüpunkt 2-> Hinunter zu Menüpunkt 3----
. <> Fork Condition: If Variable [5] == 18 then ...
. . <> Fork Condition: If Variable [4] == 1 then ...
. . . <> Move Picture: #10, (275, 70), Mgn 100%, Tsp 0%, 0,0 sec., Wait
. . . <> Change Variable: [5] = 19
. . . <> Change Variable: [4] = 0
. . . <>
. . : End of fork
. . <>
. : End of fork
. <> Comment: ------Menüpunkt 3 -> Hinauf zu Menüpunkt 2----
. <> Fork Condition: If Variable [5] == 19 then ...
. . <> Fork Condition: If Variable [4] == 4 then ...
. . . <> Move Picture: #10, (275, 54), Mgn 100%, Tsp 0%, 0,0 sec., Wait
. . . <> Change Variable: [5] = 18
. . . <> Change Variable: [4] = 0
. . . <>
. . : End of fork
. . <>
. : End of fork
. <> Comment: ------Menüpunkt 3 -> Hinunter zu Menüpunkt 4
. <> Fork Condition: If Variable [5] == 19 then ...
. . <> Fork Condition: If Variable [4] == 1 then ...
. . . <> Move Picture: #10, (275, 86), Mgn 100%, Tsp 0%, 0,0 sec., Wait
. . . <> Change Variable: [5] = 20
. . . <> Change Variable: [4] = 0
. . . <>
. . : End of fork
. . <>
. : End of fork
. <> Comment: ------Menüpunkt 4 -> Hinauf zu Menüpunkt 3
. <> Fork Condition: If Variable [5] == 20 then ...
. . <> Fork Condition: If Variable [4] == 4 then ...
. . . <> Move Picture: #10, (275, 70), Mgn 100%, Tsp 0%, 0,0 sec., Wait
. . . <> Change Variable: [5] = 19
. . . <> Change Variable: [4] = 0
. . . <>
. . : End of fork
. . <>
. : End of fork
. <> Comment: ------Menüpunkt 4 -> Hinunter zu Menüpunkt 5
. <> Fork Condition: If Variable [5] == 20 then ...
. . <> Fork Condition: If Variable [4] == 1 then ...
. . . <> Move Picture: #10, (275, 102), Mgn 100%, Tsp 0%, 0,0 sec., Wait
. . . <> Change Variable: [5] = 21
. . . <> Change Variable: [4] = 0
. . . <>
. . : End of fork
. . <>
. : End of fork
. <> Comment: ------Menüpunkt 5 -> Hinauf zu Menüpunkt 4
. <> Fork Condition: If Variable [5] == 21 then ...
. . <> Fork Condition: If Variable [4] == 4 then ...
. . . <> Move Picture: #10, (275, 86), Mgn 100%, Tsp 0%, 0,0 sec., Wait
. . . <> Change Variable: [5] = 20
. . . <> Change Variable: [4] = 0
. . . <>
. . : End of fork
. . <>
. : End of fork
. <> Comment: ------Menüpunkt 5-> hinunter zu Menüpunkt 6
. <> Fork Condition: If Variable [5] == 21 then ...
. . <> Fork Condition: If Variable [4] == 1 then ...
. . . <> Move Picture: #10, (275, 118), Mgn 100%, Tsp 0%, 0,0 sec., Wait
. . . <> Change Variable: [5] = 22
. . . <> Change Variable: [4] = 0
. . . <>
. . : End of fork
. . <>
. : End of fork
. <> Comment: ------Menüpunkt 6-> hinauf zu Menüpunkt 5
. <> Fork Condition: If Variable [5] == 22 then ...
. . <> Fork Condition: If Variable [4] == 4 then ...
. . . <> Move Picture: #10, (275, 102), Mgn 100%, Tsp 0%, 0,0 sec., Wait
. . . <> Change Variable: [5] = 21
. . . <> Change Variable: [4] = 0
. . . <>
. . : End of fork
. . <>
. : End of fork
. <> Comment: ------Menüpunkt 6-> hinunter zu Menüpunkt 7
. <> Fork Condition: If Variable [5] == 22 then ...
. . <> Fork Condition: If Variable [4] == 1 then ...
. . . <> Move Picture: #10, (275, 118), Mgn 100%, Tsp 0%, 0,0 sec., Wait
. . . <> Change Variable: [5] = 23
. . . <> Change Variable: [4] = 0
. . . <>
. . : End of fork
. . <>
. : End of fork
. <> Comment: ------Menüpunkt 7-> hinauf zu Menüpunkt 6
. <> Fork Condition: If Variable [5] == 23 then ...
. . <> Fork Condition: If Variable [4] == 4 then ...
. . . <> Move Picture: #10, (275, 102), Mgn 100%, Tsp 0%, 0,0 sec., Wait
. . . <> Change Variable: [5] = 22
. . . <> Change Variable: [4] = 0
. . . <>
. . : End of fork
. . <>
. : End of fork
. <>
: End of loop
Ich bin grad auf einen Fehler bei einem Script für ein Zusatzmenü gestoßen.. Nun, Fehler ist vielleicht nicht ganz zutreffend - Auf jeden Fall reagiert das betreffende Menü zu langsam. Ich verwende das selbe Script für alle anderen Menüs in meinem Spiel und hab damit soweit keine Probleme, aber in dem Fall wird das Schalten vom 5ten Menüpunkt auf den 4ten Menüpunkt verzögert, wenn man vom 6ten Menüpunkt aus hinauf schaltet. Quasi 6 Menüpunkt -> 5 Menüpunkt -Verzögerung-> 4 Menüpunkt
Das Problem tritt auf wenn man schnell hinaufschalten will, der Tastendruck auf den Pfeil nach oben wird einfach nicht bemerkt - erst beim zweiten mal. Wenn man die Sache langsamer angeht funktioniert alles.
Aber lässt sich das ausbessern? Oder frisst mein Menüscript etwas viel Leistung?
Der entsprechende Code(befindet sich in einem Parallelen Prozess):
- SCRIPT -
<> Comment: ----Zusatzmenüsteuerung----
<> Show Picture: #9, zusatzmenu, (275, 126), Mgn 100%, Tsp 0%, No trans. color
<> Show Picture: #10, zusatzmenu_cursor, (275, 38), Mgn 100%, Tsp 0%
<> Loop
. <> Comment: Auswahl startet bei obersten Zusatzmenüfeld
. <> Comment: ------Menüpunkt 1 -> Hinunter zu Menüpunkt 2----
. <> Key Input Processing: Var. [4], Wait until key pressed, Keys: Directional keys
. <> Fork Condition: If Variable [5] == 17 then ...
. . <> Fork Condition: If Variable [4] == 1 then ...
. . . <> Move Picture: #10, (275, 54), Mgn 100%, Tsp 0%, 0,0 sec., Wait
. . . <> Change Variable: [5] = 18
. . . <> Change Variable: [4] = 0
. . . <>
. . : End of fork
. . <>
. : End of fork
. <> Comment: ------Menüpunkt 2 -> Hinauf zu Menüpunkt 1----
. <> Fork Condition: If Variable [5] == 18 then ...
. . <> Fork Condition: If Variable [4] == 4 then ...
. . . <> Move Picture: #10, (275, 38), Mgn 100%, Tsp 0%, 0,0 sec., Wait
. . . <> Change Variable: [5] = 17
. . . <> Change Variable: [4] = 0
. . . <>
. . : End of fork
. . <>
. : End of fork
. <> Comment: ------Menüpunkt 2-> Hinunter zu Menüpunkt 3----
. <> Fork Condition: If Variable [5] == 18 then ...
. . <> Fork Condition: If Variable [4] == 1 then ...
. . . <> Move Picture: #10, (275, 70), Mgn 100%, Tsp 0%, 0,0 sec., Wait
. . . <> Change Variable: [5] = 19
. . . <> Change Variable: [4] = 0
. . . <>
. . : End of fork
. . <>
. : End of fork
. <> Comment: ------Menüpunkt 3 -> Hinauf zu Menüpunkt 2----
. <> Fork Condition: If Variable [5] == 19 then ...
. . <> Fork Condition: If Variable [4] == 4 then ...
. . . <> Move Picture: #10, (275, 54), Mgn 100%, Tsp 0%, 0,0 sec., Wait
. . . <> Change Variable: [5] = 18
. . . <> Change Variable: [4] = 0
. . . <>
. . : End of fork
. . <>
. : End of fork
. <> Comment: ------Menüpunkt 3 -> Hinunter zu Menüpunkt 4
. <> Fork Condition: If Variable [5] == 19 then ...
. . <> Fork Condition: If Variable [4] == 1 then ...
. . . <> Move Picture: #10, (275, 86), Mgn 100%, Tsp 0%, 0,0 sec., Wait
. . . <> Change Variable: [5] = 20
. . . <> Change Variable: [4] = 0
. . . <>
. . : End of fork
. . <>
. : End of fork
. <> Comment: ------Menüpunkt 4 -> Hinauf zu Menüpunkt 3
. <> Fork Condition: If Variable [5] == 20 then ...
. . <> Fork Condition: If Variable [4] == 4 then ...
. . . <> Move Picture: #10, (275, 70), Mgn 100%, Tsp 0%, 0,0 sec., Wait
. . . <> Change Variable: [5] = 19
. . . <> Change Variable: [4] = 0
. . . <>
. . : End of fork
. . <>
. : End of fork
. <> Comment: ------Menüpunkt 4 -> Hinunter zu Menüpunkt 5
. <> Fork Condition: If Variable [5] == 20 then ...
. . <> Fork Condition: If Variable [4] == 1 then ...
. . . <> Move Picture: #10, (275, 102), Mgn 100%, Tsp 0%, 0,0 sec., Wait
. . . <> Change Variable: [5] = 21
. . . <> Change Variable: [4] = 0
. . . <>
. . : End of fork
. . <>
. : End of fork
. <> Comment: ------Menüpunkt 5 -> Hinauf zu Menüpunkt 4
. <> Fork Condition: If Variable [5] == 21 then ...
. . <> Fork Condition: If Variable [4] == 4 then ...
. . . <> Move Picture: #10, (275, 86), Mgn 100%, Tsp 0%, 0,0 sec., Wait
. . . <> Change Variable: [5] = 20
. . . <> Change Variable: [4] = 0
. . . <>
. . : End of fork
. . <>
. : End of fork
. <> Comment: ------Menüpunkt 5-> hinunter zu Menüpunkt 6
. <> Fork Condition: If Variable [5] == 21 then ...
. . <> Fork Condition: If Variable [4] == 1 then ...
. . . <> Move Picture: #10, (275, 118), Mgn 100%, Tsp 0%, 0,0 sec., Wait
. . . <> Change Variable: [5] = 22
. . . <> Change Variable: [4] = 0
. . . <>
. . : End of fork
. . <>
. : End of fork
. <> Comment: ------Menüpunkt 6-> hinauf zu Menüpunkt 5
. <> Fork Condition: If Variable [5] == 22 then ...
. . <> Fork Condition: If Variable [4] == 4 then ...
. . . <> Move Picture: #10, (275, 102), Mgn 100%, Tsp 0%, 0,0 sec., Wait
. . . <> Change Variable: [5] = 21
. . . <> Change Variable: [4] = 0
. . . <>
. . : End of fork
. . <>
. : End of fork
. <> Comment: ------Menüpunkt 6-> hinunter zu Menüpunkt 7
. <> Fork Condition: If Variable [5] == 22 then ...
. . <> Fork Condition: If Variable [4] == 1 then ...
. . . <> Move Picture: #10, (275, 118), Mgn 100%, Tsp 0%, 0,0 sec., Wait
. . . <> Change Variable: [5] = 23
. . . <> Change Variable: [4] = 0
. . . <>
. . : End of fork
. . <>
. : End of fork
. <> Comment: ------Menüpunkt 7-> hinauf zu Menüpunkt 6
. <> Fork Condition: If Variable [5] == 23 then ...
. . <> Fork Condition: If Variable [4] == 4 then ...
. . . <> Move Picture: #10, (275, 102), Mgn 100%, Tsp 0%, 0,0 sec., Wait
. . . <> Change Variable: [5] = 22
. . . <> Change Variable: [4] = 0
. . . <>
. . : End of fork
. . <>
. : End of fork
. <>
: End of loop