PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : MessageBox treibt mich in den Wahnsinn



bg2408
07.10.2007, 23:09
Wie geht das:
Wenn der Spieler einen Gegenstand aktiviert, erscheint Menü. Spieler wählt, und entsprechendes macht das Spiel. Jeweils entsprechend dem, was der Spieler bei Menüaufruf wählt.

Ich weiß, wie es mit Script Effect Spells geht- das kommt aber nicht infrage.

Ich koche gerade - seit drei Stunden versuche ich das mit tausend verschiedenen Möglichkeiten irgendwie hinzubekommen - inzwischen habe ichs immerhin soweit, daß es EINMAL klappt - aber nicht mehr folgende AKtivierungen. AAARgaVLÖuizdvgfjkl sdghbl qdfkbvgöpy

Mal eine Auflistung an Sachen, die ich schon versucht habe:
Equip + Menumode ein Script
- diverse Anordnungen von den Befehlen, Messageboxen, Getbuttonpresseds et cetera
Equip + Script Effect Ability
- diverse Ausformulierungen der SEA
Equip + Queststart
- diverse Formen des Questscripts

Es funktioniert nichts. Ich muß irgend etwas ganz Grundlegendes übersehen, was bei SESpells keine Rolle spielt. Bloß was? Variablenreset am Ende habe ich drin. Und die funktioniert auch - allerdings nur einmal. Arg!

Lazarus
08.10.2007, 07:59
Was mir spontan einfällt: Getbuttonpressed gehört immer in den Menu- bzw. GameMode-Block. Vielleicht war's das. Aber am besten zeigst du uns deinen Script. ;)

bg2408
08.10.2007, 09:15
Was mir spontan einfällt: Getbuttonpressed gehört immer in den Menu- bzw. GameMode-Block. Vielleicht war's das. Aber am besten zeigst du uns deinen Script. ;)

Er ist im GameMode - Block (wobei ich auch genug Scripts kenne, die per Menumode funktionieren, wie z.B. der Quest Award Leveller von Quarn <- das klappte bei mir gar nicht! Derzeit funktioniert immerhin der erste Durchlauf, beim MenuMode nicht einmal das) ... das ist es ja. Inzwischen habe ich Oblivion soweit, daß es den ersten Buttonpress wahrnimmt. Aber irgendwie keinen zweiten mehr. Obwohl ich alle Variablen resette, und die Quest währenddessen resetted wird.

Ich habe das Script inzwischen ziemlich geschlachtet... außerdem verrate ich dann, woran ich derzeit arbeite... na egal... also hier kommt das, was zuerst ein Objektscript, dann ein Magicscript, und nun ein Questscript ist!

scn bgCatsAndRatsChooseQuest

Short Button
Short MenuShown
Short DoOnce
Short Reset
Float FQuestDelayTime

Begin GameMode

Set FQuestDelayTime to 0.01
; set extremely low so that it grabs every button press;

If Reset == 1
Set DoOnce to 0
Set Button to -1
Set MenuShown to 0
Set Reset to 0
Endif
; included to reset the script when it's running a second time;

If DoOnce == 0
; DoOnce necessary, because otherwise the menus show up indefinitely;
If bgCatsAndRatsSetting == 0
MessageBox "This version of Cats and Rats tags guards to stop them from going on a rampage. There are three tagging modes. Insecure (best perfomance, high miss chance). Semi secure (tagging once when entering a new cell. Small miss chance and nearly no perfomance loss). Secure (tagging every five seconds, nearly no misses, may cause small perfomance loss on some machines.) Current mode is insecure. Do you want to change it?" "Change to semi secure" "Change to secure" "Cancel"
Set MenuShown to 1
Set Button to GetButtonPressed
ElseIf bgCatsAndRatsSetting == 1
MessageBox "This version of Cats and Rats tags guards to stop them from going on a rampage. There are three tagging modes. Insecure (best perfomance, high miss chance). Semi secure (tagging once when entering a new cell. Small miss chance and nearly no perfomance loss). Secure (tagging every five seconds, nearly no misses, may cause small perfomance loss on some machines.) Current mode is semi secure. Do you want to change it?" "Change to insecure" "Change to secure" "Cancel"
Set MenuShown to 2
Set Button to GetButtonPressed
ElseIf bgCatsAndRatsSetting == 2
MessageBox "This version of Cats and Rats tags guards to stop them from going on a rampage. There are three tagging modes. Insecure (best perfomance, high miss chance). Semi secure (tagging once when entering a new cell. Small miss chance and nearly no perfomance loss). Secure (tagging every five seconds, nearly no misses, may cause small perfomance loss on some machines.) Current mode is secure. Do you want to change it?" "Change to insecure" "Change to semi secure" "Cancel"
Set MenuShown to 3
Set Button to GetButtonPressed
Endif

; I already tried to put GetButtonPressed to another parts of the script - it didn't work ;

Set DoOnce to 1
Endif

If MenuShown == 1
Set Button to GetButtonPressed
If button == 0
Set bgCatsAndRatsSetting to 1
StopQuest bgCatsAndRatsGuardsSecure
StartQuest bgCatsandRatsGuardQuest
Message "Semi secure tagging enabled"
Set MenuShown to 4
ElseIf button == 1
Set bgCatsAndRatsSetting to 2
StartQuest bgCatsAndRatsGuardsSecure
StopQuest bgCatsandRatsGuardQuest
Message "Secure tagging enabled"
Set MenuShown to 4
ElseIf button == 2
Set MenuShown to 4
return
Endif
Endif

