• Announcements

    • Ashal

      SITE MOVED - IN READ ONLY MODE   12/08/2015

      Please use http://www.loverslab.com moving forward. Site has been restored to a previous version, and this one placed into a read-only mode. This is available for a limited time so users may reference/copy content that has been lost in the transition. This will no longer be accessible by December 22nd, 2015.
randomtguy

MCM script won't compile

I used this http://www.nexusmods.com/skyrim/mods/29821/to compile an MCM script, but I can't get the damn thing to compile. I tried studying the script against the MCM tutorial and it all seems fine, particularly the lines that are causing the errors. This is the script:

ScriptName SimplerSlaveryMCMScript Extends SKI_ConfigBaseint Function GetVersion()	Return 1 ; Last versionEndFunction;------------  Private Variables; OIDs (T:Text B:Toggle S:Slider M:Menu, C:Color, K:Key)int SRSModEnabled_OID_Bint SRSMinHealthToTrigger_OID_Sint SRSChanceofEnslavement_OID_S; Statesint SRSModEnabledint SRSMinHealthToTriggerint SRSChanceofEnslavement; GlobalVariable StatesEvent OnConfigInit()	{Called when this config menu is initialized}	; Creating pages	Pages = new string[1]	Pages[0] = "Page"EndEventEvent OnVersionUpdate(int version)	{Called when a version update of this script has been detected}EndEventEvent OnPageReset(string page)	{Called when a new page is selected, including the initial empty page}	; Building Page page...	If ( page == "Page" )		If (CurrentVersion >= 1)			SRSModEnabled_OID_B = AddEmptyOption()			SRSMinHealthToTrigger_OID_S = AddSliderOption("Health threshold", 20)			SRSChanceofEnslavement_OID_S = AddSliderOption("Chance of enslavement", 20)		EndIf		Return	EndIfEndEventEvent OnOptionHighlight(int option)	{Called when highlighting an option}	If (option == SRSModEnabled_OID_B )			SetInfoText("Activates Simpler Slavery")		Return	EndIf	If (option == SRSMinHealthToTrigger_OID_S )			SetInfoText("Minimum health to trigger Simple Slavery. Set to just above the threshold of your defeat mod  ")		Return	EndIf	If (option == SRSChanceofEnslavement_OID_S )			SetInfoText("The chance that a combat defeat will lead to enslavement")		Return	EndIfEndEventEvent OnOptionSelect(int option)	{Called when a non-interactive option has been selected}	If ( option == SRSModEnabled_OID_B )		SetTextOptionValue(SRSModEnabled_OID_B, SRSModEnabled)		Return	EndIfEndEventEvent OnOptionDefault(int option)	{Called when resetting an option to its default value}EndEventEvent OnOptionSliderOpen(int option)	{Called when a slider option has been selected}	If ( option == SRSMinHealthToTrigger_OID_S )		SetSliderDialogStartValue(20)		SetSliderDialogDefaultValue(20)		SetSliderDialogRange(0, 100)		SetSliderDialogInterval(1)		Return	EndIf	If ( option == SRSChanceofEnslavement_OID_S )		SetSliderDialogStartValue(20)		SetSliderDialogDefaultValue(20)		SetSliderDialogRange(0, 100)		SetSliderDialogInterval(1)		Return	EndIfEndEventEvent OnOptionSliderAccept(int option, float value)	{Called when a new slider value has been accepted}	If ( option == SRSMinHealthToTrigger_OID_S )		SRSMinHealthToTrigger = value		SetSliderOptionValue(SRSMinHealthToTrigger_OID_S, SRSMinHealthToTrigger, "Every {0}")		Return	EndIf	If ( option == SRSChanceofEnslavement_OID_S )		SRSChanceofEnslavement = value		SetSliderOptionValue(SRSChanceofEnslavement_OID_S, SRSChanceofEnslavement, "Every {0}")		Return	EndIfEndEventEvent OnOptionMenuOpen(int option)	{Called when a menu option has been selected}EndEventEvent OnOptionMenuAccept(int option, int index)	{Called when a menu entry has been accepted}EndEventEvent OnOptionColorOpen(int option)	{Called when a color option has been selected}EndEventEvent OnOptionColorAccept(int option, int color)	{Called when a new color has been accepted}EndEventEvent OnOptionKeyMapChange(int option, int keyCode, string conflictControl, string conflictName)	{Called when a key has been remapped}EndEvent

 

And these are the errors:
D:\Games\Steam\steamapps\common\skyrim\Data\Scripts\Source\SimplerSlaveryMCMScript.psc(106,2): type mismatch while assigning to a int (cast missing or types unrelated)
D:\Games\Steam\steamapps\common\skyrim\Data\Scripts\Source\SimplerSlaveryMCMScript.psc(112,2): type mismatch while assigning to a int (cast missing or types unrelated)

 

Which must be referencing "SRSMinHealthToTrigger = value" and "SRSChanceofEnslavement = value", which so far as I can tell should be fine.

 

There just seems to be something fundamentally wrong with my Creation Kit setup. The above errors are what happens if I try to compile the script using the script manager, if I try to do it while attaching it to a quest and using [new script] I get the error "Invalid doc string. Doc may not contain any { or } characters", which I know is wrong as there are { and } characters used in the MCM tutorial. I've tried installing SKSE and the SkyUI SDK about a million times, do I need to do anything else? Maybe extract the SkyUI BSA or something like that?
 

 

0

Share this post


Link to post

Your SRSMinHealthToTrigger and SRSChanceofEnslavement variables are integers, but you're trying to feed them a float. You'll want to cast 'value' into an integer before assigning it to your variables. Like this:


 


Line 106:



SRSMinHealthToTrigger = value As Int

Line 112:



SRSChanceofEnslavement = value As Int

1

Share this post


Link to post

 

Your SRSMinHealthToTrigger and SRSChanceofEnslavement variables are integers, but you're trying to feed them a float. You'll want to cast 'value' into an integer before assigning it to your variables. Like this:

 

Line 106:

SRSMinHealthToTrigger = value As Int

Line 112:

SRSChanceofEnslavement = value As Int

 

You're a legend, thanks a bunch.

 

0

Share this post


Link to post