Jump to content

[LE] What's wrong with this scripy?


Recommended Posts

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_ConfigBase


GlobalVariable Property povArrow Auto
GlobalVariable Property povArmor Auto
GlobalVariable Property povBook Auto
GlobalVariable Property povClutter Auto
GlobalVariable Property povFood Auto
GlobalVariable Property povHarvest Auto
GlobalVariable Property povIngredient Auto
GlobalVariable Property povPotion Auto
GlobalVariable Property povResource Auto
GlobalVariable Property povSoulGem Auto
GlobalVariable Property povWeapon Auto

int povArrowSlider
int povArmorSlider
int povBookSlider
int povClutterSlider
int povFoodSlider
int povHarvestSlider
int povIngredientSlider
int povPotionSlider
int povResourceSlider
int povSoulGemSlider
int povWeaponSlider


Event 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}%")

Endif

EndEvent

 

Edited by evrymetul
Link to comment
Share on other sites

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 by Jebbalon
Link to comment
Share on other sites

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 type
C:\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 type
C:\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 type
C:\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 type
C:\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 type
C:\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 type
C:\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 type
C:\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 type
C:\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 type
C:\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 type
C:\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 type
C:\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

- 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

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_ConfigBase


int psAmmo
int psArmor
int psBook
int psClutter
int psFood
int psHarvest
int psIngredient
int psPotion
int psResource
int psSeptim
int psSoulGem
int psWeapon

float pfAmmo
float pfArmor
float pfBook
float pfClutter
float pfFood
float pfHarvest
float pfIngredient
float pfPotion
float pfResource
float pfSeptim
float pfSoulGem
float pfWeapon

GlobalVariable Property pAmmo Auto
GlobalVariable Property pArmor Auto
GlobalVariable Property pBook Auto
GlobalVariable Property pClutter Auto
GlobalVariable Property pFood Auto
GlobalVariable Property pHarvest Auto
GlobalVariable Property pIngredient Auto
GlobalVariable Property pPotion Auto
GlobalVariable Property pResource Auto
GlobalVariable Property pSeptim Auto
GlobalVariable Property pSoulGem Auto
GlobalVariable Property pWeapon Auto

event OnConfigInit()
Pages = new string[1]
Pages[0] = "Poverty Sliders"

endEvent

event 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()


endEvent

event 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)
endIf
endEvent


event OnOptionSliderAccept(int option, float value)
if (option == psAmmo)
pfAmmo = value
SetSliderOptionValue(psAmmo, pfAmmo, "{0}%")
pAmmo.SetValue(pfAmmo)

elseIf (option == psArmor)
pfArmor = value
SetSliderOptionValue(psArmor, pfArmor, "{0}%")
pArmor.SetValue(pfArmor)

elseIf (option == psBook)
pfBook = value
SetSliderOptionValue(psBook, pfBook, "{0}%")
pBook.SetValue(pfBook)

elseIf (option == psClutter)
pfClutter = value
SetSliderOptionValue(psClutter, pfClutter, "{0}%")
pClutter.SetValue(pfClutter)

elseIf (option == psFood)
pfFood = value
SetSliderOptionValue(psFood, pfFood, "{0}%")
pFood.SetValue(pfFood)

elseIf (option == psHarvest)
pfHarvest = value
SetSliderOptionValue(psHarvest, pfHarvest, "{0}%")
pHarvest.SetValue(pfHarvest)

elseIf (option == psIngredient)
pfIngredient = value
SetSliderOptionValue(psIngredient, pfIngredient, "{0}%")
pIngredient.SetValue(pfIngredient)

elseIf (option == psPotion)
pfPotion = value
SetSliderOptionValue(psPotion, pfPotion, "{0}%")
pPotion.SetValue(pfPotion)

elseIf (option == psResource)
pfResource = value
SetSliderOptionValue(psResource, pfResource, "{0}%")
pResource.SetValue(pfResource)

elseIf (option == psSeptim)
pfSeptim = value
SetSliderOptionValue(psSeptim, pfSeptim, "{0}%")
pSeptim.SetValue(pfSeptim)

elseIf (option == psSoulGem)
pfSoulGem = value
SetSliderOptionValue(psSoulGem, pfSoulGem, "{0}%")
pSoulGem.SetValue(pfSoulGem)

elseIf (option == psWeapon)
pfWeapon = value
SetSliderOptionValue(psWeapon, pfWeapon, "{0}%")
pWeapon.SetValue(pfWeapon)
endIf
endEvent

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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