If MenuShown == 2
Set Button to GetButtonPressed
If button == 0
Set bgCatsAndRatsSetting to 0
StopQuest bgCatsAndRatsGuardsSecure
StopQuest bgCatsandRatsGuardQuest
Message "Insecure tagging enabled"
Set MenuShown to 4
ElseIf button == 1
Set bgCatsAndRatsSetting to 2
StartQuest bgCatsAndRatsGuardsSecure
StopQuest bgCatsandRatsGuardQuest
Message "Secure tagging enabled"
Set MenuShown to 4
ElseIf button == 2
Set MenuShown to 4
return
Endif
Endif

If MenuShown == 3
Set Button to GetButtonPressed
If button == 0
Set bgCatsAndRatsSetting to 0
StopQuest bgCatsAndRatsGuardsSecure
StopQuest bgCatsandRatsGuardQuest
Message "Insecure tagging enabled"
Set MenuShown to 4
ElseIf button == 1
Set bgCatsAndRatsSetting to 1
StopQuest bgCatsAndRatsGuardsSecure
StartQuest bgCatsandRatsGuardQuest
Message "Semi secure tagging enabled"
Set MenuShown to 4
ElseIf button == 2
Set MenuShown to 4
return
Endif
Endif

; MenuShown 4 is set once the game recognizes a button press, so the script is running until that is done. I can say that this scripts runs fine the first time, but fails to get the button press the second time and following;

if MenuShown == 4
Set Reset to 1
StopQuest bgCatsAndRatsChoose
Endif
End

Low Post
08.10.2007, 15:18
Probier mal dieses Skript:

scn bgCatsAndRatsChooseActivatorScript

;Global: bgCatsAndRatsSetting

short button
short MessageNumber

Begin OnEquip Player
if bgCatsAndRatsSetting == 0
set MessageNumber to 1
MessageBox "This version of Cats and Rats tags guards to stop them from going on a rampage. There are three tagging modes. Insecure (best perfomance, high miss chance). Semi secure (tagging once when entering a new cell. Small miss chance and nearly no perfomance loss). Secure (tagging every five seconds, nearly no misses, may cause small perfomance loss on some machines.) Current mode is insecure. Do you want to change it?" "Change to semi secure" "Change to secure" "Cancel"
elseif bgCatsAndRatsSetting == 1
set MessageNumber to 2
MessageBox "This version of Cats and Rats tags guards to stop them from going on a rampage. There are three tagging modes. Insecure (best perfomance, high miss chance). Semi secure (tagging once when entering a new cell. Small miss chance and nearly no perfomance loss). Secure (tagging every five seconds, nearly no misses, may cause small perfomance loss on some machines.) Current mode is semi secure. Do you want to change it?" "Change to insecure" "Change to secure" "Cancel"
elseif bgCatsAndRatsSetting == 2
set MessageNumber to 3
MessageBox "This version of Cats and Rats tags guards to stop them from going on a rampage. There are three tagging modes. Insecure (best perfomance, high miss chance). Semi secure (tagging once when entering a new cell. Small miss chance and nearly no perfomance loss). Secure (tagging every five seconds, nearly no misses, may cause small perfomance loss on some machines.) Current mode is secure. Do you want to change it?" "Change to insecure" "Change to semi secure" "Cancel"
endif
End

Begin Menumode
if MessageNumber == 1
set button to GetButtonPressed + 1
elseif MessageNumber == 2
set button to GetButtonPressed + 11
elseif MessageNumber == 3
set button to GetButtonPressed + 21
endif
if button == 1
Set bgCatsAndRatsSetting to 1
StopQuest bgCatsAndRatsGuardsSecure
StartQuest bgCatsandRatsGuardQuest
Message "Semi secure tagging enabled"
set MessageNumber to 0
set button to 0
elseif button == 2
Set bgCatsAndRatsSetting to 2
StartQuest bgCatsAndRatsGuardsSecure
StopQuest bgCatsandRatsGuardQuest
Message "Secure tagging enabled"
set MessageNumber to 0
set button to 0
elseif button == 3
set MessageNumber to 0
set button to 0
elseif button == 11
Set bgCatsAndRatsSetting to 0
StopQuest bgCatsAndRatsGuardsSecure
StopQuest bgCatsandRatsGuardQuest
Message "Insecure tagging enabled"
set MessageNumber to 0
set button to 0
elseif button == 12
Set bgCatsAndRatsSetting to 2
StartQuest bgCatsAndRatsGuardsSecure
StopQuest bgCatsandRatsGuardQuest
Message "Secure tagging enabled"
set MessageNumber to 0
set button to 0
elseif button == 13
set MessageNumber to 0
set button to 0
elseif button == 21
Set bgCatsAndRatsSetting to 0
StopQuest bgCatsAndRatsGuardsSecure
StopQuest bgCatsandRatsGuardQuest
Message "Insecure tagging enabled"
set MessageNumber to 0
set button to 0
elseif button == 22
Set bgCatsAndRatsSetting to 1
StopQuest bgCatsAndRatsGuardsSecure
StartQuest bgCatsandRatsGuardQuest
Message "Semi secure tagging enabled"
set MessageNumber to 0
set button to 0
elseif button == 23
set MessageNumber to 0
set button to 0
endif
End
Skript muss auf den Activator, Messageboxen kommen im Menumode-Block. Ich hab so ein ähnliches Skript schonmal geschrieben (anderer Text, mehr Auswahlmöglichkeiten, erste Messagebox immer gleich) und das funktioniert bei mir ohne Probleme.