PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Common Event noch aktiv trotz Switch=Aus



djeurissen
09.09.2011, 13:48
Hallo, ich komm bei dem Problem echt nicht weiter^^.

So, es läuft nun so ich sprech ein Event an, das Skript wird per Switch aktiviert sodass der Held jeweils nur 1 Feld gehen kann, dann geht er zu einer Richtung drückt enter und das vorher angesprochenen Event bewegt sich dorthin.. Soweit klappt alles, nun wird der Switch wieder ausgeschaltet...
So und nun kommt es das Skript ist aus irgendeinem Grund noch aktiv... Der Held kann imernoch nur 1 Feld gehen und das Event weiter bewegen...
Das eigenartige dadran ich habe nachgekukt der Switch ist aus und trotzdem scheint das Skript noch zu funktionieren..
Ich habe auch nach Events und Common Events gekukt die irgendwie das Skript auch ausführen, ist aber keins Vorhanden....

Also echt wie kann ein Skript das nicht Aktiv ist noch funktionieren O.o...
Wäre sehr verbunden wenn mir da einer hilft

Leana
09.09.2011, 20:48
Ich vermute mal, dass du in deinem Script eine Endlosschleife hast. Also etwas in der Art

Label:
irgendeine Aktion
Sprung zu Label

Einmal aktiviert läuft das Script immer weiter und wird auch durch das Deaktivieren des Switches nicht gestoppt.

djeurissen
09.09.2011, 21:03
Ja das habe ich mir auch schon gedacht also habe ich es so gemacht das man dann aus dem Loop (sozusagen) rauskommt dann der switch deaktiviert wird, allerdings kann man dann überhaupt nichts mehr machen...
Und vorallem wenn ich die Antwort weiß, weiß ich nicht die Lösung^^, wäre also nett noch ne Lösungsmethode zu erwähnen

Leana
09.09.2011, 21:38
Für nen konkreten Lösungsvorschlag brauch ich aber nochn paar Infos:

1. Besteht das Script nur aus "Held nur 1 Feld bewegen und verschieben des angesprochenen Events" oder ist darin noch mehr enthalten?
2. Wird die Entertaste im Script oder in einem anderen Event abgefragt?
3. Wo genau wird der Switch deaktiviert?

djeurissen
09.09.2011, 21:43
Naja,

ich schicke einfach mal das komplette skript könnte sein das die Label zahlen zu hoch sind habe damit was rumprobiert^^:



- SCRIPT -
<> Label: 6
<> Fork Condition: If Variable [2] == 1 then ...
. <> Show Picture: #1, Reichweite 1, (152, 120), Move w/ map, Mgn 100%, Tsp 0%/0%
. <>
: Else ...
. <>
: End of fork
<> Fork Condition: If Variable [2] == 2 then ...
. <> Show Picture: #1, Reichweite 2, (152, 120), Move w/ map, Mgn 100%, Tsp 0%/0%
. <>
: Else ...
. <>
: End of fork
<> Fork Condition: If Variable [2] == 3 then ...
. <> Show Picture: #1, Reichweite 3, (152, 120), Move w/ map, Mgn 100%, Tsp 0%/0%
. <>
: Else ...
. <>
: End of fork
<> Fork Condition: If Variable [2] == 4 then ...
. <> Show Picture: #1, Reichtweite 4, (152, 120), Move w/ map, Mgn 100%, Tsp 0%/0%
. <>
: Else ...
. <>
: End of fork
<> Fork Condition: If Variable [2] == 5 then ...
. <> Show Picture: #1, Reichweite 5, (152, 120), Move w/ map, Mgn 100%, Tsp 0%/0%
. <>
: Else ...
. <>
: End of fork
<> Fork Condition: If Variable [2] == 6 then ...
. <> Show Picture: #1, Reichweite 6, (152, 120), Move w/ map, Mgn 100%, Tsp 0%/0%
. <>
: Else ...
. <>
: End of fork
<> Fork Condition: If Variable [2] == 7 then ...
. <> Show Picture: #1, Range7, (152, 120), Move w/ map, Mgn 100%, Tsp 0%/0%
. <>
: Else ...
. <>
: End of fork
<> Fork Condition: If Variable [2] == 8 then ...
. <> Show Picture: #1, Reichweite 8, (152, 120), Move w/ map, Mgn 100%, Tsp 0%/0%
. <>
: Else ...
. <>
: End of fork
<> Fork Condition: If Variable [2] == 9 then ...
. <> Show Picture: #1, Reichweite 9, (152, 120), Move w/ map, Mgn 100%, Tsp 0%/0%
. <>
: Else ...
. <>
: End of fork
<> Comment: Bewegen
<> Label: 5
<> Fork Condition: If Variable [2] == 0 then ...
. <> Erase Picture: #1
. <> Change Switch: [1] = OFF
. <> Jump To Label: 6
. <> Wait Until Moved
. <>
: Else ...
. <>
: End of fork
<> Wait Until Moved
<> Fork Condition: If Variable [1] == 1 then ...
. <> Move Event: Hero, Frq 8, Pattern: Mv down
. <> Change Variable: [6] = 0
. <> Fork Condition: If Variable [6] == 0 then ...
. . <> Label: 1
. . <> Fork Condition: If Variable [1] == 4 then ...
. . . <> Move Event: Hero, Frq 8, Pattern: Mv up
. . . <> Change Variable: [6] = 1
. . . <> Jump To Label: 5
. . . <>
. . : Else ...
. . . <>
. . : End of fork
. . <> Jump To Label: 1
. . <>
. : Else ...
. . <>
. : End of fork
. <>
: Else ...
. <>
: End of fork
<> Fork Condition: If Variable [1] == 2 then ...
. <> Move Event: Hero, Frq 8, Pattern: Mv left
. <> Change Variable: [6] = 0
. <> Fork Condition: If Variable [6] == 0 then ...
. . <> Label: 2
. . <> Fork Condition: If Variable [1] == 3 then ...
. . . <> Move Event: Hero, Frq 8, Pattern: Mv right
. . . <> Change Variable: [6] = 1
. . . <> Jump To Label: 5
. . . <>
. . : Else ...
. . . <>
. . : End of fork
. . <> Jump To Label: 2
. . <>
. : Else ...
. . <>
. : End of fork
. <>
: Else ...
. <>
: End of fork
<> Fork Condition: If Variable [1] == 3 then ...
. <> Move Event: Hero, Frq 8, Pattern: Mv right
. <> Change Variable: [6] = 0
. <> Fork Condition: If Variable [6] == 0 then ...
. . <> Label: 3
. . <> Fork Condition: If Variable [1] == 2 then ...
. . . <> Move Event: Hero, Frq 8, Pattern: Mv left
. . . <> Change Variable: [6] = 1
. . . <> Jump To Label: 5
. . . <>
. . : Else ...
. . . <>
. . : End of fork
. . <> Jump To Label: 3
. . <>
. : Else ...
. . <>
. : End of fork
. <>
: Else ...
. <>
: End of fork
<> Fork Condition: If Variable [1] == 4 then ...
. <> Move Event: Hero, Frq 8, Pattern: Mv up
. <> Change Variable: [6] = 0
. <> Fork Condition: If Variable [6] == 0 then ...
. . <> Label: 4
. . <> Fork Condition: If Variable [1] == 1 then ...
. . . <> Move Event: Hero, Frq 8, Pattern: Mv down
. . . <> Change Variable: [6] = 1
. . . <> Jump To Label: 5
. . . <>
. . : Else ...
. . . <>
. . : End of fork
. . <> Fork Condition: If Variable [1] == 5 then ...
. . . <> Fork Condition: If Switch [2] == OFF then ...
. . . . <> Comment: Held Monster
. . . . <> Fork Condition: If Variable [7] == 1 then ...
. . . . . <> Move Event: Event #0, Frq 8, Pattern: Mv up, Fc down
. . . . . <> Wait Until Moved
. . . . . <> Change Variable: [2] -= 1
. . . . . <> Change Variable: [6] = 1
. . . . . <> Jump To Label: 5
. . . . . <>
. . . . : Else ...
. . . . . <>
. . . . : End of fork
. . . . <> Fork Condition: If Variable [7] == 2 then ...
. . . . . <> Move Event: Event #0, Frq 8, Pattern: Mv up, Fc down
. . . . . <> Wait Until Moved
. . . . . <> Change Variable: [2] -= 1
. . . . . <> Change Variable: [6] = 1
. . . . . <> Jump To Label: 5
. . . . . <>
. . . . : Else ...
. . . . . <>
. . . . : End of fork
. . . . <> Fork Condition: If Variable [7] == 3 then ...
. . . . . <> Move Event: Event #0, Frq 8, Pattern: Mv up, Fc down
. . . . . <> Wait Until Moved
. . . . . <> Change Variable: [2] -= 1
. . . . . <> Change Variable: [6] = 1
. . . . . <> Jump To Label: 5
. . . . . <>
. . . . : Else ...
. . . . . <>
. . . . : End of fork
. . . . <> Fork Condition: If Variable [7] == 4 then ...
. . . . . <> Move Event: Event #0, Frq 8, Pattern: Mv up, Fc down
. . . . . <> Wait Until Moved
. . . . . <> Change Variable: [2] -= 1
. . . . . <> Change Variable: [6] = 1
. . . . . <> Jump To Label: 5
. . . . . <>
. . . . : Else ...
. . . . . <>
. . . . : End of fork
. . . . <> Fork Condition: If Variable [7] == 5 then ...
. . . . . <> Move Event: Event #0, Frq 8, Pattern: Mv up, Fc down
. . . . . <> Wait Until Moved
. . . . . <> Change Variable: [2] -= 1
. . . . . <> Change Variable: [6] = 1
. . . . . <> Jump To Label: 5
. . . . . <>
. . . . : Else ...
. . . . . <>
. . . . : End of fork
. . . . <> Fork Condition: If Variable [7] == 6 then ...
. . . . . <> Move Event: Event #0, Frq 8, Pattern: Mv up, Fc down
. . . . . <> Wait Until Moved
. . . . . <> Change Variable: [2] -= 1
. . . . . <> Change Variable: [6] = 1
. . . . . <> Jump To Label: 5
. . . . . <>
. . . . : Else ...
. . . . . <>
. . . . : End of fork
. . . . <> Fork Condition: If Variable [7] == 7 then ...
. . . . . <> Move Event: Event #0, Frq 8, Pattern: Mv up, Fc down
. . . . . <> Wait Until Moved
. . . . . <> Change Variable: [2] -= 1
. . . . . <> Change Variable: [6] = 1
. . . . . <> Jump To Label: 5
. . . . . <>
. . . . : Else ...
. . . . . <>
. . . . : End of fork
. . . . <> Fork Condition: If Variable [7] == 8 then ...
. . . . . <> Move Event: Event #0, Frq 8, Pattern: Mv up, Fc down
. . . . . <> Wait Until Moved
. . . . . <> Change Variable: [2] -= 1
. . . . . <> Change Variable: [6] = 1
. . . . . <> Jump To Label: 5
. . . . . <>
. . . . : Else ...
. . . . . <>
. . . . : End of fork
. . . . <>
. . . : Else ...
. . . . <>
. . . : End of fork
. . . <>
. . : Else ...
. . . <>
. . : End of fork
. . <> Jump To Label: 4
. . <>
. : Else ...
. . <>
. : End of fork
. <>
: Else ...
. <>
: End of fork
<> Jump To Label: 5


