Construction Set Skriptthread zum Construction Set

Dann versuche ich es mal mit dem Skript aus deinem 22:12 Uhr Post. Wenn ich nicht klar komme, melde ich mich noch mal. Vielen Dank für deine Hilfe.

LG
Arielle
 
@ Eydis: Wie Kahmul zitiert hat, du musst erst StreamMusic Random ausführen und 1 frame später die eigentliche Musik abspielen. Ich optimiere mal den Script etwas und passe es so an, wie es funktionieren sollte.
Code:
Scn AAAMusikWürfelScript

Short Choosing
short button

Begin onActivate player
     if Choosing == 0
          set Choosing to -1
     endif
end

Begin onEquip player
     if Choosing == 0
          set Choosing to -1
     endif
end

Begin gameMode
     If (Choosing == -1)
          MessageBox "Was möchtet ihr tun?", "Nehmen", "Musik auswählen", "Fertig"
          set Choosing to 1
          return
     elseif (Choosing == 1)
          set button to GetButtonPressed
          if (button== -1)
               return
          elseif (button == 0)
               Activate
               Set Choosing to 0
          elseif (button == 1)
               Set Choosing to -2
          elseif (button == 2)
               Set Choosing to 0
          endif
     Endif

     If (Choosing == -2)
          MessageBox "Welche Musik möchtet ihr hören?", "Lied 1", "Lied 2", "Lied 3", "Lied 4", "Lied 5", "Zurück", "Abbrechen"
          set Choosing to 2
          return
     elseif (Choosing == 2)
          set button to GetButtonPressed
          if (button == -1)
               return
          elseif (button  == 5)
               Set Choosing to -1
          elseif (button == 6)
               Set Choosing to 0
          else
               StreamMusic random
               set Choosing to 3
               return
          endif
      elseif (Choosing == 3)
          if (button == 0)
               StreamMusic "Data\Music\Eydis\Lied_1.mp3"
          elseif (button  == 1)
               StreamMusic "Data\Music\Eydis\Lied_2.mp3"
          elseif (button == 2)
               StreamMusic "Data\Music\Eydis\Lied_3.mp3"
          elseif (button == 3)
               StreamMusic "Data\Music\Eydis\Lied_4.mp3"
          elseif (button == 4)
               StreamMusic "Data\Music\Eydis\Lied_5.mp3"
          endif
          set Choosing to 0
     Endif
End

Begin menuMode
     If (Choosing == -1)
          MessageBox "Was möchtet ihr tun?", "Ablegen", "Musik auswählen", "Fertig"
          set Choosing to 1
          return
     elseif (Choosing == 1)
          set button to GetButtonPressed
          if (button== -1)
               return
          elseif (button == 0)
               Set Choosing to 0
               DropMe
          elseif (button == 1)
               Set Choosing to -2
          elseif (button == 2)
               Set Choosing to 0
          endif
     Endif

     If (Choosing == -2)
          MessageBox "Welche Musik möchtet ihr hören?", "Lied 1", "Lied 2", "Lied 3", "Lied 4", "Lied 5", "Zurück", "Abbrechen"
          set Choosing to 2
          return
     elseif (Choosing == 2)
          set button to GetButtonPressed
          if (button == -1)
               return
          elseif (button  == 5)
               Set Choosing to -1
          elseif (button == 6)
               Set Choosing to 0
          else
               StreamMusic random
               set Choosing to 3
               return
          endif
      elseif (Choosing == 3)
          if (button == 0)
               StreamMusic "Data\Music\Eydis\Lied_1.mp3"
          elseif (button  == 1)
               StreamMusic "Data\Music\Eydis\Lied_2.mp3"
          elseif (button == 2)
               StreamMusic "Data\Music\Eydis\Lied_3.mp3"
          elseif (button == 3)
               StreamMusic "Data\Music\Eydis\Lied_4.mp3"
          elseif (button == 4)
               StreamMusic "Data\Music\Eydis\Lied_5.mp3"
          endif
          set Choosing to 0
     Endif
End
 
@ Eydis: Wie Kahmul zitiert hat, du musst erst StreamMusic Random ausführen und 1 frame später die eigentliche Musik abspielen. Ich optimiere mal den Script etwas und passe es so an, wie es funktionieren sollte.
Code:
Scn AAAMusikWürfelScript

Short Choosing
short button

Begin onActivate player
     if Choosing == 0
          set Choosing to -1
     endif
end

Begin onEquip player
     if Choosing == 0
          set Choosing to -1
     endif
end

