#mod_development

1 messages ยท Page 46 of 1

weak sierra
#

usually ppl just.. dont accept friend requests and/or hide profile

civic lava
#

would'nt "unlisted" just make its safe, its for friends or solo

weak sierra
#

maybe mostly

civic lava
#

maybe i misunderstand

weak sierra
#

they want the mod public but dont want ppl tracking them down to bother them

#

prob

astral dune
#

pretty much

weak sierra
#

u'd have to really hit it off big to get much attention tho

blazing radish
#

you cna upload private mods tho, you don't need to release stuff "public" if you don't want to

bronze yoke
#

yeah your mod would have to be massive for it to become a nuisance

blazing radish
#

you can set the privacy to your friendlist or unlisted

#

or private and give permission to specific users as co-creators, so only them can see the mod

astral dune
#

not trying to hide the mod, just trying to keep from tying my personal life to anything public on the internet

hearty dew
#

Hence the name ๐Ÿ™‚

astral dune
#

haha, exactly

#

@hearty dew I'm having some trouble with the code we were working on. If you remember this guy: (moved it down a few posts so I could post it with proper code highlighting)

#

anyway, I've used it like so:

CPU.interceptEventHandlerRegistration("OnClientCommand", function(originalEventHandler, module, command, player, args)
    if module == "vehicle" and command == "crash" then
        RDWRER.Utils.printToCar("Crash Detected", args.vehicle)
        print("Crash Detected")
    end
    local result = originalEventHandler(module, command, player, args)
    -- post-stuff
    return result
end)
#

problem is, my printToCar function you see there is somehow called 7x every car crash, once for each time OnClientCommand.Add was called during initialization

#

I don't get what's going on

bronze yoke
#

you added it seven times, so it runs seven times, right?

astral dune
#

seven different commands were registered, checking the module and command should filter out the other ones, but its not.... I think you're right though, I'm just struggling to figure out exactly where this falls down

bronze yoke
#

i think you've gone too deep and confused yourself

#

every OnClientCommand listens for every command, it doesn't matter if you check for the module and command, because all seven of your callbacks are doing that every time

astral dune
#

thats right... so I have to tag the correct eventhandler somehow

#

or prevent the other ones from getting wrapped in the first place.. that's probably the better plan

#

may not be possible, as Event.Add is just passed what is typically a local or anonymous function, I don't think I have any way of knowing for sure which eventhandler is being passed at that point. Crap

bronze yoke
#

hmm, well...

#

is the file you're trying to hook in the client folder?

#

wait...

#

no of course it isn't lol

astral dune
#

VehicleCommands is my target. Its in the server folder, so I can run the interception in Shared to get ahead of it

bronze yoke
#

if you make sure your file loads last in shared, then keep an iterator and only hook the xth one, since vanilla always loads first and in the same order

#

it's a little prone to being broken by updates but it would at least work

astral dune
#

ya, its brittle but may be the best option

upper wigeon
#

Hey guys, just curious if anyone has tried to mod the default plumbing system at all? I haven't seen any mods that change it at all and I'm wondering if it's a limitation or just not enough interest. Might try and learn lua just to make it myself lol

bronze yoke
#

like plumbing taps to water barrels? that's pretty much all lua, i've been working around it recently

fast galleon
#

There's a mod with pipes, irrigation for farming.

true vault
#

aniThonk is there a known upper limit for the time specified for recipes?

#

(search turned up nothing)

upper wigeon
#

Yeah specifically to plumb between 2 stories, I tried plumbing to a bathtub but it resets itself every time I load the save

#

I'd love to make a mod so that if you put a rain barrel on a roof you can just plumb it to the whole house, or maybe build a water pump that requires electricity

bronze yoke
#

plumbing is basically just a timedaction and a clientcommand

true vault
#

Can you elaborate on this?

bronze yoke
#

hmm... although it looks like the specifics of tying a water source to a tap is java, but i don't know if it'd really be too difficult to replace that system with a lua one

true vault
#

