Kapteyn Posted October 4, 2017 Share Posted October 4, 2017 It's on the MCM script, so it's the SKI_ConfigBase script. Use the MCM to flip the global variable, then reference that global in another script. Link to comment Share on other sites More sharing options...
foamyesque Posted October 4, 2017 Share Posted October 4, 2017 It's on the MCM script, so it's the SKI_ConfigBase script. Doesn't matter; what matters is the object the function is being called on, in this particular case MerchantCaravanAChest. I strongly suspect that is filled with the base form of the chest (name matches), not the world reference, and it's the world reference you need since RemoveItem only exists on things that are ObjectReferences. Link to comment Share on other sites More sharing options...
SevenBlue Posted October 4, 2017 Author Share Posted October 4, 2017 Foamy was completely right, I was using the base object instead of the ref. Also sorry for not including the code, oversight on my part. It's getting errors still. Here's the section of code I'm working on at the moment Event OnOptionSelect(int option) If (CurrentPage == "Settings") If (option == iKit) KitVal = !KitVal SetToggleOptionValue(iKit, KitVal) If (SB_SkoomaSetGlobal.GetValue() == 0) SB_SkoomaSetGlobal.SetValue(1) Else SB_SkoomaSetGlobal.SetValue(0) CaravanAChestREF.RemoveItem SB_Skoomaset 10 EndIf EndIf EndIf EndEvent and here are the errors C:\Games\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SB_MCMScript.psc(100,21): no viable alternative at input 'RemoveItem' C:\Games\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SB_MCMScript.psc(100,32): no viable alternative at input 'SB_SkoomaSet' Thank you guys for helping me with this so much, I really appreciate it. Link to comment Share on other sites More sharing options...
foamyesque Posted October 4, 2017 Share Posted October 4, 2017 You're using RemoveItem like it's a console command. Like Kapteyn said, you need to insert brackets and commas, like so: CaravanAChestREF.RemoveItem(SB_Skoomaset,10) Link to comment Share on other sites More sharing options...
SevenBlue Posted October 4, 2017 Author Share Posted October 4, 2017 My mistake, I tried it with and without the brackets and got two different errors, the missing comma seemed to be the key. I defaulted to without it because the example on the wiki doesn't use them. Although I'm still getting a compiler error. Event OnOptionSelect(int option) If (CurrentPage == "Settings") If (option == iKit) KitVal = !KitVal SetToggleOptionValue(iKit, KitVal) If (SB_SkoomaSetGlobal.GetValue() == 0) SB_SkoomaSetGlobal.SetValue(1) Else SB_SkoomaSetGlobal.SetValue(0) CaravanAChestREF.RemoveItem(SB_Skoomaset,10) EndIf EndIf EndIf EndEvent and the error C:\Games\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SB_MCMScript.psc(100,21): RemoveItem is not a function or does not exist Is this because it's a Ski_config script? Link to comment Share on other sites More sharing options...
foamyesque Posted October 4, 2017 Share Posted October 4, 2017 (edited) C:\Games\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SB_MCMScript.psc(100,21): RemoveItem is not a function or does not exist Is this because it's a Ski_config script? No, it's not because it's an SKI_Config script. Can I see your property declarations? Did you remember to update the declaration type from Container (a base form) or Form (which can be either a base form or a placed reference, and thus doesn't have ObjectReference-only functions defined) to ObjectReference? Edited October 4, 2017 by foamyesque Link to comment Share on other sites More sharing options...
SevenBlue Posted October 4, 2017 Author Share Posted October 4, 2017 Right on the money, I got it to compile now but it's glitching in game. With my test mod activated when I try and open the MCM menus it never opens and just idles indefinitely, here's the entire script. Scriptname SB_MCMScript extends SKI_ConfigBase Actor Property Risaad Auto LeveledItem Property SB_SkoomaSetPartB Auto MiscObject Property SB_SkoomaSet Auto GlobalVariable Property SB_SkoomaSetGlobal auto ObjectReference Property CaravanAChestREF Auto ;==================== ; DIVIDER ;==================== ;TOGGLE STATES Bool KitVal = False; ;==================== ; DIVIDER ;==================== ;OIDS (Option IDs) Int iKit ;==================== ; DIVIDER ;==================== Event OnConfigInit() Pages = new string[2] Pages[0] = "Settings" Pages[1] = "Skooma Types" EndEvent ;==================== ; DIVIDER ;==================== Event OnPageReset(string page) If (page == "") LoadCustomContent("MY FILE DIRECTORY") Else UnloadCustomContent() EndIf ;==================== ; DIVIDER ;==================== If (page == "Settings") SetCursorFillMode(TOP_TO_BOTTOM) AddHeaderOption("My Header") AddEmptyOption() ikit = AddToggleOption("Caravans have Skooma Kit", KitVal) ElseIf (page == "Skooma Types") EndIf EndEvent ;==================== ; DIVIDER ;==================== Event OnOptionSelect(int option) If (CurrentPage == "Settings") If (option == iKit) KitVal = !KitVal SetToggleOptionValue(iKit, KitVal) If (SB_SkoomaSetGlobal.GetValue() == 0) SB_SkoomaSetGlobal.SetValue(1) Else SB_SkoomaSetGlobal.SetValue(0) CaravanAChestREF.RemoveItem(SB_Skoomaset,10) EndIf EndIf EndIf EndEvent Link to comment Share on other sites More sharing options...
Kapteyn Posted October 4, 2017 Share Posted October 4, 2017 (edited) Remove this, I think it's looking for a DDS texture which doesn't exist... If (page == "") LoadCustomContent("MY FILE DIRECTORY") Else UnloadCustomContent() EndIf You don't need that part unless you actually have a custom image to display. I don't know if this should be "page" rather than "current page", but you don't need it anyway... If (CurrentPage == "Settings")On a side-note, I have no idea what this is all about... https://www.creationkit.com/index.php?title=RemoveItem I don't know if it's for Fallout, if it's relating to the Creation Kit itself, or what. Use the page which actually references the script it is for, in this case ObjectReference... https://www.creationkit.com/index.php?title=RemoveItem_-_ObjectReference As you might notice, the examples are formatted differently for some odd reason. Edited October 4, 2017 by Kapteyn Link to comment Share on other sites More sharing options...
SevenBlue Posted October 4, 2017 Author Share Posted October 4, 2017 Gotchya, that's my mistake. Understood, that was part of the boilerplate Darkfox provided in his tutorials. Also, I'm still encountering the same problem. Link to comment Share on other sites More sharing options...
foamyesque Posted October 4, 2017 Share Posted October 4, 2017 On a side-note, I have no idea what this is all about... https://www.creationkit.com/index.php?title=RemoveItem I don't know if it's for Fallout, if it's relating to the Creation Kit itself, or what. Use the page which actually references the script it is for, in this case ObjectReference... https://www.creationkit.com/index.php?title=RemoveItem_-_ObjectReference As you might notice, the examples are formatted differently for some odd reason. That's because one is a command you type into the console whilst in game (the top) and the other is the papyrus function call (the bottom). SevenBlue: MCM registration can be finicky and it's an area I'm a less familiar with. That said: Pages is a property on the script; try moving your page names into that instead of scripting them, and remove the OnConfigInit event entirely; see what happens. Link to comment Share on other sites More sharing options...
Recommended Posts