Begin gameMode
     If (Choosing == -1)
          MessageBox "Was möchtet ihr tun?", "Nehmen", "Musik auswählen", "Fertig"
          set Choosing to 1
          return
     elseif (Choosing == 1)
          set button to GetButtonPressed
          if (button== -1)
               return
          elseif (button == 0)
               Activate
               Set Choosing to 0
          elseif (button == 1)
               Set Choosing to -2
          elseif (button == 2)
               Set Choosing to 0
          endif
     Endif

     If (Choosing == -2)
          MessageBox "Welche Musik möchtet ihr hören?", "Lied 1", "Lied 2", "Lied 3", "Lied 4", "Lied 5", "Zurück", "Abbrechen"
          set Choosing to 2
          return
     elseif (Choosing == 2)
          set button to GetButtonPressed
          if (button == -1)
               return
          elseif (button  == 5)
               Set Choosing to -1
          elseif (button == 6)
               Set Choosing to 0
          else
               StreamMusic random
               set Choosing to 3
               return
          endif
      elseif (Choosing == 3)
          if (button == 0)
               StreamMusic "Data\Music\Eydis\Lied_1.mp3"
          elseif (button  == 1)
               StreamMusic "Data\Music\Eydis\Lied_2.mp3"
          elseif (button == 2)
               StreamMusic "Data\Music\Eydis\Lied_3.mp3"
          elseif (button == 3)
               StreamMusic "Data\Music\Eydis\Lied_4.mp3"
          elseif (button == 4)
               StreamMusic "Data\Music\Eydis\Lied_5.mp3"
          endif
          set Choosing to 0
     Endif
End

Begin menuMode
     If (Choosing == -1)
          MessageBox "Was möchtet ihr tun?", "Ablegen", "Musik auswählen", "Fertig"
          set Choosing to 1
          return
     elseif (Choosing == 1)
          set button to GetButtonPressed
          if (button== -1)
               return
          elseif (button == 0)
               Set Choosing to 0
               DropMe
          elseif (button == 1)
               Set Choosing to -2
          elseif (button == 2)
               Set Choosing to 0
          endif
     Endif

     If (Choosing == -2)
          MessageBox "Welche Musik möchtet ihr hören?", "Lied 1", "Lied 2", "Lied 3", "Lied 4", "Lied 5", "Zurück", "Abbrechen"
          set Choosing to 2
          return
     elseif (Choosing == 2)
          set button to GetButtonPressed
          if (button == -1)
               return
          elseif (button  == 5)
               Set Choosing to -1
          elseif (button == 6)
               Set Choosing to 0
          else
               StreamMusic random
               set Choosing to 3
               return
          endif
      elseif (Choosing == 3)
          if (button == 0)
               StreamMusic "Data\Music\Eydis\Lied_1.mp3"
          elseif (button  == 1)
               StreamMusic "Data\Music\Eydis\Lied_2.mp3"
          elseif (button == 2)
               StreamMusic "Data\Music\Eydis\Lied_3.mp3"
          elseif (button == 3)
               StreamMusic "Data\Music\Eydis\Lied_4.mp3"
          elseif (button == 4)
               StreamMusic "Data\Music\Eydis\Lied_5.mp3"
          endif
          set Choosing to 0
     Endif
End

Nun wird zwar auch in Zellen mit Musiktyp "Default" Musik abgespielt, nur leider nicht die Richtige. Die Musikstücke werden komplett zufällig ausgewählt. :?

Liebe Grüße,
Eydis
 
Sorry wenn ich nochmal nachfragen muss. Aber ich habe bei dem Torskript Fehlermeldungen beim Speichern.






Wie kann ich das Skript noch retten?
 
Das liegt bloß an der Reihenfolge von "if", "endif" und "else" im "onActivate"-Block. Bei dir sieht es momentan so aus:
Code:
if
 if
 else
 endif
endif
else
 if
 endif

Richtig wäre es so:
Code:
if
 if
 else
 endif
else
 if
 endif
endif
 
  • Like
Reaktionen: Arielle 1000
Nein, ich glaube ich hab einfach ein "endif" vergessen. Arielle schreib mal noch eins vor das "end"

Edit: oh, du hast das Script doch so gelassen... Dann hat Diarrhoe natürlich recht :lol:
 
Zuletzt bearbeitet:
  • Like
Reaktionen: Arielle 1000
Ja, vielen Dank euch beiden. Das Skript lässt sich nach den Änderungen problemlos abspeichern. Leider bewirkt es ingame überhaupt gar nichts. Weder schließt sich das Tor hinter mir noch erscheint eine Messagebox.
Habt ihr noch Ideen, was man da machen kann?
 
Ich teste immer mit einem Cleansave, daran kanns nicht liegen.

Ich denke, es liegt am Tor selber. Es ist keine normale Tür, sondern ein Activator-Door ähnlich der Ayleiden-Tore, die sich in den Erdboden versenken beim Öffnen. Vielleicht brauchen diese Activator einen anderen Befehl. Dieses Tor soll also wieder hochfahren, nachdem ich den Trigger im nächsten Raum erreicht habe. Dieser Befehl sollte vermutlich im Triggerskript enthalten sein.
Das Triggerskript sieht im Moment so aus:

scn AWDEisDungeonTor01ClosedScript

Begin OnActivate