ab If Variable 4 ist es anm bedeutesten, da ich dort es als erstes getestet habe. 5 steht für Enter 4 steht für oben. Und variable 2 steht für welches Event, also insgesamt 8.

Leana
09.09.2011, 22:20
So, mal sehen, ob ich deinen Code richtig verstanden habe:


Comment: Bewegen
<> Label: 5
<> Fork Condition: If Variable [2] == 0 then ...
. <> Erase Picture: #1
. <> Change Switch: [1] = OFF
. <> Jump To Label: 6
. <> Wait Until Moved
1. Wait Until Moved wird nie ausgeführt, weil du vorher mit "Jump to Label 6" an den Anfang des Scripts springst.
2. Durch den Sprung zu Label 6 entsteht die erwähnte Endlosschleife. Soll das Script an dieser Stelle beendet werden, so musst du zu einem Label 7 springen, den du als letzten Befehl in deinem Script plazierst, d.h. nach dem letzten "Jump to Label 5".

Dann ist mir noch etwas aufgefallen:


<> Fork Condition: If Variable [1] == 1 then ...
. <> Move Event: Hero, Frq 8, Pattern: Mv down
. <> Change Variable: [6] = 0
. <> Fork Condition: If Variable [6] == 0 then ...
. . <> Label: 1
. . <> Fork Condition: If Variable [1] == 4 then ...
. . . <> Move Event: Hero, Frq 8, Pattern: Mv up
. . . <> Change Variable: [6] = 1
. . . <> Jump To Label: 5
. . . <>
. . : Else ...
. . . <>
. . : End of fork
. . <> Jump To Label: 1
. . <>
. : Else ...
. . <>
. : End of fork
. <>
: Else ...
. <>
: End of fork

Den rotmarkierten Befehl kannst du dir eigentlich sparen. Dadurch, dass du die Variable vorher auf 0 setzt, ist die Bedingung immer erfüllt.

djeurissen
09.09.2011, 22:39
Ok^^,

habe die Fehler beseitigt und nun klappt es auch mit deinem tipp^^. Warum bin ich nicht drauf gekommen und habe die ganze zeit das Label nach ganz oben gesetzt.. (aber im nachhinein kann man alles als dummen fehler ansehen)
Naja danke...

Edit:
Ne Frage,
warum macht der Maker das eigentlich? Ich meine wenn ich will das ein Event aus ist dann sollte es doch aus sein O.o...

Leana
09.09.2011, 23:31
Edit:
Ne Frage,
warum macht der Maker das eigentlich? Ich meine wenn ich will das ein Event aus ist dann sollte es doch aus sein O.o...

Der Switch ist lediglich die Startbedingung für den Event. Danach wird er vom Maker nicht mehr abgefragt. Du musst also schon selber dafür sorgen, dass der Event aus ist, wenn er aus sein soll ;)