Jump to content

Hugo Qwerty

Member
  • Posts

    358
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Hugo Qwerty's Achievements

  1. These functions can both be called from Lua.
  2. Replace the flashing triangles with 3 variants of 1, 2 or 3 triangles: 1) You've read some of the book, but not enough to get a boost. 2) You've read enough of the book to be getting a boost, but you haven't finished reading it. 3) You've read all of the book and are getting the full boost. Something like this:
  3. No idea how to make a mod that only works for 1 player on a server. If you move all files to /client/ all players will still install them when they join the server. You might be able to do something to hide them from the foraging, e.g. lock all insects behind a new magazines, then give everyone the magazine to read - except you. I did something similar to hide all the trash items, I miss out on some xp but its worth it to not be repeatedly alerted about a completely useless item. This wouldn't hide the item though, you'd still find cockroaches in bins, & if your friends wanted to troll you by leaving insects everywhere they could.
  4. \media\lua\shared\Translate\EN\ItemName_EN.txt ItemName_EN = { ItemName_Base.Cockroach = "Fish Food", ItemName_Base.Grasshopper = "Fish Food", } \media\lua\server\Insects.lua local sm = getScriptManager() local insects = { "Base.Cockroach", "Base.Grasshopper" } for i=1, #insects do local name = insects[i] local insect = sm:getItem(name) if insect then insect:DoParam("worldStaticModel=Snackcake_SnoSpheres") insect:DoParam("icon=Snackcake_SnoSpheres") else print("Not found: " .. name) end end This works, the only things you need to change are: 1) Swap Snackcake_SnoSpheres for whatever you want. 2) Add all the insects to the insects table 3) Add more translations You may want a different translation for Grasshopper, Cockroach, & Cricket as they can be used in stick traps as well as for fishing.
  5. Items don't typically use the DisplayName value specified in the config, they use the translation - which you can find in: \media\lua\shared\Translate\EN\ItemName_EN.txt (for English) If no translation is present then the game will default to the DisplayName You can make your own translation file, just copy the format from vanilla and change it to whatever you want. You only need to include the changes, you don't need to copy the whole thing. Not sure why the icon isn't working. I know there are 4 types of 'Chips', so maybe the game gives you a random one and you got one that you hadn't overwritten? You can also modify vanilla items without overwriting them, here is an example from a mod I wrote - I've simplified it slightly (I wasn't actually modifying the Stone Axe). local sm = getScriptManager() local weaponName = "Base.AxeStone" local weapon = sm:getItem(weaponName) if weapon then weapon:setMinDamage(.5) weapon:setMaxDamage(1.25) weapon:setConditionMax(13) weapon:setConditionLowerChance(20) weapon:setDoorDamage(20) weapon:DoParam("TreeDamage=20") weapon:DoParam("CriticalChance=5") weapon:DoParam("critDmgMultiplier=2") else print("Error: unknown weapon - ", weaponName) end Available functions can be found here on the link below, you would want something like setIcon("FishFood") (I assume, I've never changed an icon in this way) https://zomboid-javadoc.com/41.78/zombie/scripting/objects/Item.html
  6. You absolutely can get 10/10 fitness & strength when starting from 0/0 - I've done it, more than once. The only thing you need to do to achieve this is very simple - don't die.
  7. I tried looking for the getTint() call that was causing the first error you mentioned, but what I found doesn't make sense - I must have found the wrong code, but none of the other matches were even close. if (Rand.Next(100) < 60 && var13 != null && var12 != null) { var13.setTint(var12.getTint()); } If var13 (local13 in the error; var13 is just the name given by a decompiler) is null, how did that code run? Code is decompiled from: /ProjectZomboid/zombie/characters/UnderwearDefinition.class Anyway, this obviously isn't impacting everyone, so maybe trying doing a clean install of Zomboid and trying again (no mods) to see if you still get this error.
  8. A simple way to achieve your goal is to play in Sandbox mode and turn down the loot levels for food items - then you'll have to cook more food (& catch rabbits or fish to get the calories you need).
  9. See line 8. Commands is local, so you it can't be accessed - so you can't overwrite anything (unless it is accessible somehow & it isn't, from what I can tell). You could try an overwrite ISOpenVehicleDoor:perform & ISCloseVehicleDoor:perform to edit the sendClientCommand calls. You might want to ask on the modders discord, someone on there might have a better solution. https://discord.com/invite/SReMnbV4V7
  10. Not something I've ever done, but I think you want ItemPickerJava rather than ItemJavaPicker. https://zomboid-javadoc.com/41.78/zombie/inventory/ItemPickerJava.html
  11. Nice. Just FYI, you can remove the: "local Introvert" line (you're not adding anything to a table called Intovert, so don't need to declare it first), also you are calling setBoredomLevel twice, so the first one will do nothing (as any change will be overwritten when you call it the 2nd time) - so you can just remove the 1st call.
  12. No errors for me with that code, although that trait doesn't exist on my end, so it won't ever do anything. I did add: local Introvert = {} You can't create Introvert.EveryTenMinutes if Introvert hasn't been defined first; not sure what type of error you would get if this was missing. Maybe try adding some print() calls, so you can see which bits of code are actually running - just print("some text here") will suffice.
  13. No change needed IMO, in fact if it were made easier I'd have to mod the game to change it back.
  14. line # 17 is causing the problem, which is probably stats:setBoredomLevel( etc. setBoredomLevel isn't a function of Stats, so that is probably the issue. https://zomboid-javadoc.com/41.78/zombie/characters/BodyDamage/BodyDamage.html#setBoredomLevel(float) You probably want something like: local bodyDamage = player:getBodyDamage() bodyDamage:setBoredomLevel(bodyDamage:getBoredomLevel() - (ZomboidGlobals.BoredomDecrease * 0.1))
  15. 'tried to call nil' just means one of the functions you are calling doesn't exist, it should also mention a number - which will tell you which line of code the problem is on.
×
×
  • Create New...