Jump to content

Menu Script Problem


Khet

Recommended Posts

Trying to create a menu, and I can navigate forward, but not back. These are the messages I'm using:

 

Main Menu Choices: "No Change" "Reset" "Continue"

 

All Other choices: "Yes" "Go Back"

 

While the 'Yes' option works perfectly fine for all three, the Go Back doesn't. It simply closes out the message but doesn't bring the Main Menu back up. Anyone know what I'm doing wrong here?

 

scn zzFPMQChoiceScript


Short Choice ;Check if the player has made their choice
Short SetUp ;Activate
Short Open ;Opens the Intro for the first time
Short Timer


short MenuLevel ; Records Menu Depth
; 0 - Intro
; 1 - No Change
; 2 - Reset
; 3 - Continue

Short Button1 ;Button variable for the Intro
short Button2 ; Button variable for the No Change Menu
short Button3 ; Button variable for the Reset Menu
short Button4 ; Button variable for the Continue Menu

Begin GameMode

SetQuestDelay zzFPMQChoice .1

If Choice == 0 && GetStage zzFPMQChoice == 1

Set Timer to Timer - GetSecondsPassed

;=====
; Menu
;=====

If Open == 0 && Timer <= 0
ShowMessage ZZFPMQType
Set Open to 1
Set MenuLevel to 0
EndIf

;====
; Intro
;====

If MenuLevel == 0
Set Button1 to GetButtonPressed
	If Button1 == -1
		Return
	Else
		If Button1 == 0
			ShowMessage ZZFPMQNo
			Set MenuLevel to 1
		ElseIf Button1 == 1
			ShowMessage ZZFPMQReset
			Set MenuLevel to 2
		ElseIf Button1 == 2
			ShowMessage ZZFPMQContinue
			Set MenuLevel to 3
		EndIf
	EndIf
EndIf

;=========
;No Change
;=========

If MenuLevel == 1
Set Button2 to GetButtonPressed
	If Button2 == -1
		Return
	Else
		If Button2 == 0
			Set MenuLevel to 0
			ShowMessage ZZFPMQType
		ElseIf Button2 == 1
			Set Choice to 1
		EndIf
	EndIf
EndIf

;=====
;Reset
;=====

If MenuLevel == 2
Set Button3 to GetButtonPressed
	If Button3 == -1
		Return
	Else
		If Button3 == 0
			Set MenuLevel to 0
			ShowMessage ZZFPMQType
		ElseIf Button2 == 1
			Set zzFPMQChoice2.Reset to 1
			Set Choice to 1
		EndIf
	EndIf
EndIf

;=======
;Continue
;=======

If MenuLevel == 3
Set Button4 to GetButtonPressed
	If Button4 == -1
		Return
	Else
		If Button4 == 0
			Set MenuLevel to 0
			ShowMessage ZZFPMQType
		ElseIf Button4 == 1
			Set zzFPMQChoice2.Continue to 1
			Set Choice to 1
		EndIf
	EndIf
EndIf

EndIf

;========
;End Menu
;========

End

Link to comment
Share on other sites

  • 2 weeks later...

No one? Been over this thing who knows how many times and don't see anything wrong with it.

I don't know what the big picture is behind what you are trying to do, but if you are working with a multi-layered menu system with each choice bringing up another menu or a different portion of the same menu, you are going to need to execute the branching code while in MenuMode. Once the GameMode code brings the initial menu up, the game leaves game mode entirely and enters menu mode. That would be the first place I look into for debugging.

 

Also, I don't trust the GECK script's flow control much, if their other bugs are any indication >_<. If I were you, I would use "if, elseif, elseif, elseif... endif" on the menu level branching instead of individual "if" blocks. Keep in mind that high depth menu tree negatively impacts playability and user-friendliness (many early Japanese RPGs suffer from that problem).

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...