Jump to content

MountainSage

Member
  • Posts

    23
  • Joined

  • Last visited

Everything posted by MountainSage

  1. You may have forgotten your steam ports, alternatively it could be you have a software level firewall that is preventing the process from talking to the outside world. If this is on a server OS (Like Windows Server) then you will also need to create port rules in Windows Advanced Firewall, if this is just a workstation OS (Like Windows 7,8 or 10) then you need to make sure the process isn't being automatically blocked.
  2. MountainSage

    Maps?

    If the map has been placed in global coords by the creator at a point that would connect to or replace vanilla chunks, I imagine it would work? If you subscribed to Louisiana but launched the singleplayer game with Muldraugh as your selected map I guess that means it works then?
  3. MountainSage

    Maps?

    As I understand it Mappers are able to place their map at global coords in the game world which can either connect to the vanilla map or even replace chunks the vanilla map. If you're talking about in Multiplayer, it can be done using the servertest.ini file, but if you mean Singleplayer, I think you can still get custom maps connected. Not 100% sure how though (I haven't touched singleplayer beyond testing scripts etc) but I know in the past, you could drag the contents of map folders into one big folder in your media/maps directory and then choose that merged map as your map to use ingame in sandbox, but that might no longer be nesecary
  4. Just woke up, checked indiestone, see 2 notifications. Brybry you just made my day <3 Edit: Dear god Brybry this is bloody beautiful. Shared this in Discord with a friend of mine I've been bouncing off ideas with for a whole bunch of mods we wanted to do and this solves a lot of issues/provides framework to learn more about PZ modding. Massive thank you
  5. There is one option but how useful it is depends on what kind of player base you're looking for. Surprisingly, the folder is named based on the IP that was entered by the user to connect to your server, not the IP the server has registered with steam as. So what you can do is either get a DynDNS that resolves to your server's IP or set up a domain you own to resolve to your server's IP dynamically. Then players wanting to connect can enter the DynDNS or your domain into the "IP" field on the Server browser screen in Zomboid along with their details like Name, Account Username, Account Password etc and save this to their saved servers list. The server will show as "Server not responding" in the saved server list but if you try connect despite that, you'll connect just fine and the save folder that is created will use the domain or the dyndns you entered as it's name instead of the current IP of the server. The downside of this is that this will only work if the player knows what to enter in the IP field before hand. The server will still show as normally in the public server list with the IP it's registered as instead of your domain, meaning any users connecting through there will continue to have the save invalidation issue. So TLDR? Yes there's a workaround but you'll need to find a way to give connecting users the IP to use. If you're looking to host a server for a group of people you can easily give said info to? Not that big an issue, just hand it out in a group chat or something. If you're looking to do a public server for anyone to join? Eh...Maybe add the domain they need to connect to in the server description along with a notice to connect manually?
  6. Huzzah! Good luck with the rest of the mod!
  7. Mine were made in photoshop by a friend of mine. 32x32, 32 bit depth, png
  8. Damn, was hoping we could try figure this out but I'm all out of ideas. Might be the pictures in the end after all. Your pictures are 32x32 and 32 bit depth PNGs though so those are supposed to work I thought. Sorry I couldn't be of more help
  9. Hmm, that looks to be alright. Ok, how about this. Does this happen with all items in your mod? I notice some of the stuff in your mod item list looks like it might be clothing? I could be wrong, but as I understand it Zomboid doesn't have explicit icons for clothing but instead generates one based on stuff like colour settings off a template image it has? Again, a bit off the wall, but since it seems like your textures are set up right, being loaded AND are set right in items, it has to be something a bit unusual. Do you have any non-clothing items in your mod at the moment that we could test an icon on perhaps? If not, try this and see if the same thing happens with a really generic item /************************ITEMS************************/item MIDebugItem { Weight = 0.5, Type = Normal, DisplayName = MI Icon Debug Object, Icon = CamelbackUCP, }
  10. Hmmm, ok. Well I guess let's work down all the possibilities, we'll find the cause eventually. Ok so first up, can you take a screenshot of the contents of the textures folder inside your mod or specifically the icons for two items you linked in your first post as shown inside the folder? Maybe it's a filename thing or perhaps even a folder directory? Your textures folder is: .../ mods/YOUR_MOD_NAME/media/textures/... right? And the filenames are "Item_<name>.png" right? (Item_CamelbackUCP.png for example)
  11. Hmm... What about if the items you're testing have entries in distribution? Throwing stuff at the wall here and seeing what sticks but try this and see if it's still the same? require 'Items/SuburbsDistributions';MISprites = {}MISprites.getSprites = function()getTexture("Item_AsssaultBackpackMulticam.png");getTexture("Item_AsssaultBackpackUCP.png");getTexture("Item_CamelbackMulticam.png");getTexture("Item_CamelbackMulticamEmpty.png");getTexture("Item_CamelbackUCP.png");getTexture("Item_CamelbackUCPEmpty.png");getTexture("Item_CarryallMulticam.png");getTexture("Item_CarryallUCP.png");getTexture("Item_GhillieSuitBottom.png");getTexture("Item_GhillieSuitTop.png");getTexture("Item_HelmetACH.png");getTexture("Item_IOTVMulticam.png");getTexture("Item_IOTVUCP.png");getTexture("Item_KitbagMulticam.png");getTexture("Item_KitbagUCP.png");getTexture("Item_KnifeCaseMulticam.png");getTexture("Item_KnifeCaseUCP.png");getTexture("Item_LegHolsterMulticam.png");getTexture("Item_LegHolsterUCP.png");getTexture("Item_MICH2000HelmetMulticam.png");getTexture("Item_MICH2000HelmetUCP.png");getTexture("Item_MilitaryKnife.png");getTexture("Item_PlateCarrierMulticam.png");getTexture("Item_PlateCarrierUCP.png");getTexture("Item_SFHelmetGreen.png");getTexture("Item_SFHelmetTan.png");getTexture("Item_SharpeningStone.png");getTexture("Item_ShirtMulticam.png");getTexture("Item_ShirtUCP.png");getTexture("Item_TacticalBackpackMulticam.png");getTexture("Item_TacticalBackpackUCP.png");getTexture("Item_TacticalBootsBlack.png");getTexture("Item_TacticalBootsTan.png");getTexture("Item_TrousersMulticam.png");getTexture("Item_TrousersUCP.png");table.insert(SuburbsDistributions["all"]["shelves"].items, "MilitaryItems.CamelbackUCPFull");table.insert(SuburbsDistributions["all"]["shelves"].items, 0.0);table.insert(SuburbsDistributions["all"]["shelves"].items, "MilitaryItems.CamelbackUCPEmpty");table.insert(SuburbsDistributions["all"]["shelves"].items, 0.0);endEvents.OnPreMapLoad.Add(MISprites.getSprites);
  12. Looking around a bit more into the game's source, I can find references being made to XPBoost in the java but can't see anything at first glance that points to a way of applying a boost to a perk on a character via Lua.
  13. Ayy just incase you missed it, I think I see what your problem was. Posted possible fix for you to your topic about icons

  14. You also need to load the texture into memory which may be why you're having issues, while ones from other mods are working fine. Here's an example of doing this in my own mod. --##########--## Init ##--##########require "Items/SuburbsDistributions";--#############--## Sprites ##--#############TTBSprites = {}TTBSprites.getSprites = function() --Reading Traits getTexture("Item_TTBBasicRead.png"); getTexture("Item_TTBIntermediateRead.png"); getTexture("Item_TTBAdvancedRead.png");end--##################--## Distribution ##--################## --Reading Traits table.insert(SuburbsDistributions["all"]["shelves"].items, "TTB.BasicRead"); table.insert(SuburbsDistributions["all"]["shelves"].items, 0.3); table.insert(SuburbsDistributions["all"]["shelves"].items, "TTB.IntermediateRead"); table.insert(SuburbsDistributions["all"]["shelves"].items, 0.2); table.insert(SuburbsDistributions["all"]["shelves"].items, "TTB.AdvancedRead"); table.insert(SuburbsDistributions["all"]["shelves"].items, 0.1); table.insert(SuburbsDistributions["bookstore"]["all"].items, "TTB.BasicRead"); table.insert(SuburbsDistributions["bookstore"]["all"].items, 0.5); table.insert(SuburbsDistributions["bookstore"]["all"].items, "TTB.IntermediateRead"); table.insert(SuburbsDistributions["bookstore"]["all"].items, 0.3); table.insert(SuburbsDistributions["bookstore"]["all"].items, "TTB.AdvancedRead"); table.insert(SuburbsDistributions["bookstore"]["all"].items, 0.1); table.insert(SuburbsDistributions["Schoolbag"].items, "TTB.BasicRead"); table.insert(SuburbsDistributions["Schoolbag"].items, 1.0); table.insert(SuburbsDistributions["Schoolbag"].items, "TTB.IntermediateRead"); table.insert(SuburbsDistributions["Schoolbag"].items, 1.0); table.insert(SuburbsDistributions["Schoolbag"].items, "TTB.AdvancedRead"); table.insert(SuburbsDistributions["Schoolbag"].items, 0.5);Events.OnPreMapLoad.Add(TTBSprites.getSprites);You need to make the game add your sprites into an array that is loaded when starting a game. The reason other images from other mods are working is likely because they are already being loaded into memory by their own respective mods, so they work when your own mod tries to use the image. Try modifying the above example to work with what you need and give this a shot, the bit you're concerned with is the event at the bottom and the section handling sprites. EDIT: This goes by the way into .../media/lua/server/...
  15. So I've run into something that seems to have stumped me. I'm currently experimenting with hobby traits (Traits that add an XP boost to a perk 75%/100%/125% and a point in a perk) when added to a character post-character creation via getTraits():add(""); and I've found that if a trait is added post character creation there are some aspects of them that won't apply. One example being when First Aid is added to a character, while the trait shows up on the character, the perk level and perk xp boost remains unchanged (see below for example) I had expected that this might have been the case but needed to test to make sure before looking into how to go about adding a perk level and the boost. I have a generally decent idea on where to look for the perk level addition itself, but what I can't figure out at all is how to apply an XP boost to the perk out of character creation. Any help figuring this out would be greatly appreciated, specifically looking to find how to apply either increment the XP boost on a perk or get the current boost on it and then apply one to overwrite it.
  16. Working on an update for it now, friend of mine offered to do sprite art for the mod so going to start getting that in. Also working on some additional trait books for it, I need to start experimenting with the hobby traits to see how those are handled if added after character creation. So update will either be today or tomorrow depending on any complications I run into. I would love to get Axe Man in, it was one I was thinking about how to go about it. Maybe a certain requirement in Blade Accuracy and Maintenance and the player's favourite weapon being Axe? Will have to poke around to see what kind of information I can pull about a player via Lua and how exactly fav weapons work so it isn't unusable for SP, if that doesn't work out could always go based off requiring an axe to be equipped or something.
  17. Just finished putting together my first proper mod for Project Zomboid (The first one I made was just a minor edit to some vanilla code for some XP values). Trait Training Books http://steamcommunity.com/sharedfiles/filedetails/?id=606059733 What does it do? Trait Training Books adds a series of books to the game that can be used to learn traits in a ladder like system of progress. Currently the mod is only in initial release so at the moment there are only books in the game to handle the reading line of traits. An example of how it works in game If your character has the "illiterate" trait, they have the option of trying to find the TTB book related to the Illiterate trait, in this case named "Burch and Friends - Let's Read Together!". If the character has the illiterate trait, when they right click the book in their inventory or another container they will see an option in the context menu for "Struggle to Read". When selected, the player will start reading through the pages of the book in the same way you would read any other skill book. When completed, the Illiterate trait is removed from your character and replaced with the Slow Reader trait. But how can you read if you're illiterate? The mod uses a custom class that is based off the ISReadABook class used to read books in order to specifically handle trait books through an action that is on the surface functionally identical to reading, making use of pages and starting and stopping reading as any other literature item in the game would do. This was to work around some of the restrictions surrounding reading timed actions that would typically fail read attempts with the native read class. Balancing I'm still pretty new to modding with PZ so I wasn't able to find a way to request the server value for DayLength which was originally the idea I was thinking of to try and make a variable timer for reading so that the same mod could be used on various server or SP configurations without becoming too impractical at either extreme of DayLengths, so that's something I may try to get in when I learn more about what's availiable to me in LUA and if I can get the DayLength from the server. Until then though, this mod is specifically balanced for use on Real-Time multiplayer servers or Real-Time SP games. Reason being I designed this primarily for use on my own MP server but it can still work in SP games or other MP games as long as you're aware of some balancing issues with the books being 25, 50 and 75 pages. The books are a rare find, with a loot distribution of 0.3, 0.2 and 0.1 in Shelves, 0.5, 0.3 and 0.1 in bookstores and then 1.0, 1.0 and 0.5 inside schoolbags for the basic, intermediate and advanced books respectively. (For comparison, books in Hydrocraft have a 1.0 loot distribution) So these should be pretty rare finds, combined with how they are consumed on use it should hopefully keep things fairly balanced. Future Plans I'm hoping to tinker around with the hobby traits over the next few days and get to grips with how the game handles them on characters, once I work things out there I'm going to start looking at getting in books that can be used to learn other positive traits or remove/lessen negative traits. I also want to look into seeing if it's possible to implement some usage of the leveling and skillpoint system in the game, so that reading a book may require you have a skill point available that would be consumed when learning or removing a trait with the book. Figure out a way to adapt the time taken to read pages of these books based on the DayLength setting for the server or SP game.Credits Robert Johnson for the original ISReadABook.lua class that was used as the basis for TTB's reading class.BryBry for help in finding a way to refresh the character's info window to display the updated trait window without requiring a relog.
  18. Yup here's the relevant code section with trait learning/unlearning, checks against duplicate effects and refreshing the character info panel (Provided by Brybry) TTBLearnToRead.checkProgress = function(self) local readPercent = (self.item:getAlreadyReadPages() / self.item:getNumberOfPages()) * 100; if readPercent >= 100 then readPercent = 100; end if readPercent == 100 then -- self.character:Say("DEBUG: I have read the book!") if getPlayer():HasTrait("Illiterate") then getPlayer():getTraits():remove("Illiterate"); end if not getPlayer():HasTrait("SlowReader") then getPlayer():getTraits():add("SlowReader"); end if ISCharacterInfoWindow.instance then ISCharacterInfoWindow.instance.charScreen:loadTraits(); end end end
  19. owner: is probably defined somewhere with something like local owner = getPlayer(); Try substituting owner with getPlayer(); or defining it like that yourself in your code. Edit: I mean try this getPlayer():getTraits():remove("Obese"); Edit 2: Scratch that, I now believe owner refers to something else and is defnined internally by an Event firing off like OnPlayerUpdate so yeah, that might itself work depending by what causes it. No luck, tried it as TTBLearnToRead.checkProgress = function(self) local readPercent = (self.item:getAlreadyReadPages() / self.item:getNumberOfPages()) * 100; if readPercent >= 100 then readPercent = 100; end if readpercent == 100 then getPlayer():getTraits():remove("Illiterate"); getPlayer():getTraits():add("SlowReader"); endendBut didn't seem to work EDIT: just noticed I'm doing an if with readpercent instead of readPercent. Going to see if fixing that has any effect. EDIT 2: Ok so it appears that this is infact doing the intended behaviour HOWEVER it is not showing the update on character info? I still see the illiterate perk but am now able to read things. Edit 3: PROGRESS So the custom function is certainly working. Seems I just need to add a check to make sure it doesn't fire multiple times when reading the book. Then see if I can refreshing the characters info panel without needing to restart to see the updated traits. Edit 4: Got it, no more duplicate traits being added ayyy Now to sort this panel refresh issue. Edit 5: Panel refresh working. Thanks to Brybry helping me find the method needed to do it.
  20. This isn't the vanilla file, this is an entirely seperate class that is based off the vanilla one that is specifically these books. That's how I'm getting around the illiterate fail check. All that bit works fine. The only issue I'm running into is having the traits added or removed once the book is finished reading. It is, the game does that already with traits like Athletic/Obese and Strong xpUpdate.levelPerk = function(owner, perk, level, addBuffer) -- first Strength skill, grant you some traits that gonna help you to carry more stuff, hitting harder, etc. if perk == Perks.Strength then -- we start to remove all previous Strength related traits owner:getTraits():remove("Weak"); owner:getTraits():remove("Feeble"); owner:getTraits():remove("Stout"); owner:getTraits():remove("Strong"); -- now we add trait depending on your current lvl if level >= 0 and level <= 1 then owner:getTraits():add("Weak"); elseif level >= 2 and level <= 4 then owner:getTraits():add("Feeble"); elseif level >= 6 and level <= 8 then owner:getTraits():add("Stout"); elseif level >= 9 then owner:getTraits():add("Strong"); end end -- then Fitness skill, grant you some traits that gonna help you to run faster, recovery faster, etc.. if perk == Perks.Fitness then -- we start to remove all previous Fitness related traits owner:getTraits():remove("Obese"); owner:getTraits():remove("Overweight"); owner:getTraits():remove("Fit"); owner:getTraits():remove("Athletic"); -- now we add trait depending on your current lvl if level >= 0 and level <= 1 then owner:getTraits():add("Obese"); elseif level >= 2 and level <= 4 then owner:getTraits():add("Overweight"); elseif level >= 6 and level <= 8 then owner:getTraits():add("Fit"); elseif level >= 9 then owner:getTraits():add("Athletic"); end end -- we reset the xp multiplier for this perk-- owner:getXp():getMultiplierMap():remove(perk); -- we add a "buffer" xp, so if you just get your lvl but you're still losing xp (if you've been lazy for a moment), you won't lose your lvl at the next tick if addBuffer then-- owner:getXp():AddXP(perk, 5, false); endendAlready tried that. I tried one run of the lua file using owner: instead of self.character: like the traits for athletic/strength are handled, but that didn't seem to have an effect either. ...though that was just in my debug script. I'll try it with owner: in the book script to see if it works.
  21. So I've been working on a the skeletal beginnings of a mod to add books that manage trait training but I've ran into a problem I can't figure out. I'm pretty new to the language so a little green and I expect this is probably something really obvious that down the line I'll be hitting myself over not getting but I can't seem to modify the traits of a player on completion of a book. Specifically, I'm using my own version of the ISReadABook class based off the original so to handle a book to turn Illiterate into Slow Reader and so far everything works all the way up until the point the reading finishes. Then it just finishes reading and does nothing. Here's the class below that's being used. Does anyone have any idea why this might not be working? Side note: This is located in media/lua/client/TimedActions --**************************************************************************************--** Based off "ISReadABook" by ROBERT JOHNSON **--**************************************************************************************require "TimedActions/ISBaseTimedAction"TTBLearnToRead = ISBaseTimedAction:derive("TTBLearnToRead");TTBLearnToRead.pageTimer = 0;function TTBLearnToRead:isValid() return self.character:getInventory():contains(self.item) and ((self.item:getNumberOfPages() > 0 and self.item:getAlreadyReadPages() <= self.item:getNumberOfPages()) or self.item:getNumberOfPages() < 0);endfunction TTBLearnToRead:update() TTBLearnToRead.pageTimer = TTBLearnToRead.pageTimer + 1; self.item:setJobDelta(self:getJobDelta()); TTBLearnToRead.checkProgress(self); if self.item:getNumberOfPages() > 0 then local timeHours = getGameTime():getTimeOfDay() if timeHours < self.startTimeHours then timeHours = timeHours + 24 end local elapsedMins = (timeHours - self.startTimeHours) * 60 local pagesRead = math.floor(elapsedMins / self.minutesPerPage + 0.0001) if self.startPage + pagesRead > self.item:getAlreadyReadPages() then end self.item:setAlreadyReadPages(self.startPage + pagesRead); if self.item:getAlreadyReadPages() > self.item:getNumberOfPages() then self.item:setAlreadyReadPages(self.item:getNumberOfPages()); end self.character:setAlreadyReadPages(self.item:getFullType(), self.item:getAlreadyReadPages()) endend-- get how much % of the book we already read, then we apply a multiplier depending on the book read progressTTBLearnToRead.checkProgress = function(self) local readPercent = (self.item:getAlreadyReadPages() / self.item:getNumberOfPages()) * 100; if readPercent > 100 then readPercent = 100; self.character:getTraits():remove("Illiterate"); self.character:getTraits():add("SlowReader"); endendfunction TTBLearnToRead:start() self.item:setJobType(getText("ContextMenu_Read") ..' '.. self.item:getName()); self.item:setJobDelta(0.0); self.startTimeHours = getGameTime():getTimeOfDay()endfunction TTBLearnToRead:stop() ISBaseTimedAction.stop(self); if self.item:getNumberOfPages() > 0 and self.item:getAlreadyReadPages() >= self.item:getNumberOfPages() then self.item:setAlreadyReadPages(self.item:getNumberOfPages()); end self.item:setJobDelta(0.0);endfunction TTBLearnToRead:perform() self.item:getContainer():setDrawDirty(true); self.item:setJobDelta(0.0); if self.item:getAlreadyReadPages() >= self.item:getNumberOfPages() then self.item:setAlreadyReadPages(0); end ISBaseTimedAction.perform(self);endfunction TTBLearnToRead:new(character, item, time) local o = {} setmetatable(o, self) self.__index = self o.character = character; o.item = item; o.stopOnWalk = true; o.stopOnRun = true; if item:getNumberOfPages() > 0 then item:setAlreadyReadPages(character:getAlreadyReadPages(item:getFullType())) if isClient() then o.minutesPerPage = ServerOptions.getFloat("MinutesPerPage") or 1.0 if o.minutesPerPage < 0.0 then o.minutesPerPage = 1.0 end else o.minutesPerPage = 2.0 end o.startPage = item:getAlreadyReadPages() local f = 1 / getGameTime():getMinutesPerDay() / 2 time = (item:getNumberOfPages() - item:getAlreadyReadPages()) * o.minutesPerPage / f time = time + o.minutesPerPage / f -- go over the time a little so the last page is read end TTBLearnToRead.pageTimer = 0; o.ignoreHandsWounds = true; o.maxTime = time; return o;end
×
×
  • Create New...