evrymetul Posted May 12, 2018 Share Posted May 12, 2018 (edited) I'm new to papyrus, but I have some experience with C. Basically, this script isn't compiling and the Creation Kit (Oldrim) isn't displaying any error messages. This script was created with Notepad++ in hopes of making a MCM. I have SKSE and SkyUI installed, and the scripts from SkyUI's bsa are unpacked. Is there anything wrong with this script itself? Scriptname PovertyMCM extends SKI_ConfigBaseGlobalVariable Property povArrow AutoGlobalVariable Property povArmor AutoGlobalVariable Property povBook AutoGlobalVariable Property povClutter AutoGlobalVariable Property povFood AutoGlobalVariable Property povHarvest AutoGlobalVariable Property povIngredient AutoGlobalVariable Property povPotion AutoGlobalVariable Property povResource AutoGlobalVariable Property povSoulGem AutoGlobalVariable Property povWeapon Autoint povArrowSliderint povArmorSliderint povBookSliderint povClutterSliderint povFoodSliderint povHarvestSliderint povIngredientSliderint povPotionSliderint povResourceSliderint povSoulGemSliderint povWeaponSliderEvent OnPageReset(string page)SetCursorFillMode(TOP_TO_BOTTOM)SetCursorPosition(0)AddHeaderOption("Poverty Sliders")AddEmptyOption()povArrowSlider = AddSliderOption ("Arrow Removal Percentage", povArrowSlider.GetValueInt(), "{0}%")povArmorSlider = AddSliderOption ("Armor Removal Percentage", povArmorSlider.GetValueInt(), "{0}%")povBookSlider = AddSliderOption ("Book Removal Percentage", povBookSlider.GetValueInt(), "{0}%")povClutterSlider = AddSliderOption ("Clutter Removal Percentage", povClutterSlider.GetValueInt(), "{0}%")povFoodSlider = AddSliderOption ("Food Removal Percentage", povFoodSlider.GetValueInt(), "{0}%")povHarvestSlider = AddSliderOption ("Harvest Removal Percentage", povHarvestSlider.GetValueInt(), "{0}%")povIngredientSlider = AddSliderOption ("Ingredient Removal Percentage", povIngredientSlider.GetValueInt(), "{0}%")povPotionSlider = AddSliderOption ("Potion Removal Percentage", povPotionSlider.GetValueInt(), "{0}%")povResourceSlider = AddSliderOption ("Resource Removal Percentage", povResourceSlider.GetValueInt(), "{0}%")povSoulGemSlider = AddSliderOption ("Soul Gem Removal Percentage", povSoulGemSlider.GetValueInt(), "{0}%")povWeaponSlider = AddSliderOption ("Weapon Removal Percentage", povWeaponSlider.GetValueInt(), "{0}%")EndifEndEvent Edited May 12, 2018 by evrymetul Link to comment Share on other sites More sharing options...
Thandal Posted May 12, 2018 Share Posted May 12, 2018 Which game? (These days, even Skyrim modders need to distinguish between "Oldrim", "SSE", and "VR" versions when asking for help modding.) Link to comment Share on other sites More sharing options...
evrymetul Posted May 12, 2018 Author Share Posted May 12, 2018 Oldrim. Heh, just realized the typo in the title. Link to comment Share on other sites More sharing options...
cdcooley Posted May 12, 2018 Share Posted May 12, 2018 There's an unexpected "endif" near the bottom. Link to comment Share on other sites More sharing options...
evrymetul Posted May 12, 2018 Author Share Posted May 12, 2018 Thought I deleted that. Still isn't working. Link to comment Share on other sites More sharing options...
Jebbalon Posted May 12, 2018 Share Posted May 12, 2018 (edited) You'll need the SkyUI SDK from schlangster's page to compile. What you have isn't enough. You'll need the events like OnOptionSliderOpen() and OnOptionSliderAccept() Also look at using States in MCMenus it's quite a bit easier to manage. Schlangster's page also has that documentation. Edited May 12, 2018 by Jebbalon Link to comment Share on other sites More sharing options...
evrymetul Posted May 12, 2018 Author Share Posted May 12, 2018 I installed the SDK, still nothing. I finally found the built in compiler in the Creation Kit and got a bunch of errors. Starting 1 compile threads for 1 files...Compiling "PovertyMCM"...C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(36,79): int is not a known user-defined typeC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(36,19): type mismatch on parameter 2 (did you forget a cast?)C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(36,2): type mismatch while assigning to a int (cast missing or types unrelated)C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(37,79): int is not a known user-defined typeC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(37,19): type mismatch on parameter 2 (did you forget a cast?)C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(37,2): type mismatch while assigning to a int (cast missing or types unrelated)C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(38,76): int is not a known user-defined typeC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(38,18): type mismatch on parameter 2 (did you forget a cast?)C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(38,2): type mismatch while assigning to a int (cast missing or types unrelated)C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(39,85): int is not a known user-defined typeC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(39,21): type mismatch on parameter 2 (did you forget a cast?)C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(39,2): type mismatch while assigning to a int (cast missing or types unrelated)C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(40,76): int is not a known user-defined typeC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(40,18): type mismatch on parameter 2 (did you forget a cast?)C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(40,2): type mismatch while assigning to a int (cast missing or types unrelated)C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(41,85): int is not a known user-defined typeC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(41,21): type mismatch on parameter 2 (did you forget a cast?)C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(41,2): type mismatch while assigning to a int (cast missing or types unrelated)C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(42,94): int is not a known user-defined typeC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(42,24): type mismatch on parameter 2 (did you forget a cast?)C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(42,2): type mismatch while assigning to a int (cast missing or types unrelated)C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(43,82): int is not a known user-defined typeC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(43,20): type mismatch on parameter 2 (did you forget a cast?)C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(43,2): type mismatch while assigning to a int (cast missing or types unrelated)C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(44,88): int is not a known user-defined typeC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(44,22): type mismatch on parameter 2 (did you forget a cast?)C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(44,2): type mismatch while assigning to a int (cast missing or types unrelated)C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(45,86): int is not a known user-defined typeC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(45,21): type mismatch on parameter 2 (did you forget a cast?)C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(45,2): type mismatch while assigning to a int (cast missing or types unrelated)C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(46,82): int is not a known user-defined typeC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(46,20): type mismatch on parameter 2 (did you forget a cast?)C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PovertyMCM.psc(46,2): type mismatch while assigning to a int (cast missing or types unrelated)No output generated for PovertyMCM, compilation failed.Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on PovertyMCM Link to comment Share on other sites More sharing options...
Ghaunadaur Posted May 12, 2018 Share Posted May 12, 2018 GetValueInt() is a function used on global variables, not integers. If you already have integers, you don't need that. Link to comment Share on other sites More sharing options...
Jebbalon Posted May 14, 2018 Share Posted May 14, 2018 - Right, so you have a global and a integer ... GlobalVariable Property povArrow Auto int povArrowSlider - So, instead of this..... povArrowSlider.GetValueInt() - You'll need this.... povArrow.GetValueInt() Link to comment Share on other sites More sharing options...
evrymetul Posted May 18, 2018 Author Share Posted May 18, 2018 I finally got a script that compiled and seems to work, but it doesn't seem to affect the global variables. Is there anything that I'm missing and/or I could improve with? Scriptname PovertyMCM extends SKI_ConfigBaseint psAmmoint psArmorint psBookint psClutterint psFoodint psHarvestint psIngredientint psPotionint psResourceint psSeptimint psSoulGemint psWeaponfloat pfAmmofloat pfArmorfloat pfBookfloat pfClutterfloat pfFoodfloat pfHarvestfloat pfIngredientfloat pfPotionfloat pfResourcefloat pfSeptimfloat pfSoulGemfloat pfWeaponGlobalVariable Property pAmmo AutoGlobalVariable Property pArmor AutoGlobalVariable Property pBook AutoGlobalVariable Property pClutter AutoGlobalVariable Property pFood AutoGlobalVariable Property pHarvest AutoGlobalVariable Property pIngredient AutoGlobalVariable Property pPotion AutoGlobalVariable Property pResource AutoGlobalVariable Property pSeptim AutoGlobalVariable Property pSoulGem AutoGlobalVariable Property pWeapon Autoevent OnConfigInit()Pages = new string[1]Pages[0] = "Poverty Sliders"endEventevent OnPageReset(string page)SetCursorFillMode(TOP_TO_BOTTOM)SetCursorPosition(0)AddHeaderOption("Ammo Removal")psAmmo = AddSliderOption("", pfAmmo, "{pAmmo}")AddEmptyOption()AddHeaderOption("Armor Removal")psArmor = AddSliderOption("", pfArmor, "{pArmor}")AddEmptyOption()AddHeaderOption("Book Removal")psBook = AddSliderOption("", pfBook, "{pBook}")AddEmptyOption()AddHeaderOption("Clutter Removal")psClutter = AddSliderOption("", pfClutter, "{pClutter}")AddEmptyOption()AddHeaderOption("Food Removal")psFood = AddSliderOption("", pfFood, "{pFood}")AddEmptyOption()AddHeaderOption("Harvest Removal")psHarvest = AddSliderOption("", pfHarvest, "{pHarvest}")AddEmptyOption()AddHeaderOption("Ingredient Removal")psIngredient = AddSliderOption("", pfIngredient, "{pIngredient}")AddEmptyOption()AddHeaderOption("Potion Removal")psPotion = AddSliderOption("", pfPotion, "{pPotion}")AddEmptyOption()AddHeaderOption("Resource Removal")psResource = AddSliderOption("", pfResource, "{pResource}")AddEmptyOption()AddHeaderOption("Septim Removal")psSeptim = AddSliderOption("", pfSeptim, "{pSeptim}")AddEmptyOption()AddHeaderOption("Soul Gem Removal")psSoulGem = AddSliderOption("", pfSoulGem, "{pSoulGem}")AddEmptyOption()AddHeaderOption("Weapon Removal")psWeapon = AddSliderOption("", pfWeapon, "{pWeapon}")AddEmptyOption()endEventevent OnOptionSliderOpen(int option)if (option == psAmmo)SetSliderDialogStartValue(pfAmmo)SetSliderDialogDefaultValue(0)SetSliderDialogRange(0, 100)SetSliderDialogInterval(1)elseIf (option == psArmor)SetSliderDialogStartValue(pfArmor)SetSliderDialogDefaultValue(0)SetSliderDialogRange(0, 100)SetSliderDialogInterval(1)elseIf (option == psBook)SetSliderDialogStartValue(pfBook)SetSliderDialogDefaultValue(0)SetSliderDialogRange(0, 100)SetSliderDialogInterval(1)elseIf (option == psClutter)SetSliderDialogStartValue(pfClutter)SetSliderDialogDefaultValue(0)SetSliderDialogRange(0, 100)SetSliderDialogInterval(1)elseIf (option == psFood)SetSliderDialogStartValue(pfFood)SetSliderDialogDefaultValue(0)SetSliderDialogRange(0, 100)SetSliderDialogInterval(1)elseIf (option == psHarvest)SetSliderDialogStartValue(pfHarvest)SetSliderDialogDefaultValue(0)SetSliderDialogRange(0, 100)SetSliderDialogInterval(1)elseIf (option == psIngredient)SetSliderDialogStartValue(pfIngredient)SetSliderDialogDefaultValue(0)SetSliderDialogRange(0, 100)SetSliderDialogInterval(1)elseIf (option == psPotion)SetSliderDialogStartValue(pfPotion)SetSliderDialogDefaultValue(0)SetSliderDialogRange(0, 100)SetSliderDialogInterval(1)elseIf (option == psResource)SetSliderDialogStartValue(pfResource)SetSliderDialogDefaultValue(0)SetSliderDialogRange(0, 100)SetSliderDialogInterval(1)elseIf (option == psSeptim)SetSliderDialogStartValue(pfSeptim)SetSliderDialogDefaultValue(0)SetSliderDialogRange(0, 100)SetSliderDialogInterval(1)elseIf (option == psSoulGem)SetSliderDialogStartValue(pfSoulGem)SetSliderDialogDefaultValue(0)SetSliderDialogRange(0, 100)SetSliderDialogInterval(1)elseIf (option == psWeapon)SetSliderDialogStartValue(pfWeapon)SetSliderDialogDefaultValue(0)SetSliderDialogRange(0, 100)SetSliderDialogInterval(1)endIfendEventevent OnOptionSliderAccept(int option, float value)if (option == psAmmo)pfAmmo = valueSetSliderOptionValue(psAmmo, pfAmmo, "{0}%")pAmmo.SetValue(pfAmmo)elseIf (option == psArmor)pfArmor = valueSetSliderOptionValue(psArmor, pfArmor, "{0}%")pArmor.SetValue(pfArmor)elseIf (option == psBook)pfBook = valueSetSliderOptionValue(psBook, pfBook, "{0}%")pBook.SetValue(pfBook)elseIf (option == psClutter)pfClutter = valueSetSliderOptionValue(psClutter, pfClutter, "{0}%")pClutter.SetValue(pfClutter)elseIf (option == psFood)pfFood = valueSetSliderOptionValue(psFood, pfFood, "{0}%")pFood.SetValue(pfFood)elseIf (option == psHarvest)pfHarvest = valueSetSliderOptionValue(psHarvest, pfHarvest, "{0}%")pHarvest.SetValue(pfHarvest)elseIf (option == psIngredient)pfIngredient = valueSetSliderOptionValue(psIngredient, pfIngredient, "{0}%")pIngredient.SetValue(pfIngredient)elseIf (option == psPotion)pfPotion = valueSetSliderOptionValue(psPotion, pfPotion, "{0}%")pPotion.SetValue(pfPotion)elseIf (option == psResource)pfResource = valueSetSliderOptionValue(psResource, pfResource, "{0}%")pResource.SetValue(pfResource)elseIf (option == psSeptim)pfSeptim = valueSetSliderOptionValue(psSeptim, pfSeptim, "{0}%")pSeptim.SetValue(pfSeptim)elseIf (option == psSoulGem)pfSoulGem = valueSetSliderOptionValue(psSoulGem, pfSoulGem, "{0}%")pSoulGem.SetValue(pfSoulGem)elseIf (option == psWeapon)pfWeapon = valueSetSliderOptionValue(psWeapon, pfWeapon, "{0}%")pWeapon.SetValue(pfWeapon)endIfendEvent Link to comment Share on other sites More sharing options...
Recommended Posts