MrSledgeGaming Posted January 24 Posted January 24 (edited) Im looking into setting all pages of all skill books (regardless of mod) to X pages. I'm still pretty new to modding but I'm an experienced programmer, and saw there was something similar on the steam workshop called "read faster" (Not sure if I'm allowed to post the link). Unfortunately, the mod author didnt do the changes in the pages programmatically, so if u have other book mods, it wont change them and I was wondering if it was possible. My thoughts are: get all items from itemType "Skill Book" -> Set page # (can be just hard coded in the code or maybe mod options?) Would it be possible to update existing books or would they need to be spawned in? I would be developing this for a multiplayer server of the latest build Edited January 24 by MrSledgeGaming Quote Share this post Link to post Share on other sites More sharing options...
Spar10 Posted February 15 Posted February 15 A good place to look is the existing game code that searches and changes the 'Literature' objects. Look at the file ISLiteratureUI.lua in the "media/lua/client/ISUI' folder of the game files. Here is a snip of a function that manipulates the same data you want to change. -- Code copied from ISLiteratureUI:setLists() function function myEditSkillBooks() local skillBooks = {} local allItems = getScriptManager():getAllItems() for i=1,allItems:size() do local item = allItems:get(i-1) if item:getType() == Type.Literature then if SkillBook[item:getSkillTrained()] then -- This is a skillbook item store in structure for later table.insert(skillBooks, item) -- Can edit item here if you wish -- item:DoParam("Weight = 0.5"); end end end end -- Example of a SkillBook item --[[ item BookTailoring1 { DisplayCategory = SkillBook, NumberOfPages = 220, Weight = 0.8, Type = Literature, DisplayName = Tailoring for Beginners, Icon = Book11, SkillTrained = Tailoring, LvlSkillTrained = 1, NumLevelsTrained = 2, StaticModel = Book, WorldStaticModel = BookYellow_Ground, } --]] You would then need to have this function added to some game events to change all the data. Events.OnSpawnRegionsLoaded.Add(myEditSkillBooks) Events.OnLoad.Add(myEditSkillBooks) **Note: This function would edit/override all skill book data, possibly even new ones adds by other mods depending on load order. Quote Share this post Link to post Share on other sites More sharing options...