(sidenote: recipe is successfully using a time of 19200, so there might be an upper limit, but it's pretty heckin high :3 )

upper wigeon
#

I'm not super familiar with lua but do you think it would be possible to start by editing code for the generator and simply change it to provide water instead of electricity?

bronze yoke
#

unfortunately the generator is heavily java

#

i might do something like that for water goes bad... but i really should just finish off water filters first lol

upper wigeon
#

Hmm well thanks for the help guys, I should probably do some more research. Just trying to figure out where to start learning

hearty dew
astral dune
#

ya, they're commands, which is why we were trying to intercept the OnClientCommand handler, but that isn't going to work as its currently implemented

#

I wonder if I could force the file to load immediately after I turn on the intercept, then turn it off again

#

I'm not sure how require works but it may

#

currently looking to see if there is any way to get information out of a passed function, like its name or signature. Tried to use getfenv to see if the local vars were in there but I guess it doesn't work like that

hearty dew
astral dune
#

require "VehicleCommands" would be the correct syntax if it worked, right?

hearty dew
#

Could start intercepting event registration late in shared/ loading and stop it early in server/ loading.. Maybe there's a better way though

bronze yoke
#

that was my suggestion, seems like the easiest way of doing things

hearty dew
astral dune
#

just trying to find something less brittle before going that route. If anyone manages to sneak a file in after mine or if the vanilla code changes it would break

bronze yoke
#

to be fair, the chance that someone puts a file that loads after yours and also registers OnClientCommand in shared is pretty low

#

and vanilla b41 probably won't have a major enough change to break it ever

astral dune
#

ya, looks like its my only option, Tyrir was correct that requiring a server file out of sync doesn't seem to work

hearty dew
#
VehicleCommands.OnClientCommand = function(module, command, player, args)
    if module == 'vehicle' and Commands[command] then
        local argStr = ''
        args = args or {}
        for k,v in pairs(args) do
            argStr = argStr..' '..k..'='..tostring(v)
        end
        noise('received '..module..' '..command..' '..tostring(player)..argStr)
        Commands[command](player, args)
    end
end

Events.OnClientCommand.Add(VehicleCommands.OnClientCommand)

This is the function of interest, right?

astral dune
#

yes, there are two different commands that pass through that function that I want to intercept

astral dune
#

sad face

LOG  : General     , 1667626057773> 4,592,748> Trying to force load vehicle commands
WARN : Lua         , 1667626057774> 4,592,748> LuaManager$GlobalObject.require> require("Vehicles/VehicleCommands") failed
hearty dew
#

Trying to work out a safe way to determine whether the decorated event handler is the event handler of interest..

#

Might be able to inject a parameter to test that

#

Think you could. Going to be kind of messy/hacky, but hopefully less brittle

#
-- So we can try to call this with our own player object and getVehicle
-- implementation in order to check if this is the right event handler
function Commands.setStoplightsOn(player, args)
    local vehicle = player:getVehicle()
    if vehicle then
        vehicle:setStoplightsOn(args.on)
    else
        noise('player not in vehicle')
    end
end
CPU.interceptEventHandlerRegistration("OnClientCommand", function(originalEventHandler, module, command, player, args)
    if module == "vehicle" and command == "crash" then
        RDWRER.Utils.printToCar("Crash Detected", args.vehicle)
        print("Crash Detected")
    end
    local result = originalEventHandler(module, command, player, args)
    -- post-stuff
    return result
end, function(originalEventHandler)
  local shouldDecorate = false
  local player = {
    getVehicle = function()
        shouldDecorate = true
    end
  }

  originalEventHandler("vehicle", "setStoplightsOn", player)
  return shouldDecorate
end)
    CPU.interceptEventHandlerRegistration = function(eventName, eventHandlerDecorator, shouldDecorateEventHandler)
    -- ..... [clip]
    Events[eventName].Add = function(eventHandler)
        if not shouldDecorateEventHandler or shouldDecorateEventHandler(eventHandler) then
            local newEventHandler = function(...)
                return eventHandlerDecorator(eventHandler, ...)
            end
            -- Use the original Add function to add the new wrapped handler
            local result = originalAdd(newEventHandler)
            CPU.RegisteredEventHandlers[eventName] = CPU.RegisteredEventHandlers[eventName] or {}
            CPU.RegisteredEventHandlers[eventName][tostring(eventHandler)] = newEventHandler
            return result
        else
            return originalAdd(eventHandler)
        end
    end
    -- ... [clip]
#

That approach might work. Would be a lot easier if we had debug to figure out what event handler we have before decorating it

#

This approach would only be brittle to a change in the Commands.setStoplightsOn function

astral dune
#

trying my best to understand what this is doing

#

oh I see, you're closuring shouldDecorate in a fake getVehicle function and trying to bait the event handler into calling it

#

I would never think of these things

hearty dew
#

Instead of simply registering the wrapped event handler, it calls a function shouldDecorateEventHandler to determine whether to Add the decorated version or the original. The implementation of shouldDecorateEventHandler above calls the original event handler with a stubbed player object to check if it is the event handler of interest. If it is the one we want, the setStoplightsOn command will interact with the stubbed player object in a known way, which the stubbed player object records by setting the local variable shouldDecorate to true.

hearty dew
#

Ping me if there are any issues with it. I can't test it atm, so probably has some problems

astral dune
#

it makes sense. SetStoplightsOn will fail silently because it checks if a vehicle is returned, which there won't be. Other event handlers should ignore it entirely since they don't handle vehicle commands. Potentially another mod could cause a problem with it, but its quite unlikely

#

and you've managed to still make it generic enough to work with other things. impressive as always

hearty dew
#

Right. Also, if that doesn't work, you can put a counter inside shouldDecorateEventHandler to register the nth event handler, like albion suggested

astral dune
#
LOG  : General     , 1667628284856> 6,819,831> CPU.interceptEventHandlerRegistration: Events.OnClientCommand.Add(closure 0x1017050857) called
LOG  : General     , 1667628284857> 6,819,832> VehicleCommands: received vehicle setStoplightsOn table 0x1021311233
LOG  : General     , 1667628284858> 6,819,832> VehicleCommands: player not in vehicle
LOG  : General     , 1667628284858> 6,819,832> Found the correct event handler, decorating
#

๐Ÿฅฒ

#

Thank you for your help again, you too albion

true vault
#

Finally released that money mod I was in here with earlier ^-^

Huge thanks @bronze yoke for that assist ^-^ โ™ก
(hope you don't mind I listed you in the credits and linked to your steam profile >.>)

bronze yoke
#

oh thank you very much ^u^

true vault
#

๐Ÿ’– no no, thank you hun. Helped me out alot there lmao

#

Seems simple, but half the mod wouldn't be possible without that nudge to modData haha

fast galleon
#

sigh, building cheat was reenabled and I was adding the plank to my inventory

#

*plank Barricade cursor works

neon bronze
#

Anyone knows how you can save a changed table so that it stays the same the next time you log in?

civic lava
#

how do i get my trait to show up inside the character creation menu?

#

i want to mod the game for fun quickly, not 100% learn lua, it would be appreciated if the answer was simplified to something alone the lines of
_
"Event.OnPlayerCreation(local Get:TraitFactory.Trait())
local badteeth = TraitFactory.addTrait...... ex

#

_
is it required to learn lua. & not just get random free answers to specific questions, if thats a frowned upon thing here ill just go learn lua & read 10,000 lines of stuff i hardly need to know for what im trying to do (i know the basics)

azure edge
#

goodmorning any expert out that can suggest a mod to craft fridge and other stuff???? also i played at a server and to craft more things u used to get magazines that u read 1 time from zombies any mod like that maybe????

civic lava
visual island
#

I want to know the specific meanings of the arguments of mod weapons. Is there a document or tutorial or sth?๐Ÿ‘€

dusk sonnet
thick karma
#

Hey y'all, in this game, if collapse is assumed not to mean "close", what do you think someone would mean by saying "make the inventory collapse"?

thick karma
#

Hm?

fast galleon
#

hides everything except the title

thick karma
#

So if I pin it and then toggle hiding it does that?

#

I clicked pin earlier but didn't toggle so I didn't catch that behavior

#

I figured it would just keep it when I hit i

fast galleon
#

it takes some time unfocused

thick karma
#

I'll click pin and see what happens.

fast galleon
#

I hover over inventory, it opens, then after some time closes

thick karma
#

Ohhhh

#

Okay I'll try it

#

I seeeeeeeeeeeeee

lucid wagon
#

I made them, I just don't have a Rust texture which I link to an empty image, so it still has a texture

#

I have them correctly, I've checked several times

opal rivet
#

Okay that's good

lucid wagon
#

how can I post code lines here?

dusk sonnet
#

```lua -- code here ```

ruby urchin
tardy wren
#

Anyone know what the difference is between getLvlSkillTrained and getNumLevelsTrained?

fast galleon
tardy wren
#

Oh, sorry. Should've specified, these in the Literature class

fast galleon
#

the lvlSkillTrained is also used for the tooltip bookname

lucid wagon
#

This is what I have. Base textures are showing good, Mask is working and Lights too, but not showing any damage or blood.

fast galleon
#

vanilla books have all numLevelsTrained as 2

tardy wren
#

I see...

#

what would getLvlSkillTrained return if called on book one?

fast galleon
#

1

#

you can look in scripts all those values

#

lvlSkillTrained 0
numLevelsTrained 11

tardy wren
#

wait, 0 is a valid value?

fast galleon
#

start from 0 so that to change tooltip bookname

tardy wren
#

oh

#

it says from levels 0-10?

fast galleon
#

as long as it's not -1 I think

fast galleon
tardy wren
#

anyway... Vanilla books would return 1,3,5,7,9 in that order, right?

tardy wren
#

Now, about skills

#

getXpForLevel returns how much XP is needed in total to reach the next level from the specified level, right?

#

Whereas
getTotalXpForLevel would give like... A sum of all the costs from levels 1 to specified?

thick karma
#

Anyone happen to know the command that the game uses to collapse and expand your inventory/loot when you have them pinned and your mouse focus changes?

tardy wren
sick ridge
#

How to change a value of a vanilla item?

lucid wagon
# lucid wagon

I've been trying out my mod now and still doesn't show the blood and damage textures on it

steep copper
#

Hi, i try to understand the utility and the use of ComboItem Type.. I'm unable to get their name or other through lua

lucid wagon
#

I've tried to put the Blood texture as Rust texture and isn't showing either

lyric bolt
#

Hey I am trying to make a patch for fallout weapons and arsenal attachments, if I understand correctly, itemtweaker allows me to do this?

imports 
{
  Base
}
item Base.Launcher                                
{                                                
MountOn =     MCX_Spear; MCX_Virtus; MCX_VirtusPatrol; MCX_Socom;                        
        M16A1;  M16A2; M16A3; M4; M4A1; Bush_AR15_MOE; Bush_XM15; Bush_XM15_Custom;                        
        SCARL; SCARH; SCAR20; G28; H416; MK18; M723; XM117;                        
        LVOA_C; ColtM16; M16Tape; M16Wood;                        
        K2_1; K2_203; K2C1_PH; K1DEV; K2_C1; DR_200;
                newWeaponToMountOn1; newWeaponToMountOn2,                        
                                
}

and have that just change the list of allowed weapons for the attachment right?

#

Also, how do I add required mods? (to make sure itemtweaker is loaded first)

true vault
bronze yoke
#

itemtweaker doesn't go through scripts

#
if getActivatedMods():contains("ItemTweakerAPI") then
require("ItemTweaker_Core");
else return end

TweakItem("Base.Needle","Icon", "Worm");
TweakItem("Base.Needle","Tooltip", "Wearable: Waist");
TweakItem("Base.Needle","DisplayCategory", "Repair");
#

using item tweaker is not so popular anymore though

#

it causes a ridiculous amount of startup lag

dusky breach
#

i dont know how to code in any way shape or form

ancient grail
ancient grail
ruby urchin
#

custom sqlite trigger

local SQLite = require 'SQLite';
--///////// JUST FOR TESTING /////////

local onKeyStartPressed = function(key)
    local source = getPlayer(); if not source then return end

    if key == Keyboard.KEY_NUMPAD0 then
        local result = SQLite.execute("SELECT * FROM whitelist;");
        print(result)

        for k,v in pairs(result) do
            print(k)
            print(v)
        end
    end
end

Events.OnKeyStartPressed.Add(onKeyStartPressed);
ancient grail
thick karma
#

@undone elbow I'm sorry to bother you again, but I was curious if you could help me solve something about your mod...

When I call :set(false) on a boolean Mod Options option object (e.g., modSettings:getData("closeMenusByAiming"):set(false)) while I am in the Options menu, it toggles that object to false. So, e.g., if I fire that during the onUpdate of a different object, I can make one box's state change as soon as I click another. That's working perfectly.

However, let's say Options is closed, I'm in-game, and I use the debug console to get a reference to that same boolean data object (and modSettings is visible). Now I try to use :set(false), but nothing happens. I'm guessing you have a better idea why nothing happens than I do, since you made Mod Options. Is there a way to set and apply a setting change when the Options window is closed? And, if not, is there any way you could add a function, perhaps :update or :forceSet, that works even when you're not in the Main Menu, as an alternative to setting before applying? I want to be able to force apply a setting change in my mod while the Main Menu is not visible (this would be something only admins can do... I already know how to limit the privilege, I just need a function that works when the client fires it...)

weak sierra
#

it seems ur not picking a database, so are u sandboxed into just the main db?

true vault
#

Does Kahlua not support the # operator to get the element count of an array?

local newarr = {
  "one",
  "two",
  "three",
}
return (#newarr)

Should return 3, for example

local randint = ZombRand(#newarr)
return randint

Should then return 0, 1, or 2 following the same logic.. (obv assuming you didn't actually return #newarr in the first place, and assigned it instead as a var)

fast galleon
#

oh wait

true vault
#

Nah, just a local array in Lua; for selecting an item randomly from a pre-defined array

fast galleon
#

your example should work?

true vault
#

hmm... well, unfotunately it isn't working. I'm actually helping @dusk saddle with a project they're working on. That's basically the code I wrote earlier yesterday for them, that I thought would work, but it's throwing an error for them.

dusk saddle
#

Aye, I can supply some pics of the code if you need 'em

true vault
#

However, line 240 is simply local roll = ZombRand(#FNAList)

#

So like... am stumped... Because I'm using almost identical code myself for something else in one of my mods lolz

fast galleon
#

what's the error

true vault
#

this @dusk saddle

dusk saddle
#

That's the error as far as I'm aware, I'll relaunch and see if anything more comes up

true vault
#

Actually, yeah. Re-launch and send me your console.log and I'll grab the error from it >.>

#
STACK TRACE
-----------------------------------------
function: PIFNAFRandSelect -- file: PompsRecipeLua.lua line # 240 | MOD: Pomp's Items
Callframe at: PerformMakeItem
function: perform -- file: ISCraftAction.lua line # 58 | Vanilla

LOG  : General     , 1667671295319> __len not defined for operand
LOG  : General     , 1667671295379> creating new sourcewindow: C:/Users/Gavin/Zomboid/mods/PompsItems/media/lua/server/PompsRecipeLua.lua
ERROR: General     , 1667671299620> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: __len not defined for operand at KahluaUtil.fail line:82.
ERROR: General     , 1667671299621> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: __len not defined for operand

So... maybe that operator isn't supported?

fast galleon
#

probably not a table

ruby urchin
lucid wagon
fast galleon
true vault
astral dune
weak sierra
#

am entirely unfamiliar with all of these

#

someone told me it was sandboxed such taht i could not open the file

#

via external library

#

and they are a skilled coder so i beieved them

#

and just dismissed the idea of accessing it from lua out of hand

#

:|

weak sierra
#

it lets u do so much fancy shit

#

only deletions tho

#

all deletions except "mods.txt" creation

#

still thanks for turning me on to that function could be useful

#

dont know if deleting the vehicles.db will help with accessing it tho heh

trail lotus
#

anyone want a super extensive project? would pay some good dollars for it....

#

we are talking cold hard cash

#

idea is simple, drill oil, put it in barrels, then take it some where to refine to either diesel or petrol (gas) cuz im merican, but then gas of refined oil could be used to fill up gas stations. whether its diesel or gas. also the gas stations would need to show quantity of fuel available. if we could make it work with our custom build store mod it would be even cooler cause then players could buy and sell gas essentially as well as cars could buy gas from gas stations... this is for a larger rp server.

harsh kindle
#

Does the base game support towing a vehicle that has a trailer being towed? Or even a vehicle towing a smaller vehicle? If not, is this a game engine limitation or something, or can this be done via mods ๐Ÿ‘€

bronze yoke
#

you can tow a vehicle, but i don't think you can tow something that is towing something else

dusk sonnet
#

You cannot daisy chain

bronze yoke
#

my guess is that if you force the game to do that with mods the physics go insane, otherwise they'd just let us do it anyway

undone elbow
restive spoke
#

woops I posted that in the wrong discussion board, my bad

thick karma
#

If you COULD add this feature, you would be my damn hero, because it would solve a major issue for me

#

No pressure

#

I know how much work modding is ๐Ÿ˜›

undone elbow
#

I think such a popup should be a part of ModOptions. This will be honest if someone else wants to push new options from the server. I should think about it to make a neat concept.

thick karma
#

That would be Much Better

#

But I didn't want to put that work on you haha

restive spoke
#

Hey I asked this on Steam but nobody seems to know of one. Maybe some of you do. I'm looking for a mod that makes wound infections dangerous. The only two I have found aren't really what I'm looking for. One inadvertantly gets rid of corpse sickness (otherwise it would be perfect), the other actually makes you take damage for applying dirty bandages to wounds (which is really crappy for injuries that bleed so much your bandages dirty in a second, basically becomes a death sentence).

I just want something to make it to where you actually have to maintain your wounds properly or you could potentially die from a wound infection. To bring that risk, which should be much greater than it is. Does anyone know of a mod that does this?

thick karma
#

But yes, no doubt, having it be part of Mod Options would be amazing

#

Also, if you ever feel like allowing us to add our own mod page as an option, I have no doubt many would love that feature. Not sure how hard that would be

#

But that is more an aesthetics and QoL thing

#

Function is my main priority here tbh

undone elbow
#

No problems. I like the idea. And I just need to find time to implement it.

astral dune
restive spoke
thick karma
restive spoke
#

The other one I looked at was deadly infections, but sadly from the comments, it also has a side effect of removing corpse sickness

thick karma
#

I can possibly help with that part

astral dune
#

I don't recall taking immediate damage from adding a dirty bandage to a wound, but I suppose its possible

bronze yoke
#

disinfect or die seems a bit overtuned in general

restive spoke
#

Yeah, from the comments (and many state this): When you get a bleeding injury in the neck, which drops your health extremely quick, and you don't manage to get a bandage on right away, this mod pretty much sentences you to death. The bandage will get dirty, which means the mod will make you take damage just for wearing a dirty bandage.

#

that is why I passed it over

bronze yoke
#

it damages you pretty fast and often it damages you before the wound even shows up as infected

#

i'm not sure of the exact reasoning for that, i've never looked at the code, but it's frustrating to be taking constant damage with no indication of why

restive spoke
#

Also the deadly infections mod is having issues where people get a small cut,bandage it, and die after sleeping ๐Ÿ˜‚ Yeaaah just a bit overtuned on that too. Something that gives you a reasonable chance to actually care for the wound would be nice lol

astral dune
#

iirc there is a setting for how much damage you take, but if its not your jam then that's fine.

bronze yoke
#

i should make something like it myself sometime but i've got so many things to do

restive spoke
#

It seems like something super niche, when I search for infection or wound infection, most of the mods relate to zombification

#

I guess most of us aren't wanting to punish ourselves even more ๐Ÿ˜‚

undone elbow
thick karma
hearty dew
#

@ruby urchin Do those sql apis work server-side? I was messing with them awhile back, and I never could find a way to get them to function server-side (because the java code did a check to determine if the client is admin, if I'm remembering correctly)

ruby urchin
#

Oh, will be a problem if the client need be a admin

astral dune
#

lol, "something". Apparently zeds also attack your trunk lid, trunk and hood when attempting to get into the vehicle. But nothing else

#

hmm, but the damage is only client side? I let the zombies destroy everything they could get to (aside from the windows), then removed them. Went out and smacked the o% trunk only for it to go back up to 95%. Odd

#

I've noticed this with the windows as well, actually. If I stop a window from being broken on the server, it still breaks noiselessly on the client, and a zombie can still "bite" you through the schrodinger's window. Get out and hit it yourself and it reappears

quasi geode
astral dune
#

right now I'm trying to put together a event system that allows me and potentially other modders to see what damage is happening to a vehicle, from what source, how much, which parts, etc. Its pretty challenging with this kind of desync existing in the vanilla code

blazing radish
#

I've just noticed that some recipes that creates "food" items gives cooking exp without the "OnGiveXP" function in the script at all

hearty dew
#

If those things are occurring client-side, it's reasonable to capture those events client-side, and then through client/server commands send the events to where they need to be (on the server, possibly on other clients)

blazing radish
#

it's a bug?

blissful salmon
#

I have a "hopefully" smal issue. I created an item:

  item FishGuts
    {
      DisplayCategory = Material,
        Weight = 4.0,
        Type = Drainable,
        UseWhileEquipped = FALSE,
    UseDelta = 0.05,
        DisplayName = Fish Guts,
        Icon = FishBone,
        ConsolidateOption = ContextMenu_Merge,
        SurvivalGear = TRUE,
        WorldStaticModel = FishBone,
    }
```
which I want do get when a fish is cut in to filets... So I hooked into
```function SoulMod.Recipe.OnCreate.CutFish(items, result, player)```
This works so far but my guts are always weight 4.0. I want to set them only as a percentage of the whole value... so if the stack is full. 4 is ok. But I ohly have for example 0.4 it should be only 0.4 (kg?)
I created my item as follows:
```
...
    local gutsItem = InventoryItemFactory.CreateItem("SoulMod.FishGuts", restGutsDelta)
    player:getInventory():AddItem(gutsItem)
```
Even is my "restGutsDelta" is wrong calculated. It should not have a weight of 4. So assume my idea of using CreateItem with my delta parameter does not what I expected. Do I have to create an item without this delta parameter and then do what?
I admit that I just don't have the energy to look into the java code atm. Hopefully someone know how to do this...
My idea based on the javadoc InventoryItemFactory:
```public static InventoryItem CreateItem(String itemType, float useDelta)```
#

I hope I wrote an understandable text. ๐Ÿ™‚

blazing radish
hearty dew
#
-- Default function to award XP when using a recipe.
function Recipe.OnGiveXP.Default(recipe, ingredients, result, player)
    for i=1,ingredients:size() do
        if ingredients:get(i-1):getType() == "Plank" or ingredients:get(i-1):getType() == "Log" then
            player:getXp():AddXP(Perks.Woodwork, 1)
        end
    end
    if instanceof(result, "Food") then
        player:getXp():AddXP(Perks.Cooking, 3)
    elseif result:getType() == "Plank" then
        player:getXp():AddXP(Perks.Woodwork, 3)
    end
end
#

It has a default implementation apparently

hearty dew
deep herald
#

I'm checking how to add a custom recipe. Basically it's a pot of soup with the same ingredients I always use. Is it possible by adding a custom recipe txt file? I've taken this as an example:
`recipe Make Cake Batter
{
keep Spatula/[Recipe.GetItemTypes.Spoon]/[Recipe.GetItemTypes.Fork],
Bowl,
[Recipe.GetItemTypes.Flour]=2,
[Recipe.GetItemTypes.BakingFat];15,
[Recipe.GetItemTypes.Sugar];10,
[Recipe.GetItemTypes.Egg]=2,
Yeast,
[Recipe.GetItemTypes.Milk];5,

   Result:CakeBatter,
   NeedToBeLearn:true,
   Time:50.0,
   Category:Cooking,
   OnGiveXP:Recipe.OnGiveXP.Cooking10,
   OnTest:Recipe.OnTest.WholeEgg,
}` and I see how to add the items to the recipe, but I'm unsure about the result. If I set the result to PotOfSoup won't I receive a "bare" pot? Am I correct in my assumption that I also need to add a new "target" item as the result?
#

(also, why some items have [type];qty and some have [type]=qty?

blissful salmon
rancid solstice
#

Does anyone know where I can find the sunflower vase in the scripts? Unfortunately, it is not at Moveables / NewMovables. Thank you!

blissful salmon
hearty dew
#

Remind me please.. In vanilla, when an item is partially used, does its weight normally reduce to a fraction of it's remaining use? (e.g. a Thread drops from 0.1 weight to 0.05 when it is 50% used)?

#

Or is this a feature you want to add?

blissful salmon
#

The bar is like expected on 2/5 but the weight is still 4.0. I don't read this wrong or do I?

blissful salmon
#

Hmm... maybe I'm wrong... The thread is always 0.1 but I'll check the pot of water...

hearty dew
blissful salmon
#

This is what I tried to achieve:

hearty dew
#

Oh, hmm.. Maybe fluid containers function a bit differently. I'd have to check

blissful salmon
#

Maybe I just based on the wrong item.

hearty dew
#

Hopefully can leverage whatever water containers do to adjust their weight

blissful salmon
#

I used the thread as template...

hearty dew
#

Mm

#
    item WaterPot
    {
        DisplayName = Cooking Pot with Water,
        DisplayCategory = Water,
        Type = Drainable,
        Weight = 3,
        Icon = Pot_Water,
        CanStoreWater = TRUE,
        EatType = Pot,
        FillFromDispenserSound = GetWaterFromDispenserMetalBig,
        FillFromTapSound = GetWaterFromTapMetalBig,
        IsCookable = TRUE,
        IsWaterSource = TRUE,
        RainFactor = 1,
        ReplaceOnDeplete = Pot,
        ReplaceOnUseOn = WaterSource-WaterPot,
        Tooltip = Tooltip_item_RainFromGround,
        UseDelta = 0.04,
        UseWhileEquipped = FALSE,
        StaticModel = CookingPot,
        WorldStaticModel = CookingPotWater_Ground,
    }
blissful salmon
#

I also opend this in my editor. But I don't get what makes it to scaling the weight...

hearty dew
#

I'd guess some of the fluid filling functions do something to adjust the weight

blissful salmon
#

I think I have no choice then checking the java code... but I'm to fatigue today... I'll check it tomorrow...

blissful salmon
#

I can also generate the guts in items of 0.1 weight and then use them further... But I want to cook them anyway in to fishoil and then I'm on the same problem like now ๐Ÿ˜„

#

But I know if you don't know then it isn't something that everbody knows...

hearty dew
#
        self.itemTo:setUsedDelta(self.itemToEndingDelta);
        self.itemTo:updateWeight();
#

That's from ISTransferWaterAction.lua

blissful salmon
#

Hmm... I'll take one try and call updateWeight() ๐Ÿ™‚

#

Doesn't seems to be the whole magic... I tested two cases:

    local gutsItem = InventoryItemFactory.CreateItem("SoulMod.FishGuts")
    gutsItem:updateWeight()
    player:getInventory():AddItem(gutsItem)

and

    local gutsItem = InventoryItemFactory.CreateItem("SoulMod.FishGuts")
    gutsItem:setUsedDelta(0.4)
    gutsItem:updateWeight()
    player:getInventory():AddItem(gutsItem)

It stays 4.0.
But don't waste your energy... I'll check it tomorrow. Hopefully my brain is "on fire" then... ๐Ÿ™‚

rancid solstice
hearty dew
#

Tell me the german name

hearty dew
#

It's a tile. An IsoMoveable can be created from certain tiles (that are marked as moveable)

#

It's in media/newtiledefinitions.tiles in the vegetation_infoor_01 tileset within that file. You can use TileZed to view it

frank lily
#

is there a hook for interacting with containers

#

im trying render a ui element to the screen when the player opens certain containers

bronze yoke
#

i think you could use OnRefreshInventoryWindowContainers for that

frank lily
#

i was trying to use OnFillContainer but it was not doing what i wanted lol

bronze yoke
#

ah, on fill container is when loot spawns

frank lily
#

makes sense because it would work whenever the player saw the container

#

ty again i been looking for like 45 minutes

ashen mist
#

Y'all know any mods that'll let me craft clothes?

#

like bandanas n' shit?

green berry
#

Hey there, anyone had any chance of working with moddata and vehicle ? I cannot understand why my moddata is "vanishing". My code work when I attach the moddata values to the player instead of the vehicle, but that's not what i'm looking for

#

BaseVehicle should inherit the getModData() method from IsoObject right ?

astral dune
#

I've only had modData retain successfully if I do it server side

#

putting moddata on a vehicle on the client just gets overwritten the next time the vehicle is loaded

green berry
#

Ah

#

Yeah i've experienced that first hand ๐Ÿ™‚

astral dune
#

the transmit moddata functions also only appear to go one way, so I use a clientcommand to transmit the moddata manually

green berry
#

right I see

weak violet
#

can someone help me here with my issue

#

my mods arent loading on a fresh server

green berry
#

thanks for the answer @astral dune , i'll test that

astral dune
#

no worries. I've also had better luck putting the moddata on a part of the vehicle instead of the vehicle itself, but I think they fixed the bug that required that

green berry
#

A simple var attached to each vehicle was a too beautiful idea for randomized car lighters ๐Ÿ™‚

#

oO i saw that on other mods ๐Ÿ™‚ i understand why now

#

@weak violet #mod_support is the channel you're looking for I think.

weak violet
#

no one was answering

astral dune
#

typically you'll have better luck if you give details right away instead of waiting for someone to reply before giving them

young orchid
astral dune
#

eh I wouldn't go so far. In real life its considered polite to beat around the bush a while before asking for help, otherwise its too "transactional" or whatever. It can be confusing for people to be told on the internet "Don't ask to ask, just say it"

weak sierra
bronze yoke
#

D:

weak sierra
#

i put those in the wrong server

#

but u know what

#

this is fine

bronze yoke
#

did we ever reach a verdict on what load order does? i'm under the impression that it literally does nothing, everything loads alphabetically with ties broken by mod id, is that correct?

hearty dew
#

I thought ties were broken by the load order, no?

bronze yoke
#

my understanding was that ties were broken by mod id alphabetically - people often prefix patch ids with ZZZ for example, and this has worked for me recently

hearty dew
#

Oh, I did not know that

bronze yoke
#

is load order even a vanilla feature? i've never seen a button for it, except for map mods

hearty dew
#

Not explicitly in the UI, no. There is an order of mod ids in config files

bronze yoke
#

hmm maybe the mod menu just sorts them alphabetically when it saves?

astral dune
#

I was pretty sure ZZZ was to use alphabetical order to avoid the ties, also a dev was in here just the other day when we were talking about it to confirm that mod order matters ??

bronze yoke
#

since they're displayed alphabetically i guess they would save that way

hearty dew
#

The vanilla mod menu appends each enabled mod to the end of the list, if memory serves

astral dune
#

this post

bronze yoke
#

hmm... maybe mod ids with zs in them are just a misunderstanding then

astral dune
#

well if you do it that way you don't have to worry if the end user has ordered his mods correctly, in theory

bronze yoke
hearty dew
#

Oh, the server mod selection UI does explicitly have a mod order actually.. forgot about that

#

You can move mods up/down to change the order

bronze yoke
#

hmm well luckily the steps i gave to the host i'm talking to worked, even if they may have been based on faulty assumptions? lol

astral dune
#

what I don't get, is if you use mod manager, is you can order mods by both their steam ID an their name, and the order doesn't have to be the same. No idea how that works out

hearty dew
#

Perhaps order is important for maps loaded from mods? Or is only the Maps= line in the config important for such mods?

astral dune
#

maps is important, if anything overlaps the last map loaded wins

hearty dew
astral dune
#

its the maps config, its completely seperate from mod order

bronze yoke
#

i'll mess around with this a bit tomorrow because my hastiness leading me not to write my update as a patch might cause problems from this

astral dune
#

a fairly simple test could be set up, with a couple fake mods named A , B, C or so, with different files that all print their names to the console. we could solve this once and for all if set up properly

hearty dew
#

Anyone know if you can run the java decompilation and annotation gradle tasks without intellij i.e. with just gradle?

bronze yoke
#

i think it's probably possible, it didn't seem like anything in there was really being done specifically by the ide when i ran it

#

i don't know what your target is but the files i got out of it weren't really amazing for vsc though, they use a slightly different annotation scheme than any vsc plugin

hearty dew
#

I'll give it a try. Just wanted to avoid installing a whole ide I won't use for it :p

bronze yoke
#

stuff like inheritance doesn't work and i had to help it with types and events

#

and there was no 'go to definition' support for java functions, which it sounds like does work in intellij

hearty dew
#

I mainly just wanted the source so I can search for references quicker than greping the .class files and decompiling them file-by-file

bronze yoke
#

it'll suit that purpose well, that's mostly what i've used it for

#

it's the only java decompiler that seems to run on my computer for whatever reason

#

i gave rewriting it to produce something more useful for vsc a look, but i just couldn't work out all the gradle stuff

fast galleon
#

I know load order matters for loading saves with different order, it reloads lua first ๐Ÿคทโ€โ™‚๏ธ

thick karma
#

Y'all can someone explain the absolute weirdest shit r.n.?

If I type: print(ui:get(25):getUIName()) in console, I get inventory0. But, if I type:

  local testVariable = ui:get(25):getUIName()
  print(testVariable)

It prints nil instead of the string. What the heck is going on? Can I store the string in Lua form in a variable somehow?

ancient grail
#

Put " "

thorn bane
#

^

ancient grail
#

To make it a string

thick karma
#

Ohhh like concat it?

ancient grail
#

Maybe i havent tried making things like this as string

thick karma
#

Umm didn't work

thorn bane
#

Is there a .ToString() method in linux?

ancient grail
#

Try print(tostring())

thorn bane
#

Or something similar

thick karma
#

Trying to store the tostring also returned nil

#

How the hell does print even work on this object

ancient grail
#

Or try printing first the value

thick karma
#

The first value of nil?

ancient grail
#

No the uiget thing

thick karma
#

It's not a table

#

It's a java.lang.String

#

But somehow Lua print can parse it

#

So it must be parseable

ancient grail
#

If it doesnt give u a print then storing it to a variable will not help

thick karma
#

You are not understanding the weirdness of this situation

#

It DOES print

#

It does NOT store to a variable

#

That's what's so weird

#

I can print it just fine

#

But if I try to store the thing I am printing, it's suddenly nil

#

It's like quantum programming fuckery I swear to you

thorn bane
#

I don't know much about Lua, but could it be possible that it's the way that a variable is stored or someth?

thick karma
#

Try it in console:

local what = ui:get(25):getUIName()
print(what)
print(ui:get(25):getUIName())
#

You will get

nil
inventory0
thorn bane
#

Can you try;

local var

func():
  var = abc;
  print(var)
hearty dew
#

each line in the console is run as its own lua chunk so has its own scope for local variables

thick karma
#

Oh wtf

#

Okay thank you Tyrir as usual

#

Shit I swore I had done that before

#

I hadn't

#

I clearly used a global box

#

Must have assigned my working variable to my DOTZ or IR before

#

And didn't think about it

thorn bane
#

Tyrir using the cosmic power of the universe to be the smartest being in the project zomboid modding community

thick karma
#

One of them, no doubt.

hearty dew
thorn bane
#

I meant Lua and not linux ๐Ÿ˜ญ

#

it dont matter now

ancient grail
thick karma
#

Indeed

#

Tyrir saves lives

ancient grail
#

Happened to me yesterday i just had my call function below the end of its parent function
It took me 4 hrs of rewritting and learning only to find out my initial code could have worked if i had placed it on top the end

#

shelf:setIsContainer(true);
shelf:getContainer():setType("shelves");
is it possible to set the container amt

ancient grail
#

I dont believe its possible to change it since the type is what determine the container amt i think
And only crate and shelves is available
As i looked into the lua folder. This nust be done probably java sided

drifting ore
#

Does anyone know if the forage zones actually deplete? It seems like I can stay at a small patch of forest and stuff keeps coming.

fast galleon
#

tile containers get their properties from the sprite, which is from tiles file. There's definitely more than crate and shelves.

ancient grail
fast galleon
ancient grail
#

I dont know how to do java coding yet

#

Ahhh i get it

#

I can use setcapacity

#

Thnx ill try it

ancient grail
#

@fast galleon didnt work

#
local pl = getPlayer() 
local sq = getCell():getGridSquare(pl:getX(), pl:getY(), pl:getZ());
local shelf = IsoThumpable.new(getCell(), sq, "location_shop_accessories_genericsigns_01_6", false, 
ISSimpleFurniture:new("shelves", "location_shop_accessories_genericsigns_01_6", "location_shop_accessories_genericsigns_01_6"));
shelf:setIsContainer(true);
shelf:setCapacity(5);
shelf:setCanPassThrough(false);
shelf:setIsDismantable(false);
shelf:setCanBeLockByPadlock(true);
shelf:getContainer():setType("shelves");
sq:AddTileObject(shelf);
if isClient() then 
shelf:transmitCompleteItemToServer(); 
end
#

it spawns the thing when i remove the setcapacity but if tits there it throws off an error

#

setCapoacity only works with inventory containers mostprobably

summer rune
#

can i call getCell() on the server and what cell do i get?

fast galleon
ancient grail
#

Ow right

#

didnt work

ancient grail
#

ow wait

#

yep nvm didnt work

#

ahh ill try something

summer rune
#

maybe after u set the type to shelves?

ancient grail
#

yep

#

thats what im going to try

#

nohp stil didnt work

#

error still points to the set capacity

drifting ore
#

Is it possible to change how long does it takes for the forage zones to get refilled?

ancient grail
#

Damn it

fast galleon
#
LOG  : General     , 1667735028964> zombie.inventory.ItemContainer@41d221f7
LOG  : General     , 1667735028964> 5
LOG  : General     , 1667735046666> zombie.inventory.ItemContainer@41d221f7
LOG  : General     , 1667735046667> 50```
#

I see, you try make everything manually, is your container valid?
maybe try doing shelf:createContainersFromSpriteProperties()

ancient grail
#

Ok i will

ancient grail
fast galleon
#

print(getPlayer():getSquare():getSpecialObjects():get(0):getContainer():setCapacity(5))

#

just console testing

ancient grail
#

Ty

dusk sonnet
ancient grail
#

I get your point but still

dusk sonnet
#

But still what?

ancient grail
#

I dont want to do that ๐Ÿ˜ฆ

dusk sonnet
#

Protect others from scammers?

ancient grail
#

His not totally a scammer tho he did pay me from previous lessons

dusk sonnet
#

He only scams sometimes

drifting ore
#

Is it possible to change how long does it takes for the forage zones to get refilled?

ancient grail
#

Ill tell u via pm

ancient grail
sour island
#

I dont suppose anyone knows of a way to get the mac address of a player?

#

I see the console txt outputs hardware info

#

I have reports of players sharing accs and even steam accounts to bypass steam ID to abuse skill recovery journals lol

#

not too bothered by it but I do feel bad for server admins dealing with scummy people

hearty dew
#

Depending on how you are planning to solve that, there might be some fields on GameClient you could use to fingerprint the client

#

PublicServerUtil.getMacAddress. Doubt it is exposed though

#

Can't test it atm

civic lava
# ancient grail

you take a willing commission work with understood payment, why not scroll up to the part where we discussed how payments between us WILL work & how it is 100% based on what i DEEM worthy of learning, this is not a job u must take & it was an offer from me, so far i've given you 20$ USD & did learn some stuff, but to think you deserve 5$ for a 10 min convo where i learned NOTHING is insane my friend, i would like to protect others from scammers too

sick ridge
#

Where i can read zomboid's api documentation?

civic lava
#

to anyone doing any commission work with lua & modding please discuss & understand playment before you do ANYTHING, otherwise you will "feel" like you are being wronged

sour island
#

Yall should probably deal with this in private

civic lava
#

i agree but he posted a thing

#

so lets just take note, commissioners beware of who u work with

sour island
#

that being said "paid by thing learned" is super silly, not sure how that got off the ground

civic lava
#

& discuss beforehand please

dusk sonnet
civic lava
#

???..... i outed myself?

#

i pay the man 20$ for almost nothing IMO

#

now he wants another 5$ for literlaly 10min of time that still left me confused with no progress

#

w.e

dusk sonnet
#

He covered up your name to save you from the embarrassment. You could have said nothing about it here

#

You're just continuing to build your reputation

hearty dew
civic lava
#

like i care? once again, its something to discuss before hand if u do any commission work dealing with people

sour island
dusk sonnet
sour island
#

As someone who has done commissions, set a fixed price that both are happy with (even if you have to awkwardly ask them 3 times in a row), always expect to not get paid even then, and always triple your estimated time to complete it.

Tutoring isn't a commission though. The right thing to do is to pay someone for their time regardless.

#

This sounds like a lesson for both parties to confirm payment/rates

civic lava
dusk sonnet
#

any knowledge or help
Except the help he gave you that time, I guess

civic lava
#

so i cannot stress enough, that when dealing with modding or any type of commissioned work with people on discord you MUST discuss payment beforehand

#

once again i payed 20$ already for what i consider not much

#

simply dont work with me then

#

it that easy

sour island
#

that is the lesson he learned

dusk sonnet
#

And hopefully everyone else who reads this

civic lava
#

indeed

sour island
#

anyway, anyone familiar with Say() know why it wouldn't inherently be MP capable?

ancient grail
#

Cuz theres no chat

#

Ow i thought sp

#

Say works in mo

#

Mp

sour island
#

as far as I can tell Say() is used from the chat window - but it doesn't broadcast

ancient grail
#

Yes

#

Its just on the head

#

Ike halo

sour island
#

Yeah

ancient grail
#

I think it works both sp and mp tho

sour island
#

Seems like it should

ancient grail
#

But it wouldnt for your case?

sour island
#

It only shows up for the player themselves

ancient grail
#

Ah i think so

uncut jasper
#

Hello everyone, I need light, I'm looking for an event: when the cell unloads
i need get vehicles before cell unloaded

ancient grail
#

getUseableVehicle()

hearty dew
#

The overhead speech bubble is only done if the author of the message is the current (client) player. Just is coded that way java-side

sour island
#

ah, you fired a command

#

I should have just done that, but I was kind of curious why Say() wasn't inherently MP transmitting

thorny marsh
#

Suprised no one tried to make a spellcasting mod

#

Maybe because throwables are garbage to code

hearty dew
#

You can get a ChatElement, which is used to display the overhead messages, using IsoGameCharacter.getChatElement

sour island
#

I hope a simple physics system gets added next for thrown items lol

sour island
hearty dew
#
                    if message:isOverHeadSpeech() then
                        local color = message:getTextColor() or {r = 1, g = 1, b = 1}
                        local range = message:getRange() or 60.0
                        player:addLineChatElement(message:getText(), color.r, color.g, color.b, UIFont.Dialogue,
                                range, "default", true, true, true, true, true, true)
                    end
#

Have them working in custom chat tabs I'm working on, forgot about them

sour island
#

Would that also be overhead or just in the chat?

hearty dew
#

It's both

sour island
#

and it would work in MP?

hearty dew
#

Don't think I specifcally tested multiplayer, but ought to work. This doesn't go through that code that compares author name to player name

sour island
#

oh

hearty dew
#

I can test real quick

ruby urchin
sour island
#

I mean for projectile arcs

#

the current system seems way too simple and still uses the 2d sprites afaik

ruby urchin
#

I saw a mod use 3d projectiles, but it is highly obfuscated

sour island
#

would be neat to have an aiming system where you can control the arc based on how close you aim to yourself and holding down the left click

#

basically old school archery flashgames - but in this case for throwing items to distract zombies, or moltovs, or even archery technically

sour island
#

Very similar args, but Im curious what the last 6 trues are doing

hearty dew
#

Oh, I didn't yet finish the networking for the custom chat tabs

#

so not broadcast to other players

sour island
#

Seems to work in MP atleast bymyself

#

surprisingly I didn't realize but Say() uses huge font even though I had newSmall

hearty dew
#

Those last few are whether or not to interpret rich text codes, embedded images in text, .. few other things I don't recall offhand

hearty dew
uncut jasper
#

@ancient grail #2892no, I'm looking for an "event" when unloading the cell, to getVehicles and apply my code.

sour island
#

UIFont.Dialogue fixes the font issue

hearty dew
#

I must have read the java wrong. Makes sense now that I see it in action. It will show the overhead if the author of the ChatMessage equals the player name.

sour island
#

Going to try and -nosteam test it

hearty dew
sour island
#

oh nice

#

that shaved off alot more work for me

hearty dew
#

That's in -nosteam

sour island
#

ty @ruby urchin and @hearty dew

#

I was also curious if there's a way to intercept out going Say()'s

#

conditional speech plays messages but it also parses the phrases through filters

#

I was wondering if I could apply the filters to player inputted text

hearty dew
#

You can intercept lua-side calls of Say(), yea. Can do that by decorating the function on IsoPlayer

#

There is a global function, processSayMessage (or something like that), you could use to intercept text players type into the chat window too I believe

hearty dew
hearty dew
# hearty dew You can intercept lua-side calls of Say(), yea. Can do that by decorating the fu...
--[[
    Usage example:
    
    ChuckUtils.patchClassMethod(zombie.inventory.types.Moveable.class, "getDisplayName", function(original_fn)
        return function(self, arg1, arg2, ...)
            local modData = self:getModData()
            if modData and modData.new_value then
                return modData.new_value
            end
            local result = original_fn(self, arg1, arg2, ...)
            result.someProperty = false
            return result
        end
    end)
]]
ChuckUtils.patchClassMethod = function(class, methodName, createPatch)
    local metatable = __classmetatables[class]
    if not metatable then
        error("ChuckUtils.patchClassMethod: Unable to find metatable for class "..tostring(class))
    end
    local metatable__index = metatable.__index
    if not metatable__index then
        error("ChuckUtils.patchClassMethod: Unable to find __index in metatable for class "..tostring(class))
    end
    local originalMethod = metatable__index[methodName]
    metatable__index[methodName] = createPatch(originalMethod)
end
sour island
#

hmm sorry had to step away

#

this would let me replace or add onto existing functions?

#

btw for context this is to make a drunk filter

#

๐Ÿ˜…

hearty dew
sour island
#

ah I see that now

hearty dew
#
    ChuckUtils.patchClassMethod(zombie.characters.IsoPlayer.class, "Say", function(original_fn)
        return function(self, arg1, ...)
            arg1 = "I always say this"
            return original_fn(self, arg1, ...)
        end
    end)

Something like that. Didn't test it

sour island
hearty dew
#

self is the player object

sour island
#

Oh I assumed self was the method

hearty dew
#

All the arguments in that returned function are what the original function would receive

#

Say() has a number of overrides too iirc, so be mindful of that

drifting ore
#

Is it possible to change how long does it takes for the forage zones to get refilled?

sour island
hearty dew
#

So patchClassMethod will only intercept calls to java objects done from lua code. Is that what you are trying to do here?

#

Typing in a message into the General tab of the chat window doesn't call addChatline from lua (it might call it from the java-side, I'm unsure)

ancient grail
hearty dew
sour island
#

hm, I can check the arguments to control what gets changed too

hearty dew
#
local original_processSayMessage = processSayMessage
function processSayMessage(command)
  command = "modified"
  return original_processSayMessage(command)
end
sour island
#

can you overwrite methods that way?

hearty dew
#

yep

weak sierra
#

there's an every minute event, right? not seeing it in the list

ancient grail
#

Tyrir is a wizard

hearty dew
# hearty dew yep

It's nothing special, just a function in the global table _G. What's special about it is it is tied to a java method that kahlua takes care of

weak sierra
#

that's the standard approach to replace a method in modding generally

ancient grail
#

UdderEvelyn is a Wizard

weak sierra
weak sierra
ancient grail
#

See that.. wizadry

weak sierra
#

thanks

hearty dew
#

.

weak sierra
#

how often does OnPlayerUpdate fire btw, if nothing is changing for the player of meaning will it still fire pretty regularly?

#

need to choose between those.

#

this is only a very temporary event handler that will be removed in a few seconds after login

#

so.. i guess not that serious of a decision

uncut jasper
#

event load cell exist?@weak sierra

weak sierra
#

for squares, not cells

#

the game doesn't load cells

#

it loads chunks and squares

#

it has a chunk relevance system

uncut jasper
#

ha yes, loadGridSquare

weak sierra
#

where it loads/preloads things that are seen as needed or soon needed on the server end

#

yeah

#

but also reusegridsquare

#

reuse occurs when a square is being recycled to display something else

#

so it means a square was unloaded too

#

not sure if u can get the unloaded info tho

#

or do anything with it once that happens

#

if this is for ur vehicle position remembering mod

#

i'd hook when you get in and out of cars

#

for the whether they're in

#

as for the vehicle position

#

that's more complex and i assume what ur on

#

for optimization

#

hmm

#

could hook BaseVehicle.update

#

and throttle it to every minute or so

#

and only if player car

#

or better yet

#

hook a player event like onPlayerMove (if it fires in a car, i assume it does)

#

again throttle it

#

maybe to every X seconds

#

if in car

#

store car pos

#

in global mod data

#

on my vehicle respawn i throttle to every 7 seconds

#

i estimate that provides a decent coverage with movement

#

even when going quick

weak sierra
#

:p

bronze yoke
hearty dew
#

pretty frequently, if memory serves. Was near every tick or every several ticks.. Can use something like this to observe events:```lua
for i, j in pairs(Events) do
local c = 0
local limit = 10
j.Add(function(...)
c = c + 1
if c == limit then
info(" >==-- Events."..i.." "..tostring(limit).." events raised. Discontinuing")
elseif c < limit then
info(" >==-- Events."..i)
end
end)
end

sour island
hearty dew
sour island
#

that is true

#

pretty sizable update if this works - all with like 6 new lines of code

weak sierra
#

update for what

#

EHE?

sour island
#

I was curious, would I /should I be applying the rest of the arguments?

#

Conditional Speech

weak sierra
#

ah

#

we've considered adding that a few times but as an RP server might be a bit weird if the character injects personality on their own, heheh

sour island
#

the update would apply the filters to typed chat

#

you could disable the moodle phrases

#

and have moodles impact how players type

weak sierra
#

what would it do? :o

#

like.. add status effect to text?

#

like drunk and such?

sour island
#

yes

weak sierra
#

that might not be a bad idea

#

will have to hold a vote

hearty dew
# sour island I was curious, would I /should I be applying the rest of the arguments?
local original_processSayMessage = processSayMessage
function processSayMessage(command, ...)
  command = "modified"
  return original_processSayMessage(command, ...)
end

Like that? You could. If one day a new version adds more parameters to that function, your code wouldn't break if you did. So doing that would make it less brittle in that regard

sour island
#

the first line is what I typed

#

second is from the moodle increasing

#

drunk filter incoming

weak sierra
#

awaits

sour island
#

also the player should stammer when cold

weak sierra
#

would be cool to have lots of these things for all the moodles that it makes sense for

#

i assume ur already looking at that

#

like panic and tired and such

sour island
#

there are phrases and filters for most moodles

#

before now they only got applied to stock phrases

weak sierra
#

yeah

#

Q: is there a per-player disable option should someone wish to apply their own flavor?

#

not necessarily a requirement for our use but it would make it more likely to pass a vote i think for those who might wish to do it manually

sour island
#

The config mod I wrote up forces everyone to use what the host/admins set

weak sierra
#

mk

sour island
#

speaking of, I'm told there are still issues with configs and the cache lua folder

#

so I might have to revisit that

hearty dew
weak sierra
#

im making a mod that gives u a grace period on login

hearty dew
#

The loading events are a bit different between single player and multiplayer, so I've relied on the 1st OnTick to simplify handling the events differently between sp and mp

weak sierra
#

player is invis for N seconds and J seconds if u move instead

#

20s if u sit still (more grace period in case loading still) and 10 seconds if u start moving

#

that way when ppl log in and a horde happens to have walked into where they were

#

they aren't just fucked

#

this is important when a crash occurs in combat, for instance..

#

or when the server reboots for update when ur fighting

#

or just u log off someplace weird

#

OR even just zombies come to ur gen at ur house

#

while ur offline

#

lord knows

#

so this really only applies to mp since the load times and continue-running-when-ur-gone are why it's needed

hearty dew
#

Ah, so playerupdate should work well in that case, I'd hope, and I think it gives you the correct player object too as a parameter

weak sierra
#

i was going to hook OnPlayerMove separately

sour island
#

I feel like this already happens for SP

weak sierra
#

but i guess i could check the coordinates from inside of OnPlayerUpdate

#

and keep it to one handler

sour island
#

atleast from what I notice zombies dont respond right away

weak sierra
#

well even if it does it want control

sour island
#

fair enough

weak sierra
#

i want a halo note to tell the user, and i want much longer

sour island
#

should be a vanilla feature tbh

#

even for PVP purposes

weak sierra
#

agree

#

ppl cud shoot u while ur loading

#

lol

sour island
#

although I think something like GTA where the player is faded out would be better to avoid abuse

weak sierra
#

elaborate?

#

my server is an RP server, we have pvp but

sour island
#

you could logout near someone's base and relog as a means ot recon

#

if you're invisible

weak sierra
#

it's not KOS in normal circumstances

#

ah

#

yeah

#

well we run some 500 mods

#

so that'd be a hell of a lot of work to load in and out

#

hehe

#

but that could be an issue yeah

#

how do u avoid that potential tho other than logging

#

i did have that thought

#

brb

sour island
#

eventually when NPCs are added

#

it would be kind of cool if players were more like group managers

#

so maybe the AI could take over

#

but realistically PVP is hard to balance

#

also I don't think there would be a clean way to show the player is there but also make them impervious/invisible

#

there will always be cases where maybe the player would have been unseen and now it's broadcasted

weak sierra
#

another mod uses zombies dont attack instead of invis

#

the only similar mod i could find

#

but that lets zeds follow u

#

so..

#

lol

#

too bad there's not an "invis to zombies only"

#

then again that'd be wrong too in many cases

#

RP server like mine, person just being ignored by zombies but visible

#

for my server if someone tried to kill u while ur spawning in that'd be fail rp

#

and if someone tried to recon u by relogging repeatedly by ur base

#

that'd also be not ok

#

but since the focus isn't pvp

#

im more worried about the legit use cases

sour island
#

Are you having alot of issues of players relogging into a zombie horde?

weak sierra
#

yes

#

xD

#

we have 5.5x pop

#

and hordes set up in ways where they move a lot

#

and some users with high ping, and occasional crash issues from game bugs

#

etc

#

we had zed hearing really high before too so they'd cluster up at a running generator

#

heh

twin basalt
#

does anyone have any experience with modding the clothing.xml file?
for some reason, every new outfit i add will not work...
even if i literally copy and paste an existing outfit and change the guid, it dosent work

#

does the guid correlate to the outfit itself? or is the guid written and initialized somewhere?

sour island
twin basalt
#

is there a way to debug this issue? like im pretty lost with problems like these and have no idea where to check as there is almost nothing on the internet about this what so ever

sour island
#

the clothing stuff is very tedious and particular - so you're not at fault

#

Are you trying to add outfits?

#

Do you see the outfit listed but no items?

twin basalt
#

exactly

sour island
#

what does the outfit block look like?

#

you might be missing a tag close

#

do you have <outfitManager> around it?

twin basalt
#
<?xml version="1.0" encoding="utf-8"?>
<outfitManager>
    <m_MaleOutfits>
        <m_Name>WTTTest</m_Name>
        <m_Guid>5b475d5d-082b-456b-bc78-d7fcb265245b</m_Guid>
        <m_Top>false</m_Top>
        <m_Pants>false</m_Pants>
        <m_AllowPantsHue>false</m_AllowPantsHue>                         
        <m_AllowTopTint>false</m_AllowTopTint>                              
        <m_AllowTShirtDecal>false</m_AllowTShirtDecal>     
        <m_items>                       
            <itemGUID>92d60950-28a8-42cb-bee6-0384069f250d</itemGUID>
        </m_items>
        <m_items> 
            <itemGUID>7445da27-d930-4290-af26-515a04c96f8f</itemGUID>
        </m_items>
        <m_items>                                  
            <itemGUID>6c247231-dbe5-45cd-8e93-78d4ef716ff9</itemGUID>        
        </m_items>
        <m_items> 
            <itemGUID>993a89f1-7dde-406d-ba1f-3d02d14db5cc</itemGUID> 
            <subItems>
                <itemGUID>1a355b1d-3b97-4a11-a244-2b80aad8c009</itemGUID>
            </subItems>
        </m_items>
    </m_MaleOutfits>
</outfitManager>
sour island
#

And these are vanilla items?

twin basalt
#

yes they are vanilla items

sour island
#

are you putting this inside the media/clothing/ folder in your mod?

twin basalt
#

yes

sour island
#

do you have a file guide?

#

media/fileGuidTable.xml

twin basalt
#

no i do not

#

though why should it include one?

sour island
#

that is true

#

I'm just looking at my own file strcture

twin basalt
#

i think actually it may need it to reinitialize the guid's in the mod directory? or smth?

#

maybe as a reference?

#

ill try something

sour island
#

if you're only using vanilla items it shouldn't

#

but I'm not an expert at clothing stuff

twin basalt
#

im looking at other mods and it seems to be that they reference items in the fileguidtable that they use in the outfits

sour island
#

@weak sierra

twin basalt
#

maybe its the case

#

1 just copied the vanilla file to their mod

ruby urchin
#

is a good idea use a json as database?

twin basalt
#

yup that was the case!
you need to reference the items you use in the fileguidtable

#

which is really not efficient with custom mods wow

#

as you need to include both directory and guid

sour island
#

you have to include vanilla item guids as well?

#

that feels like an oversight

twin basalt
sour island
#

@weak sierra

nova egret
#

for those who use the brita armor but the night vision device how is it activated?

civic lava
#

Im wondering how to get a stat to constantly change a variable, the best way to try to explain i with a pic.
(the numbers are 100% chance to trip because every time i've tried to add anything that changes "trips values" based on the players current state/actions it breaks & will not work at all, so i used 100% fall ratio as a "your code is broken" if i dont fall..)

Basically if i remove the lines
_
- panic;
local panic = _player:getStats(stats:getPanic());
.
then everything will work fine. I've tried calling values in many dif ways & it seems most dont work.
examples: local panic = stats:getPanic(); or local wet = _playerdata:Wet() & then trying to have those + or - my % to fall

dusk sonnet
#
  1. I don't think you want a semicolon in the middle of your statement
  2. You're calling panic before it's defined
civic lava
#

this is why i put it on the bottom now

dusk sonnet
#

Well it definitely doesn't work on the bottom

civic lava
#

ok

#

so back to top at least is a start for me

#

so this time i didnt even bother with making panic effect anything, this results in 200 errors a second & 0% trip rate but if i remove the line : local panic = _player:getStats(stats:getPanic()); it works perfectly....

dusk sonnet
#

What does the error say?

civic lava
#

my brain is officially rattled cause ive tried like 40 dif ways

civic lava
# dusk sonnet What does the error say?

will check next time i run this but its obviously written wrong atm anyway so i must change it first & come up with #41 attempt to call panic into my situations

dusk sonnet
#

I'd figure out the specific error before making more changes which could potentially give you a different error

astral dune
#

you have basic syntax errors that are causing you problems. Also, if this code worked as you seem to intend they would trip at all times

civic lava
#

yes i want 100% trip rate because if i dont trip it lets me know that my other calls are not working... if i remove the () & the call stats it doesnt give errors & simply doesnt work either lol

lyric bolt
civic lava
#

idk if thats serious or not but yea lmfaooo its good, lets me get the it all set up, trying to go for a hyper realistic thing where you only trip or fumble a weapon under bad conditions & NEVER in good ones, not completely random, based off playerstats & such

#

if i could just fine tune the "butter fingers & noodle legs" traits id be playing the game rather then modding lol, but i want that hyper realism of natural human flaw, & will make it so on a perma death hosted world lollol

sour island
#

@weak sierra

astral dune
#

lel

#

I hope you add the occasional ...hic! to the end of drunk sentences just like in WoW

tardy wren
#

This is out of context

weak sierra
#

the vote so far is 9:3

#

in favor

#

never know where it'll go tho

#

i posted that there as more example

sour island
#

Just updated

#

also I updated Named Lit to include comics

#

idk if changed the sandbox options for that yet

sour island
weak sierra
#

variety is good thumbsUp

#

there are non-superhero comics out there too u know

#

lol

#

i admit that's a tiny fraction though

#

๐Ÿ˜…

sour island
#

It would go against the current direction of art

#

They're all piece-meal color swaps

#

except for a special 1

weak sierra
#

ah

#

that makes sense

#

lets u identify them visually still too

sour island
#

I can always add more to it

weak sierra
#

that's def a fair way to do it tbh

#

i remember growing up in the 90s seeing star wars comics and such too but that wasn't most of it xD

sour island
#

it was a bit more overwhelming than books or even magazines

#

I didn't include volumes for magazines cause there wasn't that much value as far as I could tell

#

but I was tempted to try and include issue # for comics for collecting purposes

#

but it was a bit daunting

#

so I eliminated duplicate titles within the years

#

and dropped issue # from my db

#

the online list I used also only went as far back as 84

ruby urchin
#

hey fellas, I'm doing this, SQLite DB has many restrictions, and I really don't know if it will be possible to work on it freely, but I made a JSON database, I don't even know if it's convenient, but there is

#
{
  "test" : [
    
  ],
  "players" : [
    {
      "name" : "Test1",
      "displayname" : "Tes1",
      "id" : 1
    },
    {
      "name" : "Test2",
      "displayname" : "Test2",
      "id" : 2
    }
  ]
}
ancient grail
#

Or maybe 2 cuz of the skin color

ancient grail
ruby urchin
ancient grail
#

Ow yeah that works but you still can play with the whitelist tho

ruby urchin
#

Client need be admin to access to db, so you can't do many things

ancient grail
#

Altjo i have a script that dimms the screen or sends them back to mainmenu that can be used as an alternative i think

bronze walrus
#

how do i replace individual sound files, like the jumpscare sounds

#

cant figure this out boohoo

ancient grail
#

you can just replace the audio files if you want

#

name it the same and do a mod thats supposed to be the same directory as the file u want to replace

#

or you can make a script that overwrites this

#
    sound ZombieSurprisedPlayer
    {
        category = Zombie,
        clip
        {
            event = Game/ZombieSurprisedPlayer,
        }
    }
#

@bronze walrus

hidden jungle
#

is there an event that fires when the player picks up an item?

#

better yet, can someone link me to the list of events? i'm struggling to find it

hearty dew
#

.

#

pzwiki has some description of some of the events

ancient grail
#

why is smoking cigar counts as on_eat

civic lava
#

seems like anything consumed in any form is on eat & the items being "eaten" must be specified lol, its weird i agree

ancient grail
#

ya guys think this will work

#
local modData = player:getModData()
if player:getTraits():contains("AllThumbs") then modData['hasAllThumbs']; end
if player:getTraits():contains("SlowReader") then modData['hasSlowReader']; end
if player:getTraits():contains("Dextrous") then modData['hasDextrous']; end

if not player:getTraits():contains("AllThumbs") then player:getTraits():add("AllThumbs");  end
if not player:getTraits():contains("SlowReader") then player:getTraits():add("SlowReader");  end
if not player:getTraits():contains("Dextrous") then player:getTraits():add("Dextrous");  end

above is a temporary effect.. below if the effects is gone

if modData['hasAllThumbs'] == nil and player:getTraits():contains("AllThumbs") then player:getTraits():remove("AllThumbs");  end
if modData['hasSlowReader'] == nil and player:getTraits():contains("SlowReader") then player:getTraits():remove("SlowReader");  end
if modData['hasDextrous'] == nil and player:getTraits():contains("Dextrous") then player:getTraits():remove("Dextrous");  end
ancient grail
civic lava
#

why does this always = 1
_
local hps = _player:getHealth();

#

_
i assumes Health is the white meter that drops, but when i call bleeding or blood or bleed instead of health i get errors, but health should be a 0-100# i assume yet it = 1 nomatter how damaged i am or how much my health has gone lower

#

once i figure out how to make the players moodles & statuses values effect other values i want them to effect ill porb be done with coding, i literally been over a week trying to "tweak" 2 already written mods to be "better & realistic"

civic lava
#

local hps = _player:getHealth();
local pan = _playerdata:getEndurance();

top value always results in "1" unless dead.... the bottom value breaks my code..... i've also tried to bottom without the work "data", i truly dont understand how im supposed to call upon players conditional states as the numbers they are durring gameplay

civic lava
#

OK.... so im done trying, just gonna play solo, i am willing to commission it for a total of 20$ for the "more traits mod" to be overhauled, i already have allot of code & information prepared as i have been trying to do this for over a week myself. Noone will help without money, & teaching me will cost me more (as im a fool) so if anyone wants a 20$ commision to rehaul the "more traits mod" lmk

#

only want noodle legs & butter fingers to work diffferntly

#

& some prices of the perks changes, literally that is it

#

my failure is i cannot figure how _player:gethealth(); is = to 1 no matter how hurt he is, from perfect to almost dead his "health" was still 1 somehow... not to mention my code breaks every time i try to call Panic() into the ratio of tripping

#

2 traits overhauled, all prices on the traits changed, 20$. i cannot figure it would take more then 1 hour for someone who knows the code

#

1 "pre existing" mod changed a bit

summer rune
#

u should ask the mod owner directly if u can commission him/her

civic lava
#

oh shit

#

your a genius

summer rune
#

nah man, just tunnel vision, which happens to everyone focusing to hard on a specific problem ๐Ÿ˜„

civic lava
#

lol

#

yea a week of rattling my brain over it i just want to scream, i feel like im just missing like 1-2 little bits of info that would result in me being able to do it myself

ancient grail
#

after saying his script is written as "sloppy" live on twitch

civic lava
#

was there a reason you bring this up?

summer rune
civic lava
#

or modding

summer rune
#

so u well know, that u can do it. just take a breather. and take another look at it later. but remember if u do, dont publish ur modified version. only the mod owner is allowed to do so. that is why commissioning them is actually a smart move.

#

oh unless u just make a patch, which does not require u to reupload the whole mod. then it would be fine.

civic lava
fast galleon
#

Anybody knows if translations are planned to change? Seems like most files use unnecessary formatting.

#

File: media/lua/shared/Translate/En/Tooltip_En.txt

--// Formatting tips // textArg = "Language Text" // 1st line is skipped // lines that have -- are skipped // lines that end with .. are skipped // ..
Tooltip_txt= "My Text"
tardy wren
#

I think it's more related to lua formatting the strings or something

#

Because those look lime Lua key symbols thingies

#

-- is a comment line, .. is string concatenation

summer rune
fast galleon
#

I mean, translations usually add
first line: Tooltip_En
{
text = "My text"
/* comment */
}
which are mostly not used,

#

except for the valid text line which is added

tardy wren
#

Huh, so maybe that's why it's broken on my end... I need to check what's up

fast galleon
#

also commas are unnecessary

ruby urchin
#

translation is text that is loaded how a code fragment, that's why need commas

deft falcon
fast galleon
#

at least a line break is enough

deft falcon
sour island
#

Some of the values are 0 to 1, others are 0 to 100

#

Depends on the stat

deft falcon
#

mhm but panic and hp is 0 to 100

sour island
#

Technically there is no difference between using 1 or 100

deft falcon
#

and those r the stats he needs

sour island
#

Yeah

#

If I recall the health that's 0 to 1 is only the total used for the UI

#

Setting that one to 0 kills you tho

#

Also Zombies have a health of 2

#

Fun fact

summer rune
deft falcon
#

i dont think i wanna know

sour island
#

I set my super spiffo to 10000

#

Also if he somehow dies it fires a location event to revive outfit matches

#

The only way he has "died" (caught on a stream) was poorly pathing over a railing and getting stuck in water

sour island
#

Unfortunately I didn't see a way at the time to prevent death

#

But with what I learned yesterday it could be done a bit easier

summer rune
sour island
#

He has a unique costume

summer rune
#

awesome. now u gotta share a picture ๐Ÿ˜„

summer rune
#

okay okay. i guess there is a new cute undead challenge for my players. fun fact: they liked the zombies with 14 HP and asked for more ๐Ÿฅฒ

sour island
#

How hard is it to kill 14 HP zombies?

#

I found that even at 10000 HP some weapons would instantly kill

summer rune
#

Hm, good question all the dmg of our weapons is also heavily reduced and modified. I noticed that I need generally 1-2 more hits for every zombie.

fast galleon
#

Google says readLine doesn't need commas

summer rune
summer rune
sour island
#

Nah, I tried 1 million

#

Hence I just left it on 10k and worked out a delayed revive

#

What mod is this?

#

CDDA?

civic lava
summer rune
tardy wren
#

I mean, the spears sometimes do make an attack that doesn't drop their HP to 0, but still kills the zombie

#

Tho I wonder how much the 1 hp translates to the damage numbers mod values

neon bronze
#

ok so how does transmitModData and getModData exactly work? Trying to set up a table for an item which will be used in a timed Action, where the said table will be changed and then it should be saved by the server but i cant get my head around how to do it?

ruby urchin
neon bronze
#

does this also work sp with transmitModData and getModData?

#

wait, can i create getModData for anything, like for any item aswell?

summer rune
#

yes, many mods make use of that. eg. nvg items store, the brightness and so on.

ancient grail
neon bronze
#

Think you can since there is a getModData call for an item

astral dune
#

almost everything has modData, but getting it to save properly is the challenge

neon bronze
#

hmm, funnily enough it seems atleast for sp that just calling getModData for items is enough to store the variable, there is no need to transmitModData for it

astral dune
#

transmitModData is usually to send changes you've made on the server to the client, so ya its probably not really necessary for SP

neon bronze
#

can i then check if i am in sp or in mp to save it, since when i transmitModData in sp it causes an error and i dont have a dedicated server to test it

#

well atleast in the Pz Api website there is not transmitModData for an IsoItem soooo

hearty dew
#

I believe those mod data methods are on IsoObject, or some common superclass

neon bronze
#

But it is the same form of syntax as getModData right? Cause iโ€™d do transmitModData after i set my variable but the game keeps erroring for me when i put in the call

finite radish
#

anyone have a resource regarding how the new 3D items on ground work in terms of the default spawns? e.g. pots on kitchen counters, etc.

neon bronze
#

I guess in general its that im trying to transmitModData on an inventoryItem and not on an IsoObject

#

But ive no idea whether the changed moddata of an item will be saved to the server

#

So essentially the situation is
self.gun:getModData()
(Do some stuff)
self.gun:transmitModData()

ancient grail
#

what are you trying to do?

#

@neon bronze

#

permanent change to all item?

#

use item tweaker

#

if for a certain gun only

#
local shotgun = InventoryItemFactory.CreateItem("Base.DoubleBarrelShotgun");
shotgun:setTooltip("initially has 6 chambered  shells");
shotgun:setClipSize(6);
shotgun:setCurrentAmmoCount(60);
shotgun:setRoundChambered(true);
shotgun:setAimingTime(90);
shotgun:setMinDamage(5)
shotgun:setMaxDamage(12);
shotgun:setName("SOS ToxSicK Event Shotgun"); 
getPlayer():getInventory():AddItem(shotgun);
#

heres a debug snippet i wrote that we used for a server event.

neon bronze
#

Nah, nah im trying to set a variable for a gun in its moddata

rustic jungle
#

Hey guys, I was wondering if anyone can guide me if time allows it?

neon bronze
#

So i can call it up in other codrs

ancient grail
#

guys what if theres no sleep on the server and i did getPlayer():getStats():setFatigue(50)

#

how will they reduce the fatigue

hearty dew
neon bronze
hearty dew
#

Not sure, didn't trace the save method calls that far

ancient grail
neon bronze
#

Well, guess thats just more testing for people

hearty dew
neon bronze
#

Yeah iโ€™d just give the code to someone i know who has a server to test it and see if it works but i hope it does

#

Since i didnt see anywhere in other code snippets that stuff like ammo in a gun has to be manually transmitted to the server

swift sequoia
#

You know, like most IT people.

ancient grail
#

thnx

swift sequoia
#

If you have a server with no sleep and you regularly set fatigue up by a couple, you could create a thriving market for coffee.

ancient grail
#

good idea

swift sequoia
#

Also add that mod that makes people pass out at a certain fatigue level. lol.

#

...the players will be the real zombies.