if IsActionRef player == 1
Lock 100
endif

End

Was sagt ihr dazu?



Edit: muss da nicht ein Befehl wie "playgroup forward" oder sowas rein?
 
Zuletzt bearbeitet:
Kahmul, falls der für mich ist, dann danke. Werde dein Skript ausprobieren.



Juchuuuu.....nochmals vielen Dank, das Tor schließt sich jetzt wirklich hinter mir. Langsam kommen wir zum Ziel. Jetzt muss nur noch die Messagebox erscheinen, wenn ich das verschlossene Tor aktivieren will. Der Befehl für die Messagebox befindet sich aktuell im Tor-Skript. Oder muss der doch in das Trigger-Skript? Kommt Jungs, das ist jetzt die letzte Hürde, dann ist dieser Abschnitt beendet.:lol:
 
Zuletzt bearbeitet:
Also das Script von Kahmul ist genau dass selbe,wie ich es gestern gepostet hatte...
Wenn du das Tor-Script so hast, dass die "closed Variable drinsteht, musst du nur in den Trigger folgende Zeile einfügen (irgendwo zwischen if und endif)

"set WAND-REF.closed to 1"
 
  • Like
Reaktionen: Arielle 1000
Ich glaube, das ist schon drin. Schau mal wie es jetzt aussieht.


scn AWDEisDungeonTor01ClosedScript

Short Closed
Begin OnTriggerActor Player

if(closed == 0)
AWDEisDungeonTor01ref.playgroup backward, 0
set closed to 1
endif
end


Fehlt da noch was?
 
Doch, es steht drin. Das Tor-Skript sieht so aus:

scn AWDWerwolfTor01Script

short closed
short init
short open
short next
short busy
float timer
ref mySelf
ref myParent

begin onActivate

if isActionRef player == 0 && isActionRef mySelf == 0 && busy == 0
if open == 0
playgroup forward 0
set open to 1
enableLinkedPathPoints
else
playgroup backward 1
set open to 0
disableLinkedPathPoints
endif
set next to 1
set busy to 1
set timer to 1
endif
else
if closed==1
messagebox"Eine magische Kraft scheint dieses Tor verschlossen zu halten. Ich sollte mir einen anderen Weg suchen!"
endif
endif
end

begin gameMode

if init == 0
; set up ref vars
set mySelf to getSelf
set myParent to getParentRef
; prepare linked pathsgrid points
disableLinkedPathPoints
set init to 1
endif

; daisy-chain activation
if next == 1 && timer <=0
set next to 0
myParent.activate mySelf 1
endif

if isAnimPlaying == 0 && busy == 1
set busy to 0
endif

if timer > 0
set timer to timer - getSecondsPassed
endif

end

begin onReset

reset3DState
set open to 0
set next to 0
set busy to 0
disableLinkedPathPoints

end

Trigger-Skript sieht so aus:

scn AWDEisDungeonTor01ClosedScript

Short Closed
Begin OnTriggerActor Player

if(closed == 0)
AWDEisDungeonTor01ref.playgroup backward, 0
set AWDEisDungeonTor01ref.closed to 1
endif
end

Aber jetzt geht das Tor andauernd hoch und runter, wenn ich durch den Trigger laufe. Aber immerhin erscheint die Messagebox.

Oh Mann, ist das eine schwierige Geburt!:lol:
 
Mach das Triggerskript so:

PHP:
scn AWDEisDungeonTor01ClosedScript

Short Closed 

Begin OnTriggerActor Player 

if(closed == 0) 
    AWDEisDungeonTor01ref.playgroup backward, 0 
    set AWDEisDungeonTor01ref.closed to 1
    set closed to 1
endif 
end
 
  • Like
Reaktionen: Arielle 1000
Vielen Dank Kahmul, es funktioniert jetzt perfekt.

Einen Dank an euch alle, Jungs. Ihr habt mir alle sehr geduldig geholfen. Ich könnt euch knutschen. Dafür gebe ich eine Runde "Dankebutton" aus!

LG
Arielle
 
Ja du hattest die "set closed to 1"-Zeile durch die "set TOR-REF.closed to 1"-Zeile ersetzt^^ Eigentlich hatte ich beide Scripts von Anfang an so gemacht wie sie am Ende richtig waren :lol: Naja egal, es hat lange gedauert, aber wenn es jetzt funzt ist ja alles in Ordnung xD
 
Ihr müsst sehr geduldig mit mir sein. Hab nun mal eine lange Leitung, was das Skripten angeht. Aber besser spät kapieren als gar nicht, oder?:lol:
 
Guten Tag,

ich bräuchte bitte den Befehl um einen Gegenstand zu enablen.

Sprich, ich habe ein Objekt, das standardmäßig deaktiviert ist. Das möchte ich nun beim aktivieren eines Objektes aktivieren.

In etwa :


scn blablabla

begin onactive

if isactionref player == 1

blablabla aktivieren

endif

end



Gruss rojep