Jump to content

pcaviator

Members
  • Posts

    163
  • Joined

  • Last visited

Everything posted by pcaviator

  1. Gee I feel really dumb. I've tried this in the OnPageReset event for a logo & according to the MCM tutorial. You'd think it'd be straight-forward, but no, I crash & burn again :sad: Yes, the file is in the archive under the interface/logo folder & yees, it is a dds file. Event OnPageReset(string page) If page == "" ; load dds logo float imageWidth = 256 float imageHeight = 128 float X_offset = (376 - (imageWidth / 2)) float Y_offset = (223 - (imageHeight / 2)) ; path of the loaded file is relative to Data/Interface/. LoadCustomContent("Logo/SpoiltFood.dds", X_offset, Y_offset) return Else UnloadCustomContent() EndIf If page == Pages[0] SetCursorFillMode(TOP_TO_BOTTOM) OID_OnOff = AddToggleOption("$Toggle Spoiled Food", bOID_OnOff) AddEmptyOption() AddHeaderOption("$Chance of spoilt food") int i = 0 while i < OID_Array_S.Length OID_Array_S[i] = AddSliderOption(Descriptor[i], MSFT.SpoilChance[i], "${0}% Spoil Chance") i+=1 EndWhile EndIf EndEvent
  2. Next Q - dds files. Size/dimension limit? Optimum size? Just looks at other mods & they seem to vary widely, I'll go with 512x 128 px
  3. Still lots of Q's. Q1: Why is the pex & the psc files included in the archive? Is this just convention or are both needed for a mod to work? Q2: Not sure about the random number generator in papyrus. Out of 4 food items in my test cell & frequently got 4 out of 4 either spoilt or not-spoilt when probability was set to 50:50
  4. Yes, I'll have to be more care with cycles & loops. That's why I put the "Float ChanceToSpoil = GetLocationTypeSpoilChance()" before the iteration loops, otherwise ther'd be a call to that function with each loop iteration.
  5. OK got it work (I think). MCM menu shows up, & food shows spoiled label. I removed the SpoilFoodInCell function & put all the pertient code in the CheckSpoil() function call. Obviously the nuts & bolts of the food spoilage forms has to be constracted, but what about recirsive cell entry by the player? Will this routine run again if the player leaves the cell then re-enters, or do the objects remain as-is until the cell id reset. And if the latter how long before a cell resets? Function CheckSpoil() Cell CurCell = PlayerRef.GetParentCell() If CurCell ObjectReference FoodTmp Float ChanceToSpoil = GetLocationTypeSpoilChance() Int i = iRefType.Length Int j Int k while i i -= 1 j = CurCell.GetNumRefs(iRefType[i]) While j j -= 1 FoodTmp = CurCell.GetNthRef(j, iRefType[i]) As ObjectReference If MyGoodFoodList.HasForm(FoodTmp.GetBaseObject()) If (ChanceToSpoil > 0.0 && (Utility.RandomFloat(0.0, 100.0) <= ChanceToSpoil)) ;Do whatever with the food to spoil it here. ;Just to test that it actually doing something to food in the cell. FoodTmp.SetDisplayName("Spoilt " + FoodTmp.GetDisplayName()) EndIf EndIf EndWhile EndWhile EndIf EndFunction
  6. You also created a formlist inside the CK & referenced that in the tracker script :smile: I appeciate the help. It's a steep enough learning curve without the addition burden of having to learn programming constructs & syntax. I've failed at this last hurdle though :sad: All I did was rejig the tracker script to create another formlist to contain a list of a 'foods' in a given cell. That way I could test with probability of spoil for each food item rather than a test of probability within the whole cell. I created another formlist in tracker quest ( MyFoodInCellList ) & populate this in OnCellEntrer(). I've checked my quest setup against yours but can't see where I've got wrong I'm afraid :sad: My feeble attempt HERE (9.2kb)
  7. Tracked down what may be the issue. In the CK tracker quest, under the script tab, I reference the My_FoodTracker script. In the My_FoodTracker script properties I go to edit the My_SpoilFoodStartMsg & the My_SpoilFoodEndMsg & the MyGoodFoodSetup but the object pickboxes olny have help type messages not the array of variables available in your quest setup. I CAn setup the player reference OK. {EDIT} Doh! I see you've created the messages under the miscilaneous tab in CK ...... Trying that.
  8. Sorry, my wording was poor. I can extract & run your archive script OK. I made some minor changes & tried to setup MY OWN pex, psc & bsa file-folder structure from my files basically immitating what you've done. But it doesn't work. MY scripts (3) compile OK. So I'm going back through MY quests setups & comparing to yours to see where I've made a mistake.
  9. Regarding Q2: I see you've created 2 quests. One for the tracker that references the alias & one for the MCM that references the SkiUtility script
  10. Lots of questions. I see the properties are held in the tracker script & not the MCM script. I see the OnCellChange call is now in the alias script & not the tracker script. I see you've parametised most of the varibales into arrays. I see the folder structure of the archive for the files. I see that you have a property reference to the trcaker script in the MCM script properties. Can't quite figure out the On/Off mechanism but I'm working on it. Thankyou, lots to learn here ...... Q1: You call the GetFoodFromMods function from the alias script with OnPlayerLoadGame, but the GetFoodFromMods function is also called in the tracker script OnInit event. Is this a double-call, or it that how it's best done? Q2: I created a quest & attached the 3 scripts & save & created the bsa file, but it's not working from my version. So do I need to do anthing more to the quest to make the scripts work?
  11. You probably took some of that horrible repeating code & iterated via a loop :blush:
  12. Ha! Your in the same timezone as me :smile: Let me guess, Melbourne Australia? Added properties to the bottom of the MCM code by the CK. I see I can manually edit the script within the CK as well & that the add-properties button is just a GUI to write the properties code which could be done manually too. Here's where I'm at with the Tracker script & the MCM script (I did some rationising of the repeated variables into arrays, which is probably similar to what you've done) ScriptName My_SpoilFoodTracker Extends Quest {this script is for learning Skyrim modding } bool SpoilFood = False Keyword Property LocTypeDungeon Auto Keyword Property LocTypeBanditCamp Auto Keyword Property LocTypeHagravenNest Auto Keyword Property LocTypeAnimalDen Auto Keyword Property LocTypePlayerHouse Auto Keyword Property LocTypeDraugrCrypt Auto Keyword Property LocTypeFalmerHive Auto Keyword Property LocTypeCemetary Auto Keyword Property LocTypeInn Auto Keyword Property LocUnknown Auto Keyword[] lstLocationType Int[] lstSpoilChance Event OnInit() ; TO DO: get the current player values from the quest properties? ; ??? setting lstSpoilChance[index] 0 - 9 ; SetSpoilChance() EndEvent Event OnCellLoad() ; Called when every object's 3d in this object's parent cell loaded & ready. Debug.Notification("Every object in this cell has loaded its 3d") ; chance of food spoiling at this location Actor Player = Game.GetPlayer() If (Player != None) float ChanceToSpoil = GetLocationTypeSpoilChance(Player.GetCurrentLocation()) If (GetRandomFloatBetween(0,100) <= ChanceToSpoil) SpoilFood = true SpoilFoodInCell(Player.GetParentCell()) EndIf EndIf EndEvent Function SpoilFoodInCell(Cell kCell) ObjectReference TmpPotion Int i = kCell.GetNumRefs(46) ; kPotion while (i) i -= 1 TmpPotion = kCell.GetNthRef(i, 46) As ObjectReference If TmpPotion.HasKeywordString("vendoritemfood") || TmpPotion.HasKeywordString("vendoritemfoodRaw") Debug.Notification(TmpPotion.GetDisplayName() + " is food or raw food so spoil it") ; REMOVE food item from cell TmpPotion.Disable() ; ADD spoiled food item to cell Form MySpoiltFood_POTION TmpPotion.PlaceAtMe(MySpoiltFood_POTION) EndIf EndWhile EndFunction float Function GetLocationTypeSpoilChance(Location Loc) ; return the chance for food spoilage for specified location int i = lstLocationType.Find(LocUnknown) ; default index float result = lstSpoilChance[i] ; default chance i = lstLocationType.Length ; reuse the integer while (i) i -= 1 If (Loc.HasKeyword(lstLocationType[i]) == True) return lstSpoilChance[i] EndIf endWhile return result EndFunction Function SetSpoilChance(Keyword LocationType, int n) int i = lstLocationType.Length - 1 lstLocationType[i+1] = LocationType lstSpoilChance[i+1] = n EndFunction float Function GetRandomFloatBetween(int min, int max) Global return utility.RandomFloat(min, max ) EndFunction Scriptname My_SpoiltFood_MCM extends SKI_ConfigBase ; my first MCM menu attempt ; OID's bool OID_OnOff float[] OID_Array string[] Descriptor ; values set in OnConfigInit event ; slider OID's int[] OID_Array_S ; slider defaults float default_MinValue = 0.0 float default_MaxValue = 100.0 float default_Interval = 0.5 float[] default_ChanceToSpoil ; values set in OnConfigInit event ; -------------------------------------------------- ; Script versioning ; -------------------------------------------------- Int Function GetVersion() ; SCRIPT VERSIONING return 1 ; Default version EndFunction ; -------------------------------------------------- ; Configuration ; -------------------------------------------------- Event OnConfigInit() Pages = new string[2] ; two MCM pages Pages[0] = "Settings" ; first page is settings Pages[1] = "About" ; second page is about ; OID & slider index storage OID_Array = new float[10] OID_Array_S = new int[10] ; description for each slider Descriptor = new string[10] Descriptor[0] = "dungeons" Descriptor[1] = "bandit camps" Descriptor[2] = "hagraven nests" Descriptor[3] = "animal dens" Descriptor[4] = "player home" Descriptor[5] = "draugr crypts" Descriptor[6] = "falmer hives" Descriptor[7] = "cemeteries" Descriptor[8] = "inns & taverns" Descriptor[9] = "Unknown" ; default slider values default_ChanceToSpoil[0] = 99.0 ; dungeons default_ChanceToSpoil[1] = 99.0 ; bandit camps default_ChanceToSpoil[2] = 99.0 ; hagraven nests default_ChanceToSpoil[3] = 99.0 ; animal dens default_ChanceToSpoil[4] = 0.25 ; player home default_ChanceToSpoil[5] = 99.0 ; draugr crypts default_ChanceToSpoil[6] = 99.0 ; falmer hives default_ChanceToSpoil[7] = 99.0 ; cemeteries default_ChanceToSpoil[8] = 99.0 ; inns & taverns default_ChanceToSpoil[9] = 0.0 ; Unknown EndEvent Event OnPageReset(string page) {Called when a new page is selected, including the initial empty page} If (page == "Settings") SetCursorPosition(1) ; first line first column OID_OnOff = AddToggleOption("Toggle Spoiled Food", true) ; toggle on/off SetCursorPosition(5) ; third line first column AddHeaderOption("Chance of spoilt food") SetCursorPosition(7) ; fourth line first column int i = 0 while (i <= (default_ChanceToSpoil.Length - 1)) OID_Array[i] = AddSliderOption(Descriptor[i], Q_Array[i], "{0}% chance of food spoiling") i+=1 EndWhile ElseIf (page == "About") ; About the mod SetCursorPosition(7) ; fourth line first column AddHeaderOption("Food Spoilage Mod") AddEmptyOption() AddHeaderOption("by PCAviator") Else Debug.Notification("Unhandled page in OnPageReset event " + page) EndIf EndEvent Event OnOptionSelect(Int option) {Called when a non-interactive option has been selected} ; For toggle and text selection events If (option == OID_OnOff) ; on/off OID_OnOff = !OID_OnOff Q_OnOff = !Q_OnOff Else Debug.Notification("Unhandled option in OnOptionSelect event " + option) EndIf EndEvent Event OnOptionDefault(Int option) ; user request option to be reset to its default value If (option == OID_OnOff) ; on/off OID_OnOff = Q_OnOff SetToggleOptionValue(option, OID_OnOff) Else Int i = option - 1 OID_Array[i] = Q_Array[i] SetSliderOptionValue(OID_Array_S[i], OID_Array[i], "{0}% chance of food spoiling", False) EndIf EndEvent event OnOptionHighlight(int option) ; help text at bottom of MCM mod window If (option == OID_OnOff) ; on/off SetInfoText("Turn spoilt food mod ON/OFF") Else Int i = option - 1 SetInfoText("Percent chance that food is spoilt in " + Descriptor[i] + "\nChoosing zero will turn off spoilt food for this location") EndIf endEvent ; --------------------------------- ; SLIDER control ; --------------------------------- Event OnOptionSliderOpen(int option) ; player opened a slider control in the MCM menu If (option <= (Q_Array.Length - 1)) Int i = option SetSliderDialogStartValue(Q_Array[i]) SetSliderDialogDefaultValue(default_ChanceToSpoil[i]) SetSliderDialogRange(default_MinValue, default_MaxValue) SetSliderDialogInterval(default_Interval) Else Debug.Notification("Unhandled option in OnOptionSliderOpen event " + option) EndIf EndEvent Event OnOptionSliderAccept(int option, float value) ; If (option <= Q_Array.Length - 1) Int i = option OID_Array[i] = value SetSliderOptionValue(OID_Array_S[i], OID_Array[i], "{0}% chance of food spoiling") Else Debug.Notification("Unhandled option in OnOptionSliderAccept event " + option) EndIf EndEvent ; --------------------------------------------------- ; Quest properties ; --------------------------------------------------- Bool Property Q_OnOff = TRUE Auto {Turn mod on/off} Float[] Property Q_Array Auto {Percent chance of food spoiling}
  13. OK, downloaded the skse archive & manually copied exe & dlls to Skyrim folder & data (&subfolders) to the Skyrim folder which merged with the existing data folder. I think the SpoiltFood script compiled OK. It seems to compile in notepad+ OK & in CK OK without apparent errors (see screen). So I now have the SpoiltFood script and the SpoiltFoodMCM script & I've setup just ONE generic form for spoilt food (at this stage) in CK under potions. I've create a new quest for MCM according to the tutorial & attached both the MCM script & the SpoiltFood script to the quest. Now to figure out how to package it all together...... http://i.imgur.com/V8lKh5B.jpg
  14. I very much appreciate the help to date. Perhaps the issue is in my notepad+ setup, but the MCM script I've done compiles OK but then it's not referencing SKSE. I'll have snoop around the forums & see if I've setup correctly. Again, thankyou. I've DL the skse archive. I prsume I extract to the skyrim folder & let it do it's thing with copying the exe & dlls & the various subfolders
  15. I've used the SKSE 1.7.3 installer.exe which installs into my F:\Program Files (x86)\Steam\steamapps\common\Skyrim directory.
  16. I have SKSE installed for playing the game, do I need to do anything different to have it properly referenced when I compile a script?
  17. So to store & retrieve the players setting from the MCM menu, do I use - Utility.SetINIFloat & Utility.GetINIFloat or do I need to create a custom INI, or is there another method?
  18. Thankyou (again). Here's what I have to-date. Yes, I need to do the form (or forms) depending on how to approach the 'spoilt food' object. Script doesn't compile from notepad+ though. Errors: GetNumRefs not a function; GetNthRef not a function; HasKeyword not a function. Obviously I don't have references to those functions setup properly. ScriptName My_SpoilFoodTracker Extends Quest {this script is for learning Skyrim modding } bool SpoilFood = False Keyword Property LocTypeDungeon Auto Keyword Property LocTypeBanditCamp Auto Keyword Property LocTypeHagravenNest Auto Keyword Property LocTypeAnimalDen Auto Keyword Property LocTypePlayerHouse Auto Keyword Property LocTypeDraugrCrypt Auto Keyword Property LocTypeFalmerHive Auto Keyword Property LocTypeCemetary Auto Keyword Property LocTypeInn Auto Keyword Property LocUnknown Auto Keyword[] lstLocationType Int[] lstSpoilChance Event OnInit() SetSpoilChance(LocTypeDungeon, 60) SetSpoilChance(LocTypeBanditCamp, 5) SetSpoilChance(LocTypeHagravenNest, 30) SetSpoilChance(LocTypeAnimalDen, 75) SetSpoilChance(LocTypePlayerHouse, 0) SetSpoilChance(LocTypeDraugrCrypt, 99) SetSpoilChance(LocTypeFalmerHive, 40) SetSpoilChance(LocTypeCemetary, 100) SetSpoilChance(LocTypeInn, 0) SetSpoilChance(LocUnknown, -1) EndEvent Event OnCellLoad() ; Called when every object's 3d in this object's parent cell loaded & ready. Debug.Notification("Every object in this cell has loaded its 3d") ; chance of food spoiling at this location Actor Player = Game.GetPlayer() If (Player != None) float ChanceToSpoil = GetLocationTypeSpoilChance(Player.GetCurrentLocation()) If (GetRandomFloatBetween(0,100) <= ChanceToSpoil) SpoilFood = true SpoilFoodInCell(Player.GetParentCell()) EndIf EndIf EndEvent Function SpoilFoodInCell(Cell kCell) ObjectReference TmpPotion Int i = kCell.GetNumRefs(46) ; kPotion while (i) i -= 1 TmpPotion = kCell.GetNthRef(i, 46) As ObjectReference If TmpPotion.HasKeywordString("vendoritemfood") || TmpPotion.HasKeywordString("vendoritemfoodRaw") Debug.Notification(TmpPotion.GetDisplayName() + " is food or raw food so spoil it") ; REMOVE food item from cell TmpPotion.Disable() ; ADD spoiled food item to cell Form SpoiledItem TmpPotion.PlaceAtMe(SpoiledItem) EndIf EndWhile EndFunction float Function GetLocationTypeSpoilChance(Location Loc) ; return the chance for food spoilage for specified location int i = lstLocationType.Find(LocUnknown) ; default index float result = lstSpoilChance[i] ; default chance i = lstLocationType.Length ; reuse the integer while (i) i -= 1 If (Loc.HasKeyword(lstLocationType[i]) == True) return lstSpoilChance[i] EndIf endWhile return result EndFunction Function SetSpoilChance(Keyword LocationType, int n) int i = lstLocationType.Length - 1 lstLocationType[i+1] = LocationType lstSpoilChance[i+1] = n EndFunction int Function GetRandomIntergerBetween(int min, int max) Global return utility.RandomInt(min, max ) EndFunction float Function GetRandomFloatBetween(int min, int max) Global return utility.RandomFloat(min, max ) EndFunction
  19. Once again, many thanks. here's my first attempt at MCM menu, it compiles without error but yet to figure out how to 'store' the player-selected options/values. Scriptname Template_MCM extends SKI_ConfigBase ; my first MCM menu attempt ; OID's bool OID_OnOff float OID_Dungeons float OID_BanditCamps float OID_HagravenNests float OID_AnimalDens float OID_PlayerHome float OID_DraugrCrypts float OID_FalmerHives float OID_Cemetaries float OID_InnsTaverns float QID_Unknown ; slider OID's int OID_Dungeons_S int OID_BanditCamps_S int OID_HagravenNests_S int OID_AnimalDens_S int OID_PlayerHome_S int OID_DraugrCrypts_S int OID_FalmerHives_S int OID_Cemetaries_S int OID_InnsTaverns_S ; default options values bool default_OID_OnOff = true float default_OID_Dungeons = 50.0 float default_OID_BanditCamps = 50.0 float default_OID_HagravenNests = 50.0 float default_OID_AnimalDens = 50.0 float default_OID_PlayerHome = 50.0 float default_OID_DraugrCrypts = 50.0 float default_OID_FalmerHives = 50.0 float default_OID_Cemetaries = 50.0 float default_OID_InnsTaverns = 50.0 float default_QID_Unknown = 0.0 ; slider defaults float default_MinValue = 0.0 float default_MaxValue = 100.0 float default_Interval = 0.5 ; -------------------------------------------------- ; Script versioning ; -------------------------------------------------- Int Function GetVersion() ; SCRIPT VERSIONING return 1 ; Default version EndFunction ; -------------------------------------------------- ; Configuration ; -------------------------------------------------- Event OnConfigInit() Pages = new string[2] ; two MCM pages Pages[0] = "Settings" ; first page is settings Pages[1] = "About" ; second page is about EndEvent Event OnPageReset(string page) {Called when a new page is selected, including the initial empty page} If (page == "Settings") SetCursorPosition(1) ; first line first column OID_OnOff = AddToggleOption("Toggle Spoiled Food", true) ; toggle on/off SetCursorPosition(5) ; third line first column AddHeaderOption("Chance of spoilt food") SetCursorPosition(7) ; fourth line first column OID_Dungeons = AddSliderOption("Dungeons", default_OID_Dungeons, "{0}% chance of food spoiling") OID_BanditCamps = AddSliderOption("Bandit Camps", default_OID_BanditCamps, "{0}% chance of food spoiling") OID_HagravenNests = AddSliderOption("Hagraven Nests", default_OID_HagravenNests, "{0}% chance of food spoiling") OID_AnimalDens = AddSliderOption("Animal Dens", default_OID_AnimalDens, "{0}% chance of food spoiling") OID_PlayerHome = AddSliderOption("Player Home", default_OID_PlayerHome, "{0}% chance of food spoiling") OID_DraugrCrypts = AddSliderOption("Draugr Crypts", default_OID_DraugrCrypts, "{0}% chance of food spoiling") OID_FalmerHives = AddSliderOption("Falmer Hives", default_OID_FalmerHives, "{0}% chance of food spoiling") OID_Cemetaries = AddSliderOption("Cemetaries", default_OID_Cemetaries, "{0}% chance of food spoiling") OID_InnsTaverns = AddSliderOption("Inns & Taverns", default_OID_InnsTaverns, "{0}% chance of food spoiling") QID_Unknown = default_QID_Unknown ElseIf (page == "About") ; About the mod SetCursorPosition(7) ; fourth line first column AddHeaderOption("Food Spoilage Mod") AddEmptyOption() AddHeaderOption("by PCAviator") Else Debug.Notification("Unhandled page in OnPageReset event " + page) EndIf EndEvent Event OnOptionSelect(Int option) {Called when a non-interactive option has been selected} ; For toggle and text selection events If (option == OID_OnOff) ; on/off OID_OnOff = !OID_OnOff Else Debug.Notification("Unhandled option in OnOptionSelect event " + option) EndIf EndEvent Event OnOptionDefault(Int option) ; user request option to be reset to its default value If (option == OID_OnOff) ; on/off OID_OnOff = default_OID_OnOff SetToggleOptionValue(option, OID_OnOff) ElseIf (option == OID_Dungeons) OID_Dungeons = default_OID_Dungeons SetSliderOptionValue(OID_Dungeons_S, OID_Dungeons, "{0}% chance of food spoiling", False) ElseIf (option == OID_AnimalDens) OID_AnimalDens = default_OID_AnimalDens SetSliderOptionValue(OID_AnimalDens_S, OID_AnimalDens, "{0}% chance of food spoiling", False) ElseIf (option == OID_BanditCamps) OID_BanditCamps = default_OID_BanditCamps SetSliderOptionValue(OID_BanditCamps_S, OID_BanditCamps, "{0}% chance of food spoiling", False) ElseIf (option == OID_Cemetaries) OID_Cemetaries = default_OID_Cemetaries SetSliderOptionValue(option, OID_Cemetaries, "{0}% chance of food spoiling", False) ElseIf (option == OID_DraugrCrypts) OID_DraugrCrypts = default_OID_DraugrCrypts SetSliderOptionValue(OID_DraugrCrypts_S, OID_DraugrCrypts, "{0}% chance of food spoiling", False) ElseIf (option == OID_FalmerHives) OID_FalmerHives = default_OID_FalmerHives SetSliderOptionValue(OID_FalmerHives_S, OID_FalmerHives, "{0}% chance of food spoiling", False) ElseIf (option == OID_HagravenNests) OID_HagravenNests = default_OID_HagravenNests SetSliderOptionValue(OID_HagravenNests_S, OID_HagravenNests, "{0}% chance of food spoiling", False) ElseIf (option == OID_InnsTaverns) OID_InnsTaverns = default_OID_InnsTaverns SetSliderOptionValue(OID_InnsTaverns_S, OID_InnsTaverns, "{0}% chance of food spoiling", False) ElseIf (option == OID_PlayerHome) OID_PlayerHome = default_OID_PlayerHome SetSliderOptionValue(OID_PlayerHome_S, OID_PlayerHome, "{0}% chance of food spoiling", False) Else Debug.Notification("Unhandled option in OnOptionSliderAccept event " + option) EndIf EndEvent event OnOptionHighlight(int option) ; help text at bottom of MCM mod window If (option == OID_OnOff) ; on/off SetInfoText("Turn spoilt food mod ON/OFF") ElseIf (option == OID_Dungeons) SetInfoText("Percent chance that food is spoilt in dungeons\nChoosing zero will turn off spoilt food for this location") ElseIf (option == OID_BanditCamps) SetInfoText("Percent chance that food is spoilt in bandit camps\nChoosing zero will turn off spoilt food for this location") ElseIf (option == OID_HagravenNests) SetInfoText("Percent chance that food is spoilt in hagraven nests\nChoosing zero will turn off spoilt food for this location") ElseIf (option == OID_AnimalDens) SetInfoText("Percent chance that food is spoilt in animal dens\nChoosing zero will turn off spoilt food for this location") ElseIf (option == OID_PlayerHome) SetInfoText("Percent chance that food is spoilt in the player's home\nChoosing zero will turn off spoilt food for this location") ElseIf (option == OID_DraugrCrypts) SetInfoText("Percent chance that food is spoilt in draugr crypts\nChoosing zero will turn off spoilt food for this location") ElseIf (option == OID_FalmerHives) SetInfoText("Percent chance that food is spoilt in falmer hives\nChoosing zero will turn off spoilt food for this location") ElseIf (option == OID_Cemetaries) SetInfoText("Percent chance that food is spoilt in cemetaries\nChoosing zero will turn off spoilt food for this location") ElseIf (option == OID_InnsTaverns) SetInfoText("Percent chance that food is spoilt in Inns & taverns\nChoosing zero will turn off spoilt food for this location") Else Debug.Notification("Unhandled option in OnOptionHighlight event " + option) EndIf endEvent ; --------------------------------- ; SLIDER control ; --------------------------------- Event OnOptionSliderOpen(int option) ; player opened a slider control in the MCM menu If (option == OID_Dungeons) SetSliderDialogStartValue(default_OID_Dungeons) SetSliderDialogDefaultValue(default_OID_Dungeons) SetSliderDialogRange(default_MinValue, default_MaxValue) SetSliderDialogInterval(default_Interval) ElseIf (option == OID_AnimalDens) SetSliderDialogStartValue(default_OID_AnimalDens) SetSliderDialogDefaultValue(default_OID_AnimalDens) SetSliderDialogRange(default_MinValue, default_MaxValue) SetSliderDialogInterval(default_Interval) ElseIf (option == OID_BanditCamps) SetSliderDialogStartValue(default_OID_BanditCamps) SetSliderDialogDefaultValue(default_OID_BanditCamps) SetSliderDialogRange(default_MinValue, default_MaxValue) SetSliderDialogInterval(default_Interval) ElseIf (option == OID_Cemetaries) SetSliderDialogStartValue(default_OID_Cemetaries) SetSliderDialogDefaultValue(default_OID_Cemetaries) SetSliderDialogRange(default_MinValue, default_MaxValue) SetSliderDialogInterval(default_Interval) ElseIf (option == OID_DraugrCrypts) SetSliderDialogStartValue(default_OID_DraugrCrypts) SetSliderDialogDefaultValue(default_OID_DraugrCrypts) SetSliderDialogRange(default_MinValue, default_MaxValue) SetSliderDialogInterval(default_Interval) ElseIf (option == OID_FalmerHives) SetSliderDialogStartValue(default_OID_FalmerHives) SetSliderDialogDefaultValue(default_OID_FalmerHives) SetSliderDialogRange(default_MinValue, default_MaxValue) SetSliderDialogInterval(default_Interval) ElseIf (option == OID_HagravenNests) SetSliderDialogStartValue(default_OID_HagravenNests) SetSliderDialogDefaultValue(default_OID_HagravenNests) SetSliderDialogRange(default_MinValue, default_MaxValue) SetSliderDialogInterval(default_Interval) ElseIf (option == OID_InnsTaverns) SetSliderDialogStartValue(default_OID_InnsTaverns) SetSliderDialogDefaultValue(default_OID_InnsTaverns) SetSliderDialogRange(default_MinValue, default_MaxValue) SetSliderDialogInterval(default_Interval) ElseIf (option == OID_PlayerHome) SetSliderDialogStartValue(default_OID_PlayerHome) SetSliderDialogDefaultValue(default_OID_PlayerHome) SetSliderDialogRange(default_MinValue, default_MaxValue) SetSliderDialogInterval(default_Interval) Else Debug.Notification("Unhandled option in OnOptionSliderOpen event " + option) EndIf EndEvent Event OnOptionSliderAccept(int option, float value) If (option == OID_Dungeons) OID_Dungeons = value SetSliderOptionValue(OID_Dungeons_S, OID_Dungeons, "{0}% chance of food spoiling") ElseIf (option == OID_AnimalDens) OID_AnimalDens = value SetSliderOptionValue(OID_AnimalDens_S, OID_AnimalDens, "{0}% chance of food spoiling") ElseIf (option == OID_BanditCamps) OID_BanditCamps = value SetSliderOptionValue(OID_BanditCamps_S, OID_BanditCamps, "{0}% chance of food spoiling") ElseIf (option == OID_Cemetaries) OID_Cemetaries = value SetSliderOptionValue(OID_Cemetaries_S, OID_Cemetaries, "{0}% chance of food spoiling") ElseIf (option == OID_DraugrCrypts) OID_DraugrCrypts = value SetSliderOptionValue(OID_DraugrCrypts_S, OID_DraugrCrypts, "{0}% chance of food spoiling") ElseIf (option == OID_FalmerHives) OID_FalmerHives = value SetSliderOptionValue(OID_FalmerHives_S, OID_FalmerHives, "{0}% chance of food spoiling") ElseIf (option == OID_HagravenNests) OID_HagravenNests = value SetSliderOptionValue(OID_HagravenNests_S, OID_HagravenNests, "{0}% chance of food spoiling") ElseIf (option == OID_InnsTaverns) OID_InnsTaverns = value SetSliderOptionValue(OID_InnsTaverns_S, OID_InnsTaverns, "{0}% chance of food spoiling") ElseIf (option == OID_PlayerHome) OID_PlayerHome = value SetSliderOptionValue(OID_PlayerHome_S, OID_PlayerHome, "{0}% chance of food spoiling") Else Debug.Notification("Unhandled option in OnOptionSliderAccept event " + option) EndIf EndEvent ; Slider dialog setup ;function SetSliderDialogStartValue(float value) ;function SetSliderDialogDefaultValue(float value) ;function SetSliderDialogRange(float minValue, float maxValue) ;function SetSliderDialogInterval(float value) ; slider helper functions ;Int Function AddSliderOption(string text, float value, string formatString = "{0}") ; Add ;Function SetSliderOptionValue(int option, float value, string formatString = "{0}") ; Change ; --------- End Slider controls in MCM menu -----------------
  20. Thankyou. that's the tutorial I'm doing. Added link to the tutorial to 1st post. Going though the above linked tutorial. First numpty question..... Setting up a new quest for the MCM menu.. In the reference Alias's window, & Scripts list, it says to add the SKI_PlayerLoadGameAlias script to the quest. But I don't have this script when I click the add button. Help ?
  21. Going though the above linked tutorial. First numpty question..... Setting up a new quest for the MCM menu.. In the reference Alias's window, & Scripts list, it says to add the SKI_PlayerLoadGameAlias script to the quest. But I don't have this script when I click the add button. Help ?
  22. I'm new to modding. Can someone direct me to a tutorial on making a MCM meni script, or better yet a script template to use as a base for MCM menu? {EDIT} Found a MCM tutorial HERE
  23. They're looking for voice actors over at the Lordbound expansion mod
  24. Didn't know if I had to PlaceAtMe before disabling the TmpPotion object. I presume the SpoiledItem form is created in the CK Function SpoilFoodInCell(Cell kCell) ObjectReference TmpPotion Int i = kCell.GetNumRefs(46) ; kPotion while (i) i -= 1 TmpPotion = kCell.GetNthRef(i, 46) As ObjectReference If TmpPotion.HasKeywordString("vendoritemfood") || TmpPotion.HasKeywordString("vendoritemfoodRaw") Debug.Notification(TmpPotion.GetDisplayName() + " is food or raw food so spoil it") ; Remove food item from cell TmpPotion.Disable() ; Add spoiled food item to cell Form SpoiledItem TmpPotion.PlaceAtMe(SpoiledItem) EndIf EndWhile EndFunction
×
×
  • Create New...