Jump to content

Recommended Posts

Posted (edited)

I am trying to set up a toggle via MCM for an auto-Purge Cell Buffer script. The problem is that the toggle script won't save in GECK with NVSE support. Am I doing something wrong?

 

scn zMCMPCBMenuScript

short iMaster
short iMouseOver
short iOption
short iTemp
float fTemp
float fValue
reference rList

begin GameMode
if GetGameRestarted
	if IsModLoaded "The Mod Configuration Menu.esp"
		set iMaster to GetModIndex "The Mod Configuration Menu.esp"
		set rList to BuildRef iMaster 2790
		ListAddForm rList zPCBMenuItem
	endif
endif
end

begin MenuMode 1013
if IsModLoaded "The Mod Configuration Menu.esp"
else
	Return
endif

if GetUIFloat "StartMenu/MCM/_ActiveMod" == GetModIndex "RHKPCB.esp"
	set iOption to GetUIFloat "StartMenu/MCM/_ActiveOption"
	set fValue to GetUIFloat "StartMenu/MCM/_Value"

	if GetUIFloat "StartMenu/MCM/*:5/SubMenu1/_enable" == 0
		SetUIFloat "StartMenu/MCM/_ActiveSubMenu" 1

		SetUIFloat "StartMenu/MCM/*:5/SubMenu1/_enable" 1
		SetUIString "StartMenu/MCM/*:5/SubMenu1/text/string" "General"
		SetUIString "StartMenu/MCM/*:8/SubTitle1/string" "Purge Cell Buffers Toggle"

		set zPCBToggle to 1
	endif

	if GetUIFloat "StartMenu/MCM/_Reset"			;1 - RESET
		SetUIFloat "StartMenu/MCM/_Reset" 0

		SetUIFloat "StartMenu/MCM/*:1/_columns" 1

	elseif GetUIFloat "StartMenu/MCM/_Default"		;2 - DEFAULT
		SetUIFloat "StartMenu/MCM/_Default" 0
		SetUIFloat "StartMenu/MCM/_Reset" 1

	elseif GetUIFloat "StartMenu/MCM/_NewValue"		;3 - NEW VALUE
		SetUIFloat "StartMenu/MCM/_NewValue" 0
		SetUIFloat "StartMenu/MCM/_Reset" 1

	elseif GetUIFloat "StartMenu/MCM/_ShowList" == 1		;4 - SHOW LIST
		SetUIFloat "StartMenu/MCM/_ShowList" 2

	elseif GetUIFloat "StartMenu/MCM/_ShowScale" == 1		;5 - SHOW SCALE
		SetUIFloat "StartMenu/MCM/_ShowScale" 2

	elseif GetUIFloat "StartMenu/MCM/_DefaultScale"		;6 - DEFAULT SCALE
		SetUIFloat "StartMenu/MCM/_DefaultScale" 0
		SetUIFloat "StartMenu/MCM/_ShowScale" 2

	endif

	if iMouseover != GetUIFloat "StartMenu/MCM/*:1/_optionID"		;7 - MOUSE-OVER
		set iMouseover to GetUIFloat "StartMenu/MCM/*:1/_optionID"
		if iMouseover
			SetUIFloat "StartMenu/MCM/MCM_Info/visible" 1

			if iMouseover == 1
			else
				SetUIFloat "StartMenu/MCM/MCM_Info/visible" 0
			endif
		else
			SetUIFloat "StartMenu/MCM/MCM_Info/visible" 0
		endif
	endif
endif
end

Edited by ripple
Posted (edited)

No dice. Still can't save the script. :( Here is the new script:

 

[edit] new script below.

Edited by ripple
Posted (edited)
Assuming Toggle is a global, does Toggle and PCBMenuItem exist in the plugin yet? If this is the only option, why use submenus? Edited by blove
Posted (edited)

Dear gads, it saved! I edited the script to change the global variable to a more recognizable name, must have messed that up. The problem now is....the menu doesn't show up in game with the other MCM menus.....

 

 

  Reveal hidden contents

 

Edited by ripple
Posted

Surprised that saves TBH.

 

In section 1 - RESET is where you define the UI elements and their formatting and what variable holds the value for each.

 

Your Purge Cell Buffers choice doesn't have a variable assigned using:

SetUIFloat StartMenu/MCM/*:1/*.1/_value" variableName

 

Your Profile choice has a variable name assigned but it isn't declared anywhere as to type within the script (is it a global?).

It's also a String chooser display type and you don't have strings assigned to the values. type 1 UI element presents a list of

String values and the user selects one. Not sure if that was your intent.

 

In section 2 - Default you'd supply code to set default values for the variables used as the values for the UI elements.

 

In section 3 - New Value you'd supply code to set the variables values when they are changed using the UI elements.

 

Um, I also think there is no long version of the "ref" keyword for reference variables, better to use "ref" and not "reference".

 

As an example assuming both a toggle box type display and a string list chooser it would look like so:

 

  Reveal hidden contents

 

  • Recently Browsing   0 members

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