Jump to content

MrSledgeGaming

Member
  • Posts

    2
  • Joined

  • Last visited

  1. Hello, thanks to all that reply My mod requires me to edit a core function in the ISReadABook.lua file. Currently, I am doing this by overwriting the function. However, I am also trying to make the mod as compatible as possible with other mods, so if a mod also needs to update or change the files, both may cause unexpected behavior. Here is my code block require "TimedActions/ISBaseTimedAction" require "TimedActions/ISReadABook.lua" local validOverride = function(self) local vehicle = self.character:getVehicle() if vehicle and vehicle:isDriver(self.character) then --return not vehicle:isEngineRunning() <-- My edit end return self.character:getInventory():contains(self.item) and ((self.item:getNumberOfPages() > 0 and self.item:getAlreadyReadPages() <= self.item:getNumberOfPages()) or self.item:getNumberOfPages() < 0); end local finishReading = function(self) local vehicle = self.character:getVehicle() if vehicle and vehicle:isDriver(self.character) then --return not vehicle:isEngineRunning() <-- My edit getPlayer():getStats():setDrunkenness(0); <-- My edit end if self.item:getNumberOfPages() > 0 and self.item:getAlreadyReadPages() >= self.item:getNumberOfPages() then self.item:setAlreadyReadPages(self.item:getNumberOfPages()); end self.character:setReading(false); self.item:setJobDelta(0.0); if SkillBook[self.item:getSkillTrained()] then self.character:playSound("CloseBook") else self.character:playSound("CloseMagazine") end ISBaseTimedAction.stop(self); end //OVERRIDES Events.OnGameStart.Add( function() ISReadABook.isValid = validOverride ISReadABook.stop = finishReading end ) Is this the proper etiquette in ensuring that mods are compatible as possible?
  2. 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
×
×
  • Create New...