#mod_development

1 messages ยท Page 54 of 1

ripe warren
#

that would be the OnExitVehicle event

bronze yoke
#

can you show the line?

ripe warren
#

^^

ancient grail
#

Ow this is a first mod for you
Best of luck man.

ripe warren
#

yup. thank you

bronze yoke
#

ah... onexitvehicle has been removed from the game

#

there's still a trigger in the java, but the event isn't actually registered lol

ripe warren
#

okay great so the lua events wiki page is outdated

bronze yoke
#

it's quite outdated

ancient grail
#

I think OnExitVehicle is either bugged or wasnt ment to be used that way

ripe warren
#

so where can I see actual events that work in the game?

#

or is there no resource for that?

blissful salmon
#

Hmm. It appears that the OnExitVehicle is null at this time. I'm not a pro with events. It looks correct to me.

bronze yoke
#

i'm going to go through whichever events aren't registered and remove them from my pr

#

hopefully the maintainer will see that someday lol

ripe warren
#

OnUseVehicle
and OnExitVehicle both do this while
OnEnterVehicle works fine

astral dune
#

?? onExitVehicle still works

ripe warren
#

these 3 are pretty essential to making what I want to make so I dont know if there are alternatives or the events are called something else now?

bronze yoke
#

unless you're getting it in some weird way it's not even registered to Events

astral dune
#

hmm, I'll have to double check, it was working as of 41.76

bronze yoke
#

and the only part of the code that attempts to trigger it is related to teleporting out of vehicles

astral dune
#

are you looking in the java or the lua?

bronze yoke
#

the java... i suppose it could be registered in lua

astral dune
#

most of the vehicle events are lua and client only

bronze yoke
#

most of them are registered in java

#

this one isn't though, you're right

ripe warren
#

oh. So how can I access those?

bronze yoke
#

it's registered in vanilla client, so there shouldn't be any issues with getting it before it's registered or anything

#

oh, wait, no, doesn't client load second?

astral dune
#

last

bronze yoke
#

and i bet this file is in shared or server?

ripe warren
#

its in shared yeah

astral dune
#

pretty sure you can just register the event early if you want it

#

but it doesn't fire in shared so you may as well just add it in client

ripe warren
#

I need it to edit the condition values of vehicle parts, I dont think I can do that client side.

bronze yoke
#

try

Events.OnGameBoot.Add(function()
    Events.OnExitVehicle.Add(PlayerSay)
end)
#

i don't think onexitvehicle will even trigger on the server?

astral dune
#

ya, its only on the client

bronze yoke
#

so either move the OnExitVehicle-related code to the client folder or use the code above, whichever works best for how you're organising your code

astral dune
#

you can just register the event early, its just a string

#

but I would recommend putting the code in client, ya

ripe warren
#

Well I wouldnt know how to relay that information from one script to another so I guess I will use the code above

ancient grail
#

You can put a moddata whenever the player enters the vehicle
getVehicle()

Then as he leaves
If not getVehicle() then

Just nil the moddata
While triggering the function you want

ripe warren
#

Hmm, well I have no idea what moddata is and when its triggered so I will have to find some documentation about that

thick karma
#

Anyone understand this error? ๐Ÿ˜ฆ (For context: I just deleted a same-name folder in mods and renamed another mod to the name of the preexisting folder and renamed some files in the mod directory.)

quasi geode
#

no implementation found generally means you passed the wrong number of arguments to a function that has multiple implementations.

astral dune
quasi geode
#

sendClientCommand has versions that accept 3 or 4 arguments (player, module, command, args)

thick karma
bronze yoke
#

but it's a java function

#

you need to pass an empty table if you don't want any arguments

quasi geode
#

generally yes, but like albion says, its a java function

bronze yoke
#

i don't know why that was working before, that isn't working code

thick karma
#

Okay interesting. That's all well and good but it doesn't explain why this was working a second ago...

ripe warren
bronze yoke
#

yeah i really wouldn't recommend doing it that way

ripe warren
#

yeah I kinda want to avoid using OnTick as much as possible

astral dune
#

thats a good call

bronze yoke
#

mod data is just a table attached to many kinds of objects, the benefit being that it saves to the savefile

ripe warren
#

sadly theres no events for vehicles taking damage so I will probably have to use it at some point

bronze yoke
#

oh god, are you making vehicle armour too?

astral dune
#

errybody making armor

ripe warren
#

I am the guy you helped with the vehicle parts

#

yes I am making vehicle armor

bronze yoke
#

yeah but i didn't know what they were for

ripe warren
#

ah, well now you do :D

#

its like the main thing thats missing in the game for me

bronze yoke
#

yeah i've got a nearly finished vehicle armour mod, and anonymous has been working on some kind of vehicle damage api for like two months

astral dune
#

<_<

#

_>

ripe warren
#

yea they mentioned it not too long ago

#

I am very much looking forward to that

bronze yoke
#

i just settled for reverting damage on part updates lol

ripe warren
#

oh that, sounds like a good idea

astral dune
#

I do that for offroading damage, because that's when its calculated anyway

ripe warren
#

just check if armor is there, if yes revert damage and subtract the damage from armor piece

bronze yoke
#

yeah that's how mine works

#

anonymous has been doing some crazy extensive stuff to catch damage as it happens

ripe warren
#

so part updates happen when the condition of a part is changed?

bronze yoke
#

no, they just happen fairly regularly

ripe warren
#

oh I see

astral dune
#

ya

bronze yoke
#

less often than ontick but still pretty often

thick karma
#

@bronze yoke @quasi geode Well, sure enough, that fixed it, but I really wish I knew why it let me get away with that until the folder-name changing.

ripe warren
#

I originally wanted to make a counter so my on tick even would happen every 60 ticks, I am not sure if that would actually make any improvements performance wise, but that was my idea

astral dune
#

my mod fires an event instead. So if you hit a tree it will say "taking this much damage from tree at x,y"

thick karma
#

Never threw an error there before that, and I ran it several times...

bronze yoke
quasi kernel
#
function BetterBatteries.itemHasBatteryRemoved(item)
    local modData = item:getModData().batteryRemoved
    local isBool = type(modData) == "boolean"
    local isString = type(modData) == "string"
    return isBool and modData or (isString and string.lower(modData) == "true" or false)
end
#

This is the strangest thing I've ever had to write.

ripe warren
quasi kernel
#

oh hey wait I can remove the or false at the end

ripe warren
#

This would significantly reduce the performance impact of the code right? Since I am running the if statements only every second and only thing I am doing every tick is just that modulo operation

bronze yoke
#

you could argue isString is redundant too, unless some weird mod starts throwing a third type into your moddata

quasi kernel
#

That's true

#

Same kinda goes for the string.lower method, but really that's just extra padding to make sure it's OK

ripe warren
#

It does feel kinda pointless to be working on this, as you are working on your own armor system and Anonymous is making the events. But at this point I spent too much time on it to leave it I feel haha

bronze yoke
#

haha well i've been pretty lazy with it as i've been caught up in other projects

quasi kernel
#

Thank y'all again for the help

bronze yoke
#

only modelled about half of the them, only did test textures for one, never really thought about balance

bronze yoke
ripe warren
#

What annoys me about custom vehicles with armor is that the base game vehicles dont have armor, therefor they are not created equal. Vehicle armor only works if all the vehicles in my game have the ability to be armored up, And I have not seen a single mod that gives armor to base game vehicles

bronze yoke
#

yeah that's how i've always felt

#

i don't like when mods are inconsistent with the vanilla game, it throws me out of things

ripe warren
#

I mean, I am a 3D artist by trade. If you want any help in that regard Id be more than happy to assist

bronze yoke
#

oh that'd be great, my models are kind of crappy lol

ripe warren
#

this whole coding this is fun but frustrating as hell. I would much rather focus on the model side of things

ripe warren
bronze yoke
#

i think the part updates still fire?

ripe warren
#

okay so how do you get the vehicle to run the part update on?

#

do you just run the part update on every vehicle loaded?

bronze yoke
#

it's built into the vehicles

#

in that lua table, like the create and init functions

ripe warren
#

ooh

bronze yoke
#

i assume the java runs a part update too, and when it does it triggers a given lua function too

ripe warren
#

I completely forgot that I can define a function on the part

#

I think I can just about figure this out, but if you have a solid base and you'd want me to work on models for that Id rather start with that

ancient grail
ripe warren
#

If things just got standardized compatibility would be a cakewalk. But I doubt that would ever happen

bronze yoke
#

a build 42 vehicle rework with official armour support has been mentioned

#

i don't think they specified if vanilla vehicles will get armour then, but i've heard it's something they've wanted to do, so i wouldn't be surprised

ripe warren
#

build 42 is quite the ways away though right?

bronze yoke
#

my mod is sort of intended to be a holdover until tis does it better lol

ripe warren
#

yeah thats kinda what I had in mind too

#

Though TBF I feel like the base game vehicles could do with a rework visually in general, or at least the wheels haha

bronze yoke
#

i've heard people complain about it a lot before and i always thought they were daft, but for some reason today it really struck me that the vanilla vehicles really are too big...

ripe warren
#

too big? Thats not something I have heard before

#

I am not american so I cant really say, But cars in that era were pretty damn huge

ancient grail
ripe warren
#

an armor mod for all the vanilla cars. I was also thinking of completely remodeling all the vanilla cars but that depends on how much time I will have

#

Another thing I really wanted to add was "plow" sort of part to put in the front of your car. It would reduce the amount of slowdown you get from running over zeds

#

but I have no idea how to implement something like that so thats on the back burner

ancient grail
#

Damn my discord on mobile is crap.. anyways wrent u working in the same thing before @bronze yoke

ripe warren
#

yeah they are, we just talked about this

ancient grail
#

Ahh ok cool

#

I cant seem to scroll history on mobile
view imgs, and sometimes my msgs dont get sent.lol

thick karma
#

So I am working on a submenu right now and I'm a bit confused regarding how I need to attach functions to it... can someone help me out?

FTM.onFillInventoryContextMenu = function(playerIndex, menu, items) 
    if items[1].name == "Magic Map" then 
        menu:addOption("Jump", items, FTM.jump, playerIndex); 
        local favorites = menu:addOption("Jump to Favorite");
        local subMenu = menu:getNew(menu);        
        menu:addSubMenu(favorites, subMenu); 
        -- ???
        -- subMenu:addOption("Safehouse", {}, FTM.jump("Safehouse"), playerIndex);
        -- subMenu:addOption("Safehouse", items, FTM.jump("Safehouse"), playerIndex);
        -- subMenu:addOption("Safehouse", items[1], FTM.jump("Safehouse"), playerIndex);
    end 
end 

When I try adding the option to the submenu, I cannot seem to make it activate upon clicking the submenu item... Instead, right-clicking the parent inventory item is automatically firing my submenu function.

bronze yoke
#

add the submenu to the option, not the menu

thick karma
#

Can you clarify what that looks like? Would I do favorites:addSubMenu(favorites, subMenu)?

#

or favorites:addSubMenu(menu, subMenu)?

bronze yoke
#

hold on, i've confused myself

astral dune
bronze yoke
#

sorry, my bad, what you're doing is right

astral dune
#

not certain about the part updates, but I know for a fact the engine stops updating once its cooled down

thick karma
ripe warren
quasi kernel
#

Anyone know how the "overrides" functionality works for items?

blissful salmon
#

I asked this questions around 3 hours ago. Maybe someone who is on now has an idea if I can do that (as described clone a base shirt with own texture) or even better how I can do it. ๐Ÿ™‚

ripe warren
#

You can create a new shirt item with the same stats, Same goes for the new model with just a different texture

blissful salmon
#

I'm not sure how to do this. As I stated in the original question I don't understand how exactly the model / texture / item is linked together:
#mod_development message

ripe warren
#

in the XML file

#

"<m_BaseTextures>clothes\shirt_tshirt_textures\shirt_formal</m_BaseTextures>
</clothingItem>"

#

the texture is located in textures/clothes

#

so you just replace that with the path of your other texture

#

and assign that shirt model to your new item

blissful salmon
#

So does the item.txt -> ClothingItem = Shirt_FormalWhite, refer to the name of the xml file?

ripe warren
#

I am pretty sure yes

blissful salmon
#

But I don't want to overwrite original code. So can I copy the original folder structure to the xml files to my mod directory and place my newItem.xml in there refernce my own texture etc. I never messed with clothing so far. For normal items like weapons I used models.txt so far.

ripe warren
#

yes you should be able to

#

why not just, try it?

blissful salmon
rancid tendon
#

hey folks! putting this out here in case anyone who's online at the time might be able to give me some insight:
albion wrote most of this code for me (thanks albion!) but we ran into a rather curious issue that no one seems to be able to figure out. https://pastebin.com/bFH45JaW

this code causes containers to hugely overpopulate with cassettes (9 is the average i saw, or so) for basically no reason. as far as we can tell, it's set up properly, but even if the number in ZombRand is just 1, with only 1 item in each loot table's entry, it will seemingly spew tons of the replacement items into the container anyway

#

the code here is intended to set a customizable limit to the number of cassettes that can spawn in one container--it adds a dummy item to the loot tables of containers, and then replaces that dummy item with items chosen from the list, and it's supposed to replace them with a random number between 1 and the sandbox setting cassetteDropNumberA (which for my testing was always 1)

#

so in theory it should produce only ever one cassette per container, but for some reason it just. SPEWS them into containers

thick karma
#

omfg someone needs to write a mod that stops server from disconnecting you when you spend too long in the F11 menu istfg

bronze yoke
#

it completely pauses the game when you do that, so you're just timing out

#

i don't know if we can even touch that

thick karma
#

sigh

#

Man I am so confused about how to add the function to the submenu option

#

So easy to make it appear

#

Just can't fire it correctly

#
  local subOption = subMenu:addOption("Safehouse"); 
  subOption.onSelect = FTM.jump;

almost works, but I need to pass a parameter...

#

so I tried...

local subOption = subMenu:addOption("Safehouse"); 

subOption.onSelect = FTM.jump; 

subOption.param1 = "Safehouse";

But param1 got ignored.

blissful salmon
thick karma
#

Then I try

  local subOption = subMenu:addOption("Safehouse"); 
  subOption.onSelect = FTM.jump("Safehouse"); 

and this causes the action to fire as soon as I right-click the item (rather than left-clicking submenu entry as I want), but it does use the param correctly...

bronze yoke
#

my code uses ISContextMenu:getNew, not menu:getNew

thick karma
#

Hmmm

#

@bronze yoke I see it both ways in vanilla, but I'll try that way

rancid tendon
bronze yoke
#

yeah i'm just playing spot the difference at this point

thick karma
#

totally

#

Do you have a working example of a submenu from one of your mods I can glance at?

bronze yoke
#
local itemOption = subMenuDuplicate:addOption(item:getDisplayName());
local subMenuAmount = ISContextMenu:getNew(subMenuDuplicate)
subMenuDuplicate:addSubMenu(itemOption, subMenuAmount)
subMenuAmount:addOption('1', item, duplicateItem, 1)
subMenuAmount:addOption('5', item, duplicateItem, 5)
subMenuAmount:addOption('10', item, duplicateItem, 10)
subMenuAmount:addOption('25', item, duplicateItem, 25)
subMenuAmount:addOption('50', item, duplicateItem, 50)
rancid tendon
#

well well...

#

so one entry in a container's drop table can produce multiple of the same item

#

@bronze yoke i think we have our culprit lol

#

so then--does anyone know of a way to ensure that if an item drops in a container's loot table, it only drops one of those items?

thick karma
#
FTM.onFillInventoryContextMenu = function(playerIndex, menu, items) 
    
    if items[1].name == "Magic Map" then 

        menu:addOption("Jump", items, FTM.jump, playerIndex); 

        local favorites = menu:addOption("Jump to Favorite"); 

        local subMenu = menu:getNew(menu); 
        
        menu:addSubMenu(favorites, subMenu); 

        local subItems = ISInventoryPane.getActualItems(items); 

        local subOption = subMenu:addOption("Safehouse", subItems, FTM.jump, "Safehouse"); 

    end 

end 
quasi geode
thick karma
#

Okay cool oh crap I undid the menu: change lemme try that

bronze yoke
#

unless they broke context menus completely in one minor patch it's fine

thick karma
#

No dice ๐Ÿ˜ฆ

FTM.onFillInventoryContextMenu = function(playerIndex, menu, items) 
    
    if items[1].name == "Magic Map" then 

        menu:addOption("Jump", items, FTM.jump, playerIndex); 

        local favorites = menu:addOption("Jump to Favorite"); 

        local subMenu = ISContextMenu:getNew(menu); 
        
        menu:addSubMenu(favorites, subMenu); 

        local subItems = ISInventoryPane.getActualItems(items); 

        local subOption = subMenu:addOption("Safehouse", subItems, FTM.jump, "Safehouse"); 

    end 

end 

Any other ideas?

quasi geode
thick karma
#

(Identical behavior, I think menu and ISContextMenu are interchangeable.)

rancid tendon
#

that's what i was thinking

#

just use the system to delete any more dummies than 1 and then replace

blissful salmon
# rancid tendon https://i.imgur.com/EaR3d6S.png

I'm not that familiar with the loottable stuff I only added an item to some of the containers. It newer spawned more than one so far. But I understand it as a probability for each item that spawns in the container to be this specified item.

rancid tendon
#

i'll bug albion to help me out with it when they're less busy! i'm not smart enough to code that myself but it sounds like something that oughta be not too difficult to just have it delete any excess items

blissful salmon
#

Which container type do you check atm for the cassette? (for example: CrateCompactDiscs)

rancid tendon
#

pretty sure it runs this on all containers?

blissful salmon
#

Yes. But there is a file called Distributions.lua under media/lua/server/items/

rancid tendon
#

oh oh you mean which container type do i check when testing

#

LivingRoomShelfNoTapes

#

i currently have a stripped down testing version that only spawns cassettes in that specific kind of container with this entry:

table.insert(ProceduralDistributions.list["LivingRoomShelfNoTapes"].items, 25 * SandboxVars.MFTEOTW.lootrarityfactorA);```
blissful salmon
#

you can lookup for example shelfs in this file. there is for example:

{name="CrateCandyPackage", min=0, max=1, weightChance=40},

I assumed this can contain 1 item max. But newer checked the code... So assumed the max is 9 I expect the system to start with 1 roll which item it will be and go to the next...

#

or at least something in this direction... But I'm sure someone else knows more about this than me...

blissful salmon
astral dune
blissful salmon
#

So I would expect 4 items. But I don't really know how it works in details. But I should learn that too ๐Ÿ™‚

quasi geode
blissful salmon
rancid tendon
#

yeah, i gotcha! at this point the answer to this problem is probably to set up the system further to delete any duplicate items before it begins replacing

blissful salmon
#

This should work. You can move the inner loop outside or if it just have to be one item from the list like follows:

local function onFillContainer(_roomName, _containerType, container)
    local dummies = container:getAllType("Tsarcraft.BlankCassetteMain") -- dummy item type
    for i = 0, dummies:size()-1 do
        container:Remove(dummies:get(i))
    end

        local itemChoice = ZombRand(#itemList)+1
        local item = container:AddItem(itemList[itemChoice])
        container:addItemOnServer(item)

end
thick karma
blissful salmon
quasi geode
#

ya, at this point theres not really any point with for the dummy / replacement concept, since as Soul says the probability will jump around based on number of rolls per container. much easier to just include a ZombRand probability check in the OnFillContainer to have them spawn

thick karma
astral dune
#

lol

thick karma
#

It's not pretty, but it works.

#

I wish I could just send the damn param normally.

astral dune
#

ya, I dunno how the addOption function is supposed to work, its quite odd to me that it has param1,param2,param3 etc instead of just .... I haven't done context menu stuff in a couple months and forget it entirely

thick karma
# astral dune ya, I dunno how the `addOption` function is supposed to work, its quite odd to m...

Because they couldn't think of a way to do this with infinite params:

function ISContextMenu:allocOption(name, target, onSelect, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10)
    if #self.optionPool == 0 then
        table.insert(self.optionPool, {})
    end
    local option = table.remove(self.optionPool, #self.optionPool)
    table.wipe(option)
    option.id = self.numOptions
    option.name = name
    option.onSelect = onSelect
    option.target = target
    option.param1 = param1
    option.param2 = param2
    option.param3 = param3
    option.param4 = param4
    option.param5 = param5
    option.param6 = param6
    option.param7 = param7
    option.param8 = param8
    option.param9 = param9
    option.param10 = param10
    option.subOption = nil
    return option
end

function ISContextMenu:addOption(name, target, onSelect, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10)
    if getCore():getGameMode() == "Tutorial" then
        if self:getOptionFromName(name) then
            return;
        end
    end
    local option = self:allocOption(name, target, onSelect, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10);
    option.iconTexture = nil
    self.options[self.numOptions] = option;
    self.numOptions = self.numOptions + 1;
    self:calcHeight()
    self:setWidth(self:calcWidth())
    return option;
end
#

However, knowing this is what happens to the param1 is not helping me understand wtf it isn't working ๐Ÿ˜ญ

#

Oh well you gave me a perfect working solution so I am done worrying about it.

#

Ty again

#

Was stuck there awhile

astral dune
#

I'm sure it'll come up when I'm trying to do context stuff a month from now XD

thick karma
#

"Now you know, and knowing is half the battle." โ€” GI Joe.

bronze yoke
#

surely they could've just done option.params = {...}?

thick karma
#

Right?

bronze yoke
#

i get the feeling that the context menu code is very old because it's just a little odd?

thick karma
#

I have no idea.

bronze yoke
#

like why are the arguments first parameter -> function -> other parameters, that just seems unnecessarily confusing

thick karma
#

lol it's quite wonktastic

astral dune
#

I wonder how quick table.sort is. I have an array of objects that a vehicle has collided with, and I want to sort it... it can't be too bad, especially since the array will probably be pretty small

bronze yoke
#

i think you worry about performance far too much

astral dune
#

I play with a rtx3080 and I get like 15 fps if I drive full speed fully zoomed out, I don't want to compound that terrible performance any more than I have to, lol

bronze yoke
#

that's because of the renderer though

astral dune
#

you're not wrong

bronze yoke
#

generally, any lag from mods is coming from insanely inefficient algorithms, not using table.sort on an event

astral dune
#

it all adds up. In this case its probably not bad, but if I didn't pre-prune the list, and the comparison was expensive, it could easily cause issues

#

in fact, just getting in a vehicle a first time causes a big lag spike on my old save game, most likely because of too many mods with armor code doing their checks

quasi geode
bronze yoke
#

performance should always be a consideration in all programming! i'm just saying not to stress micro-optimisations

quasi geode
#

sure. over optimization and worrying about performance during non-critical time is pointless but in too many cases its ignored completely ๐Ÿ˜

bronze yoke
#

if this is for passing an argument for an event, consider that not sorting the table could cause multiple other mods to need to sort the table - it just depends how useful having the table sorted is

astral dune
#

for context, when a collision happens I'm scanning every square in a circle the diameter of the length of the car (possibly ~100 squares), and iterating through every object in that square to see if it is collideable. If I then sort the result by say the dot product of vectors... well now we're doing a lot of square roots and a lot of calls to the java. Its worth thinking about to cut any corners you can. You're right though, it probably won't break the bank.. .this time

bronze yoke
#

100 squares!?

astral dune
#

some modded vehicles get pretty long

#

a semi trailer could potentially collide with a lot of things at the same time, lol.

#

best I can tell from the code, the physics engine determines if there was a collision, then the java goes "oh shit the car stopped real suddenly, must have been a collision", then it does this exact process to try and find the culprit

#

its not great

sour island
#

Don't vehicles have a is in square array?

astral dune
#

if it does, it isn't using it for its own hit detection

thick karma
#

Anyone know where the campfire sitting animations are stored?

Feedback on Meditation: "I did notice that when I am 3-4 titles away from a lit campfire, my character goes into the pose then stands up right away and it keeps looping. Works everywhere else though, great job - Namaste"

smoky meadow
#

What is getType()

calm depot
#

IIRC, it returns the java class

#

akin to using .getClass().getSimpleName()

zealous wing
#

I got a question: Is there a (relatively simple) way to include water from a sink/water source into a recipe? For example:

     {    
         Toothbrush,
         Toothpaste;1,
         Water=1,
         
         Result:Toothbrush,
         Time:500.0,
     }```
Is there a way to replace the `Water=1,` with something that will refer to a water source as well, and not just any bottles/etc in your inventory?
coral lava
#

I'm thinking about developing an stone/iron mining mod, i imagine I could easily repurpose the code for cutting down trees, correct?

quasi kernel
#

At long last, I've updated Better Batteries to be marginally less garbage with unsupported mods.

#

A day and night, gone.

astral dune
#

as a test of the hit detection I started ramming another car beside a fence without ever touching the fence. It eventually broke. That's proof enough for me that it's not a false positive when I detect it, lol

astral dune
#

how do I get the current ticks?

bronze yoke
#

OnTick passes it

#

maybe have a look where that comes from

astral dune
#

IngameState.numberTicks

#

I don't see a function anywhere to get that, although if its exposed I guess I can find a way

#

maybe I'll just pass in a timestamp and ignore the ticks

bronze yoke
#

yeah i had a look around and i couldn't see a way to get to that

sour island
#

There's a timestamp that is time the game is up if I recall

astral dune
#

there is a getTimestamp getTimeStampMs, getGameTime, getTimeInMillis

#

not to mention the functions in os

bronze yoke
#

there's a getGametimeTimestamp() too, but i assume that is to do with world time

astral dune
#

I'll have to look through them all, but nothing pertinent showed up in "find usages" for that value so I dunno

bronze yoke
#

if you find a way let me know, this is gross lol

Delay.OnTick = function(tick)
    Delay.currentTick = tick
astral dune
#

well, getTimeInMillis and getTimeStampMs give the same value, and getTimestamp gives the same value but in whole seconds

#

getGametimeTimestamp gives a completely different value, so that's possibly it

bronze yoke
#

my guess is that comes from GameTime and not the session though

#
public static long getGametimeTimestamp() {
   return GameTime.instance.getCalender().getTimeInMillis() / 1000L;
}
```yeah...
astral dune
#

blegh

#

strange oversight, lol

#

IngameState doesn't seem to be exposed either, I can't get a hold of its instance. Looks like outputting ticks from an OnTick event is the only option

pale cradle
#

is there somewhere I can see what all is contained within self.deviceData? (working on the base game radios if that helps)

bronze yoke
pale cradle
#

it is, and that is what i'm looking for, thanks!

astral dune
#

had the code put little arrows where the game calculates a collision. Its, uh... unexpected

toxic sundial
#

just an idea and hear me out:
rollerblades
๐Ÿ›ผ ๐Ÿ›ผ

ancient grail
#

how do i make the sandbox option revert to its default setting?

#

is there anything i can just delete?

tardy wren
#

You can edit the file to make it default...

#

there is a resetToDefault function

#

Probably resets all of them

#

There's also the same function for the ConfigOption class

#

so SandboxSettings.SettingsPage.Setting:resetToDefault()

#

Anybody knows which Lua libraries are available for use in modding PZ?

soft sundial
#

so how do i fix the scaling and uhh rotation

#

cause its backwards and wayyyy to large

quaint mirage
#

Hey random question, is it possible to control the player name plate based on equipped items, i.e hide if wearing a mask?

fast galleon
#

Are there vanilla recipes with a success chance?
I am thinking of something like fail to convert an item, keep one of base items, remove the other. So probably have onCreate function that adds or removes the items?

fast galleon
#

also I assume if I make an item and add data it will be fine as is, and no need to sync anything, if it's in player inventory?

quaint mirage
#

I couldn't find anything in game code, would make a great mod though

ancient grail
#

Whats the best way to store an array on a string
Since they have commas ( , )
Its kinda hard to store them on files or sandboxvar

What i did was just used a diffrent delimiter which was ( @ )
Looked terrible
Esp due the fact that im storing coords

maybe someone here has a better way of doing this

#

Sample would be
"10000@5000@0",

hollow current
#

soo its been a rather relatively long time since I last modded in PZ and ngl kinda forgot most basics ๐Ÿ˜ฌ
Currently, I am trying to check if the player right clicks a vehicle and using the following code. Problem is they're being detected as IsoObject, the same as 70% of other items.

Events.OnFillWorldObjectContextMenu.Add(function(player, context, worldobjects)
    vehicle = nil

    for veh,worldObject in ipairs(worldobjects) do
        --if instanceof(worldObject, 'IsoGenerator') then
        --  vehicle = worldObject
        --end
          print(worldObject:getClass():getName())
        end

    print(vehicle)
end)```
#

Is there a rather unique identifier to them?

low yarrow
#

A Graphic for all the BloodLocations.
Might be useful for some to have the overview.

warm quiver
#

Does anyone have an idea how complicated could be or if theres already a mod that changes the initial time setting?
Somethig like this:

blissful salmon
# ancient grail Sample would be "10000@5000@0",

Whats wrong with the @ sign? Does the string have to be human readable? As long you have a delimiter that doesn't conflict with other content your fine. Depending on the content I often use ";" or "/" or "$".

hollow current
#
function ISRenameEverything:onRenameVehicle(playerObj, vehicle)
    if button.internal == "OK" then
        if button.parent.entry:getText() and button.parent.entry:getText() ~= "" then
            vehicle:getModData().renameEverything_vehicleName = button.parent.entry:getText()
        end
    end
end```

I am trying to update a vehicle's moddata using this but apparently its not working. Whenever I try to call the value, it returns nil. Am I missing something?
ancient grail
#

I wasnt able to try -

#

Its too late now the mods done

quasi geode
#

failing ; i generally go with |

rain rune
#

Thanks very much @ancient grail for the Fast Travel Mod work

For those looking for some custom mod work, he's easy to work with and communicates well. Worth the money when you need specific functionality in your servers/worlds.

thick karma
# thick karma Anyone know where the campfire sitting animations are stored? Feedback on Medit...

Anyone around today happen to know the answer to this? I'm still looking around in the files trying to figure out how the game decides to animate sitting differently when I'm by a fire, but I'm not quite understanding it... all I know is that instead of entering the ordinary sitting loop, something else happens, and as a result my custom animation for the act of sitting down (rather than the state of being down) starts looping... (and the animation that is supposed to be looping after I sit never begins looping)

bronze yoke
#

i mentioned them when we were talking about how the animation worked

#

here

thick karma
#

@bronze yoke Thanks, I had refocused on those files and decided maybe I was missing an override there... Would you expect I need to override everything in that folder with my animation to make sure it has priority (except maybe ext)? I am currently about to try that. Just got done adding a modded version of every sit-on-ground file in AnimSets/player/sitonground

bronze yoke
#

i'm not even sure if ext is used

thick karma
#

Damn no dice regardless

#

I overwrote them all but I'm still looping beside the fire ๐Ÿ˜ฆ

latent stag
#

by any chance do yall know the pz mod where you can choose to spawn with any bag and clothing item?

bronze yoke
#

that's a sandbox setting

latent stag
#

oh ok,

#

btw whats the mod

#

just wonderin

ancient grail
#

Its not a mod

fierce cipher
#

The mod was fashion montage but its broken and also obsolete. When starting a new run in sanbox enable unlock clothing I think?

thick karma
#

Anyone have any good ideas for reliably detecting a nearby (active) heat source such as a campfire or fireplace? Trying to interrupt the animation override when I'm in those scenarios since I can't make the animation work right now...

bronze yoke
#

campfires are global objects so you could use getLuaObjectOnSquare or whatever it's called and it'd probably be a lot cheaper than scanning squares for objects, not sure if there's a similar workaround for fireplaces though

thick karma
#

I think I can hook function CGlobalObjectSystem:getLuaObjectByIndex(index), determine whether the target is a lit thing, and if it is, determine whether it's near a player, and if it is, disable my animation override

#

If anyone is reading this and sth please tell me a better way lmao

bronze yoke
#

the thing is, if you can't find a similar thing with fireplaces (i don't think they're global objects) then you're going to have to loop through nearby objects anyway and this is pointless

thick karma
bronze yoke
#

what i mean is if fireplaces can't be found easily too you're going to have to loop through isoobjects in range of the player, and at that point using global object functions isn't really saving any performance

thick karma
#

I see... so they may have the same animation effect but one is not in the lua objects...

bronze yoke
#

yeah, campfires are global objects so we can use that shortcut but it looks like fireplaces are just java

thick karma
#

Hmmm... so it looks like in Lua I can check if a fireplace is lit like this??

  function ISMoveableSpriteProps:getInfoPanelFlagsPerTile( _square, _object, _player, _mode )
        . . .
        if instanceof(_object, "IsoFireplace") then
            InfoPanelFlags.tooHot = InfoPanelFlags.tooHot or (_object and (_object:isLit() or _object:isSmouldering()));
        end

Question is, what is that object?

#

and how is it sent...

astral dune
#

an IsoFireplace. You should be able to search for usages of that function to see how its normally provided its inputs

thick karma
#
for i=1,square:getObjects():size() do
  local object2 = square:getObjects():get(i-1)
  if instanceof(object2, "IsoFireplace") then
    fireplace = object2
  end
end

Hmmm maybe bingo?

astral dune
#

ya, you'll have to do that on every square nearby, its how PZ handles a lot of these kinds of checks, its also how I'm currently determining what objects people hit with a car

thick karma
#

@astral dune Fair enough. Do you think it would be prohibitively slow to check for lit stuff in a 10x10 centered on the player? Seems like a lot of checking just to activate the animation

#

Gotta be an easier way...

astral dune
#

it looks like in the Java they combine all the flags into a single field per square, so they can simply run one check per square to see if tooHot is active anywhere in the square, for example. We don't seem to be able to do the same so we have to iterate through every object in the square. There is typically only a couple objects per square, but that's still a couple hundred checks, you don't want to do it too often

thick karma
#

Ooooooof.

#

Crap.

#

So that's why they can check so much faster for whether heat is near me? They really don't keep heat sources separate?

#

Sheesh

astral dune
#

doing it once, when they sit down, then keeping a reference to the fireplace you found to check if its state has changed while they're sitting, its probably as performant as you can make it. Will still break if someone builds and lights a fireplace beside you while you're meditating but what are the chances of that? lol

bronze yoke
astral dune
#

the type of flags I was looking at I couldn't, but it looks like there are different collections of flags. the InfoPanelFlags in his code snippet looks like its accessible

thick karma
bronze yoke
#

i would be shocked if doing one nearby object scan caused a significant lag spike

astral dune
#

ZomboidBitFlag was the container I was not able to access before, for checking if a lightswitch was present in a square

bronze yoke
#

the range can't be too long right? you have to get pretty close to the campfires

astral dune
#

ya, its should be fine to run once while sitting, just don't run it every tick of the meditation, haha

thick karma
#

Alright, trying THIS...

Yogi.manhattan = function(x, y, z, a, b, c)
    return math.abs(x - a) + math.abs(y - b) + math.abs(z - c)
end

Yogi.warming = function(player)

    local squares = {}

    for x = -5, 5 do
        for y = -5, 5 do
            for z = -5, 5 do
                squares[x .. ", " .. y] = getSquare(player:getX() + x, player:getY() + y, player:getZ() + z)
            end
        end
    end

    for location, square in squares do
        for index = 0, square:getObjects():size() - 1 do

            local object = square:getObjects():get(index)

            if instanceof(object, "IsoFireplace") then
                if object:isLit() then

                    local x = player:getX()
                    local y = player:getY()
                    local z = player:getZ()

                    local a = object:getX()
                    local b = object:getY()
                    local c = object:getZ()

                    if Yogi.manhattan(x, y, z, a, b, c) < 15 then
                        return true
                    end
                end
            end
        end
    end

    local campfireData = SCampfireSystem.instance

    if not campfireData then return false end

    for index = 1, campfireData:getLuaObjectCount() do
        local luaObject = campfireData:getLuaObjectByIndex(index)
        local object = campfireData.system:getObjectByIndex(index - 1)
        if luaObject.isLit then
            local x = player:getX()
            local y = player:getY()
            local z = player:getZ()

            local a = object:getX()
            local b = object:getY()
            local c = object:getZ()

            if Yogi.manhattan(x, y, z, a, b, c) < 15 then
                return true
            end
        end
    end
    return false
end
#

Crossing fingers, what a cluster.

fast galleon
#

wonder if I should mention not to SCamfire on client side

thick karma
#

Huh why not?

#

It doesn't exist clientside?

#

Well I am loading up so I am about to find out the hard way, regardless...

#

Shit I wrote .getX facepalm

thick karma
#

๐Ÿ˜ญ

#

Maaan I'm gonna have to send server commands just to tell players where these campfires are...

#

Mega-oof

blissful salmon
#

I still struggeling with my problem from yesterday.
#mod_development message
So far I tried it this way:
#mod_development message
but I didn't manage to bring it to work. I copied the original shirt item to my mod and renamed the ClothingItem according to my new named xml.
When I mouseover the shirt in the inventory I get the following exception:

STACK TRACE
-----------------------------------------
Callframe at: se.krka.kahlua.integration.expose.MultiLuaJavaInvoker@5c5568e3
function: render -- file: ISToolTipInv.lua line # 108 | Vanilla

ERROR: General     , 1669323908447> ExceptionLogger.logException> Exception thrown java.lang.reflect.InvocationTargetException at GeneratedMethodAccessor456.invoke.
ERROR: General     , 1669323908447> DebugLogStream.printException> Stack trace:

...

Caused by: java.lang.NullPointerException: Cannot invoke "zombie.core.skinnedmodel.visual.ItemVisual.getHole(zombie.characterTextures.BloodBodyPartType)" because "<local14>" is null
    at zombie.inventory.types.Clothing.DoTooltip(Clothing.java:215)
    at zombie.inventory.InventoryItem.DoTooltip(InventoryItem.java:619)
    ... 45 more

My files look like this:
scripts/clothing/shirts.txt

module SoulMod
{
    item Shirt_FormalWhitePent
    {
        DisplayCategory = Clothing,
        Type = Clothing,
        DisplayName = Formal Shirt Pent,
        ClothingItem = Shirt_FormalWhitePent,
        BodyLocation = Shirt,
        Icon = ShirtGeneric,
        BloodLocation = ShirtLongSleeves,
        Insulation = 0.25,
        WindResistance = 0.15,
        FabricType = Cotton,
        WorldStaticModel = Shirt_Ground,
    }
}
#

clothing/clothingItems/Shirt_FormalWhitePent.xml

<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
    <m_MaleModel></m_MaleModel>
    <m_FemaleModel></m_FemaleModel>
    <m_GUID>ac7976de-2c73-44ea-9392-5d24ac1fb649</m_GUID>
    <m_Static>false</m_Static>
    <m_AllowRandomHue>false</m_AllowRandomHue>
    <m_AllowRandomTint>false</m_AllowRandomTint>
    <m_AttachBone></m_AttachBone>
    <m_BaseTextures>clothes\shirt_tshirt_textures\shirt_formalPent</m_BaseTextures>
</clothingItem>

textures/clothes/shirt_tshirt_textures/Shirt_FormalPent.png (binary)

I don't even know if this is even possible or at least a good approach. Maybe its easier to create a new model...

fast galleon
thick karma
#

That moment when you accidentally fixed the problem you didn't know you could fix... (???)

#

The ironic thing here is that my immediate goal was to stop this animation from happening altogether...

#

But instead it just... worked the way I originally intended...

#

I have no idea wtf

#

So... confused...

#

It's as if the animation gets triggered, and then the game starts trying to trigger the animation again over and over... but at that point my protection is intervening and saying, "No, we shouldn't be running that animation because we're near a fire..." and yet it is already running that animation next to a fire... I just... what?

#

I wonder if it's actually because it's raining or something... maybe the fire isn't having its normal effect...

#

Omfg. @bronze yoke @astral dune I fixed my problem so damn long ago and didn't even know

#

Fixing the other animation files COMPLETELY worked.

#

I didn't NOTICE because I was still subscribed to my workshop mod.

#

And it wasn't a lua conflict, so the checksum never warned me of the difference.

#

My bad, am super dumb.

#

All those loops were pointless and unnecessary lmao

#

sigh

#

They just triggered the Lua checksum conflict that led me to disable my workshop sub.

bronze yoke
#

๐Ÿ˜”

thick karma
#

My bad... thanks for putting up with me.

weak sierra
#

do any other files store anything related to zpop or zombie settings besides those prefixed with zpop

late hound
blissful salmon
hollow current
#

nvm i just realised I never passed the button into the function

blissful salmon
#

I also have an other question. I want to create a candle like item which can be held in hand or be placed in the world. The first part with holding it in the hand seems to work but what do I have to do now? Do I have to create kind of a worlditem like a lamp and use the "pickup/place" actions on the left pane. Or can I go with the normal place function from the context menu. I want the the item to be able to switch on or of if "placed" in the world.

hollow current
#

How do you reverse

local playerObj = getSpecificPlayer(player)``` and use PlayerObj to get player?
bronze yoke
#

playerObj:getPlayerNum()

hollow current
#

tyy

#

Can you put a character limit in a textbox? Also how do you check if player is currently in Singleplayer or Multiplayer?

terse grove
#

anyone know of a mod where you can clean stuff with water instead of bleach

blissful salmon
#

and then you can check:
if SoulMod.isSoloGame then ...

#

of course you use your mod name ๐Ÿ™‚

hollow current
#

Thanks!

thick karma
#

Is OnFillWorldObjectContextMenu used for populating the context menu that appears when you simply right click the ground?

fierce cipher
#

How yould you guys rank the difficulty of modding in these items from scratch?

  • Weapon/tool
    -Firearm (crossbow)
  • Hooded jacket
  • Bag
    I plan on making all of these but Im new to pz modding so Id like to start from easiest and work my way up
exotic crane
#

Good evening, returning player here, is there some kind of compilation here for working mods for singleplayer? I really want to go back playing in this game but i can't help myself but install mods. and Now my character won't pick up or transfer any items ๐Ÿ˜ฆ

thick karma
bright drift
#

Hey guys so I'm fairly new to this but I'm currently working on editing a tool tip. I wanted to add another line of text so i added it to my translation and i get it to show no problem, even have break working correctly. Now Im being picky because i would like to turn my one getText() red. Is this possible? What would be the code format?

vapid hull
#

hey guys, what could this mean when uploading a workshop map for the first time?

thick karma
bright drift
#

your kidding lmao

#

k thanks

vapid hull
bright drift
# bronze yoke ``<RED>``

local testTooltip = getText("IGUI_Tooltip_Warning").."\n".."\n".." "..getText("IGUI_Tooltip_Start").."\n"

#

where would i insert that lol

bronze yoke
#

before the part you want to be red

bright drift
#

i keep trying to insert it and i reload the lua in debug and it fails. so im missing something

thick karma
fierce cipher
#

Is it possible to add leather to animals after theyve been butchered?

vapid hull
sick vault
#

Hi I wanted to make custom professions and stuff where would I start?

ancient grail
#

Is it possible to toggle enable/disable mods from a another mod

#

Like sandbox option

#

Like getactivatedmod("modname):disable()
Perhaps

thick karma
thick karma
#

If you flatten before exporting in Gimp, poster and preview should be fine using default export settings for png

#

@vapid hull but if you actually forget to flatten, the depth may be wrong, and if so the upload will fail

thick karma
quasi kernel
#

Is setting a condition on a weapon a thing?

thick karma
#

check ProjectZomboid\media\scripts\items_weapons.txt

#

I don't know items that well but I know the weapons have a lot of defined properties in that file

quasi kernel
#

Many thanks

thick karma
# blissful salmon I also have an other question. I want to create a candle like item which can be ...

If I wanted to switch a candle on and off in the world, I might model it on the light switches:

ISLightContextMenu.doMenu = function(player, context, worldobjects, test)
  if test and ISWorldObjectContextMenu.Test then
    return true
  end

  local thump = nil
  local square = nil

  for _, v in ipairs(worldobjects) do
    square = v:getSquare()
    if instanceof(v, 'IsoThumpable') then
      if not v:haveFuel() then
        if v:getModData()['IsLighting'] then
          thump = v
        end
      end
    end
  end

  if test then
    return ISWorldObjectContextMenu.setTest()
  end

  if thump then
    if thump:isLightSourceOn() then
      context:addOption(getText 'ContextMenu_Turn_Off', thump, ISLightContextMenu.onToggleThumpableLight, player)
    elseif thump:getSquare():haveElectricity() or (SandboxVars.ElecShutModifier > -1 and GameTime:getInstance():getNightsSurvived() < SandboxVars.ElecShutModifier) then
      context:addOption(getText 'ContextMenu_Turn_On', thump, ISLightContextMenu.onToggleThumpableLight, player)
    end
  end
end

Events.OnFillWorldObjectContextMenu.Add(ISLightContextMenu.doMenu)

I doubt it gets a lot more straightforward than this...

quasi kernel
#

Welp I just crashed zomboid for the first time trying to get Magnet Fishing to work.

thick karma
#

Yaaay!

quasi kernel
#

First time for everything huh?

#

Famous last words of zomboid: "LOG : General , 1669373818058> Final tier was 2"

thick karma
#

Truer words have rarely been spoken

#

LOG : General , 1669373818058> Final tier was 2, indeed, Zomboid. LOG : General , 1669373818058> Final tier was 2, indeed.

quasi kernel
#

It's refreshing talking to another human being after pulling an all nighter

normal kite
#

hello. i'm looking for information about ProceduralDistributions.lua file..

does anyone know where to find it?

i want to add some item on my PZ game

thick karma
#

Lol what you don't like one-way communication with error message windows? @quasi kernel

quasi kernel
#

I had some info on ProceduralDist but it's not coming to me atm, apologies

#

Also, the error message window wasn't very chatty. Very unfortunate.

#

Now I get to spam the ever loving crap out of prints until I figure out what's crashing

thick karma
normal kite
#

thank you!

thick karma
#

In general, using Windows search in Steam\steamapps\common\ProjectZomboid\media will find a lot of the files you need while modding. A lot of others will be on https://zomboid-javadoc.com/41.65/

#

@normal kite

normal kite
#

thank you, can i hav one more question?

thick karma
#

Haha they say never ask to ask in places like this

#

Even if I don't know someone else might

#

But I am lurking

dreamy flicker
dreamy flicker
#

started down the path of adding a manifest.mf file using gradle, which the project uses, but I'm coming up short. Last time I switched the project over to Maven in order to add the manifest and that worked, but this time I have decided to pause and ask more about this error

tacit ermine
#

er let me look, it's been a while since I worked on that code

shadow geyser
tacit ermine
#

how are you launching the game with the jar exactly? it should be the aspectj JAR you pass to the -javaagent option in the game JVM options, and pz-extender-framework.jar should be on the classpath

dreamy flicker
#

so I'm on linux (if that matters at all)

 "vmArgs": [
                "-javaagent:/Path/To/Your/Artifacts/pz-extender-framework.jar",
                "-javaagent:/Path/To/Your/Artifacts/pz-extender-api.jar",
                "-Djava.awt.headless=true",
tacit ermine
#

yeah so the -javaagent option should point to an aspectj JAR and the extender JARs themselves should be specified on the classpath via a -classpath option, let me see if I have a premade configuration file

dreamy flicker
#

ah, that was the aop.xml file I saw, gotcha

#

yeah if you have an example of the launching args, I would love that

rugged flicker
#

PhysicsObject thing is hardcoded?

tacit ermine
# dreamy flicker yeah if you have an example of the launching args, I would love that

sorry, don't have a ready made example right now (and actually it doesn't look like I left this in a place where you can just drop it in and get going), I can put one together and update the repo when I'm back from work. For now here's a rough outline:

you can also start the game with Gradle via gradle pzLaunch64 and see the full list of options it constructs

thick karma
#

@ember kernel Hey I saw your message on my mod this morning and I was hoping you might be able to touch base with me about some of the mods your running. I think the smoking issue may be a conflict but I'm not sure.

#

I am testing now, and the mod seems to be working... I do not become a nervous wreck in seconds even with smoker trait, although if I artificially increase the time since last cigarette I CAN make my stress level start rising while meditating

#

But it does not happen in seconds... it would take probably 10 minutes minimum at the rate it's going...

ember kernel
thick karma
#

Hmmm I have had issues with More Traits in the past. I will take a look at it. I stopped running that mod because it was throwing exceptions for me

#

I have not yet tested alongside Green Fire but I'll do that first since I have it

#

Failing that, I may have you send me server config so I can just check the error log

ember kernel
#

One thing to note as well, I've only had it happen occur once and that was when I first booted my server with your mod

thick karma
#

Hmmm intriguing

ember kernel
#

Haven't had it happen again so far though

thick karma
#

I do not initialize any player stats or anything crazy

#

So i'm not sure why that would occur only once...

#

Veeery odd.

ember kernel
#

The thing is I might be the only one who experienced it so I don't think you need to investigate it further for now

thick karma
#

For sure. Please feel free to DM me if you get any more data on that.

ember kernel
#

I'll make sure to leave a comment again with more info and a potential log file if it does happen again though!

thick karma
#

I like to make my mods as error-free as I can

#

If we can reproduce the bug I'll kill it

#

I may actually add a bonus drain for smokers tbh

#

I think it's reasonable to let players meditate instead of smoking.

#

That's a thing people actually do.

#

(Just bonus stress drain)

dreamy flicker
#

sorry to be a pain @tacit ermine but when I run that gradle task I get No main class specified and classpath is not an executable jar.

thick karma
#

@ember kernel It's a conflict with jigga's Green Fire but I have no idea how off the top of my head. Pretty sure it's something that mod does, rather than something my mod does, mainly because my mod has no existing mechanism for (A) arbitrarily setting stats to faraway levels, and (B) increasing any of these negative stats in the first place.

#

my adjustments are all relative adjustments:

            if player:getStats():getFear() > 0 then
                local currentFear = player:getStats():getFear()
                local newFear = math.max(0, currentFear - meditationVars.fearRecovery)
                player:getStats():setFear(newFear)
            end
            if player:getStats():getPanic() > 0 then
                local currentPanic = player:getStats():getPanic()
                local newPanic = math.max(0, currentPanic - meditationVars.panicRecovery)
                player:getStats():setFear(newPanic)
            end
            if player:getStats():getAnger() > 0 then
                local currentAnger = player:getStats():getAnger()
                local newAnger = math.max(0, currentAnger - meditationVars.angerRecovery)
                player:getStats():setFear(newAnger)
            end
            if player:getStats():getStress() > 0 then
                local currentStress = player:getStats():getStress()
                local newStress = math.max(0, currentStress - meditationVars.stressRecovery)
                player:getStats():setStress(newStress)
            end
            if player:getBodyDamage():getBoredomLevel() > 0 then
                local currentBoredom = player:getBodyDamage():getBoredomLevel()
                local newBoredom = math.max(0, currentBoredom - meditationVars.boredomRecovery)
                player:getBodyDamage():setBoredomLevel(newBoredom)
            end
            if player:getBodyDamage():getUnhappynessLevel() > 0 then
                local currentUnhappiness = player:getBodyDamage():getUnhappynessLevel()
                local newUnhappiness = math.max(0, currentUnhappiness - meditationVars.happinessRecovery)
                player:getBodyDamage():setUnhappynessLevel(newUnhappiness)
            end
#

They get the current value, then adjust it by the sandbox variable for that value.

#

There is no way for them to increase these values because the delta gets subtracted and the delta is strictly nonnegative.

quasi kernel
#

it works

#

IT WORKS

thick karma
quasi kernel
#

Only thing I need to do is make fished up water containers have tainted and we're done

#

Just gotta adjust the loot tables and make a thumbnail from there

ancient grail
thick karma
#

I can make it higher than .509 etc., but I cannot make it lower.

#

By the way, when I joined with jigga's mod, it immediately increased panic, stress, unhappiness, and boredom for me. @ember kernel

ancient grail
quasi kernel
#

I thank

#

Is there a way to check if something is water-

#

oh, isWaterSource

tacit ermine
thick karma
#

@ember kernel I solved it, thank you SO much for reporting that issue!

#

There is a separate getStressFromCigarettes component of getStress that has to be individually zeroed.

#

Updating mod soon.

ancient grail
#

Why cant i change the display name using doParam?

tired pilot
#

anyone know a mod that is a xp multiplier for singleplay?

grim rose
#

heh

#

ya all

#

i have question

#

i know what means when object calls null

#

aka it calls nothing

#

but what in hell means calling nil

#

null2?

slender hollow
grim rose
#

anyone will give me any help how to fix this issue i have

tired pilot
grim rose
dusk sonnet
grim rose
#

Ah i see

#

A value that is declared but not usable

ember kernel
thick karma
#

@ember kernel I pushed the update. Be aware that I made invisibility OFF by default, so please jump into sandbox options and enable the new One With The Force option if you like that ability.

#

I do NOT know if it fixes the spawn-with-higher stress issue, however the mod DOES allow you to meditate away smoking stress now, so in theory it should not be a major issue if that only happens once when players first install the mod. I cannot trigger the issue anymore, so I'm not even sure it can still be triggered, but I did not consciously fix that, so I have no way of being sure.

bright drift
shadow geyser
bright drift
# shadow geyser thats wierd, I wonder why it didnt work for you. the <RED> tag is used quite alo...

Yea so heres how i had to do it (if anyone cares) I was modifying skill journal to be consumed on read and wanted to insert a tooltip to warn the players

require "ISUI/ISToolTipInv"
local tooltipWarning = getText("IGUI_Tooltip_Warning")
local function drawDetailsTooltip(tooltip, tooltipWarning, tooltipStart, skillsRecord, x, y, fontType)
   local fnt = {r=0.9, g=0.9, b=0.9, a=1}
   tooltip:drawText(tooltipWarning, x, y, fnt.r, 0, 0, fnt.a, fontType)
   tooltip:drawText(tooltipStart, x, y+20, fnt.r, fnt.g, fnt.b, fnt.a, fontType)
   tooltip:drawText(skillsRecord, x+20, y+40, fnt.r, fnt.g, fnt.b, fnt.a, fontType)

end
unique harbor
#

How do I know if a event is clientside or serverside?

shadow geyser
bright drift
#

uhhh not specifically is it better practice to keep drawtext calls low? Im new to this so im not really aware of best practices

shadow geyser
#

well the description is normally where you would put the text you want displayed. you should be able to properly use the text tags like the <RED>, RGB:#,#,# or <LINE>

#

I guess as long as you get it to look like what you want, it shouldnt make a difference. I don't think there is a "problem" doing it that way, but in future, its probably easier to just do that rather than all the extra work with the drawtext calls

#

it also will handle the width and length and the newlines for you, so you don't need to set them

fast galleon
#

tag will work if you put text somewhere where rich text is used, otherwise it's just text, here it makes sense to use the rgb to drawText.

#

if it works, it works

#

don't break it

bright drift
#

lol ^

#

i uh will look at that route - so its just editing the item script in "media/scripts" right? and whats the new variable i add for description? Silly to ask but is there a resource for this?

fast galleon
#

ISTooltipInv use java to make the tooltip, right? But it also uses the tooltip txt of item.

bronze yoke
bright drift
#

it does not uses "tooltip =" in the item it manifests its own tooltip window from the dependency

#

im looking into this deeper and im seeing what you guys are saying just taking a minute to wrap my head around it

fast galleon
#

You can add a line to item with setTooltip(string), but I don't know if it will convert the tag.

ancient grail
ancient grail
bronze yoke
#

if the request for the name is coming from lua (and as far as i know that's the only place the names are used), you can hook the get name function

ancient grail
bronze yoke
#
do
    local metatable = __classmetatables[zombie.inventory.types.Literature.class].__index
    local old_getName = metatable.getName
    function metatable.getName(self)
        if getNumActivePlayers() == 1 and Literacy.PlayerHasReadBook(getPlayer(), self) then
            return getText('IGUI_ReadIndicator', old_getName(self))
        end
        return old_getName(self)
    end
end
```this is an item name override i wrote for my literacy mod, you'd have to change a few things like the type being overwritten and how you check if you need to overwrite it but this should be a decent guide
astral dune
#

๐Ÿค” never seen __classmetatables before

bronze yoke
#

you can use it to overwrite kahlua's reference to java functions

astral dune
#

same result as calling getMetatable on an instance of the object, but without requiring an instance, I assume

#

little confused as to how zombie.inventory.types.Literature.class works without quotes

bronze yoke
#

we're getting the value of zombie.inventory.types.Literature.class, not using 'zombie.inventory.types.Literature.class' as a string key

astral dune
#

so there is a _G.zombie.inventory.types.Literature.class variable?

bronze yoke
#

honestly i have no idea, i didn't actually notice that before but this is tested code so there must be

astral dune
#

hmm, I wonder if that will somehow let me get my hands on IsoGameCharacter... I can't remember why I need it, but it seemed important at the time

bronze yoke
astral dune
#

its type is userdata I assume?

bronze yoke
#

yeah

astral dune
#

interdasting. Provided getClassField() works on those "classes" that could save a lot of hassle. I'll give'r a go when I get home

fast galleon
#

albion I am seeing an issue with vanilla read timed action, I use speed up to read faster but when I hit esc time keeps going on fast, and I just realised my option is reset for timed actions

#

lol

astral dune
#

anyone know a good online lua 5.1 interpreter? Trying to test some setfenv getfenv stuff but all the interpreters I have found are 5.3 which doesn't have those functions anymore

shadow geyser
shadow geyser
#

I think the proper to do it, if it is just simple text and not anything dynamic, is to use a tooltip_EN.txt files, and you would insert the text there. then you can use just the item definition to have the tooltip = Tooltip_youritem. then in the translation file a line with Tooltip_youritem = "tooltip text here". so depending on what you are doing this might be the "better" way to do it.

unique harbor
#

How do I know what a event got replaced by? For example it says OnBeingHitByZombie is obsolete but what replaces it?

fast galleon
#

Would you consider it a bug that ISBasetimedAction:setTime(time) doesn't actually set the time on the java action?
This was so confusing for me when I started modding, I had no idea why it didn't work.

unique harbor
#

What's a good way to debug / test a multiplayer mod that involves other players?
Like the mod isn't uploaded to workshop, how would I test it with a friend?

dry quail
#

I've been stuck trying to find why my attachments rotations aren't applied the same for the worldmodel of the weapon and when it is actually equipped or stowed on the back.

astral dune
unique harbor
astral dune
#

did the old event tell you who the attacker was?

#

damage type is what I was referring, because it includes other damage besides zombies

unique harbor
#

It actually didn't tell me anything about zombie attacks, only bleeding when i got attacked by a zombie

astral dune
#

its a shame really, because from the java code it would be very easy to pass a parameter with some sort of identifier, but they don't ever do that. So you're left with scanning the area and making an educated guess, or just not doing anything with the source of damage at all

unique harbor
#

Also kinda shocked how much of a steep learning curve modding in this game has, like you get so little information ๐Ÿ˜…
you don't even know if a function / event is client or serverside, one event even told me it's not client and server lol

bronze yoke
#

it's kind of silly i think... what's the point of the lua function if it doesn't change the java time?

#

so maybe it is a bug, but TIS usually don't want to fix minor things that don't affect vanilla

astral dune
#

the lack of documentation is a bit of a problem, but I find it easier than java modding once you have the info

unique harbor
#

I'm kinda used to gmod documentation or in general some kind of good documentation that tells you what everything does, example and what realm it can run at client / shared / server

ancient grail
unique harbor
ancient grail
#

Ye

fast galleon
unique harbor
# ancient grail Ye

I tryed using it with OnWeaponHitCharacter in a client lua and it told me both client and server false or do I have to use the code in a shared lua for that?

bronze yoke
fast galleon
#

I used to just cancel the action and start a new instead before.

unique harbor
astral dune
#

if you want to see how it works in MP, ya

bronze yoke
#

yeah u_u

unique harbor
#

Damn alright..

bronze yoke
unique harbor
#

How would I test a mod that involves a other player when it's not in the workshop?

ancient grail
bronze yoke
#

i usually run a dedicated server locally and two clients

astral dune
#

^

dry quail
ancient grail
#

Directly from you

smoky meadow
unique harbor
dry quail
astral dune
#

you'll have to send him the files manually

unique harbor
#

bruh

bronze yoke
astral dune
#

auto download is workshop only afaik

bronze yoke
#

yeah i think so too

astral dune
#

you can throw it on the workshop as unlisted

ancient grail
#

It wont if its not. So you have to manually send em the file

#

Which is a pain. . so just upload it

unique harbor
#

Can't I just host with one client and join with another? so I only have the mod once and don't have to sync it? ._.

stark pivot
#

for some reason whenever i try to make a world with mods in mp it keeps copying the file and removing all the mods when i got to load it, it makes a compleatly seperate instance (fixed)

bronze yoke
#

the launch option -nosteam will do that

unique harbor
#

ah thx, was just about to ask that. Do both clients have to be nosteam?

astral dune
#

don't they have to be anyways just to launch multiple instance?

bronze yoke
#

yeah, non-steam clients can't join steam servers

bronze yoke
dry quail
#

@smoky meadow based?

pure pollen
#

How would I add Night Vison to a face mask?

#

Is it like adding bite defense, and Insulation in script file of the mod?

unique harbor
#

Can I somehow make the second account admin so both can join with debug mode?
or do I really have to host a seperate server for that?...

#

Damn I just got the nausea moodle in real with that solution

fallow crater
#

are there like... must-have mods that are widely accepted in all multiplayer?

bronze yoke
#

/setaccesslevel username admin

gilded hawk
#

How are building stories handled?

Like, how does the game pick if a house is burned down or something?

unique harbor
bronze yoke
#

in the in-game chat, as long as the player typing it has admin of course

#

or, wait, actually

#

if you're hosting in game, i don't know if access levels save...? i remember having an issue like that, i think that's why i started using dedicated servers to test

unique harbor
#

Do you always copy the mod over then?

#

When you make changes

bronze yoke
#

the server loads mods from the same user directory as the client does

unique harbor
#

Ahh okay but can you reload the lua while it runs or do you have to restart?

bronze yoke
#

you can reload files on the server manually using a command (something like reloadlua directory/file.lua) and if you disable the checksum you can just rejoin when you change the client files

unique harbor
bronze yoke
#

it'll only reload the copy on the server, so unless it's server-only code that won't work

astral dune
#

you can reload the client code as well from the client terminal, I believe

#

not sure if you need the debug terminal or just the chatbox with admin rights

unique harbor
smoky meadow
dry quail
smoky meadow
dry quail
#

But if its for your own mod, when exporting your silencer/weapon part make sure these are unchecked so that both your ground attachement and in hand attachment follow the same axis

#

In blender*

dry quail
#

I'm using 2.92, but can't you upgrade/ download a portable blender instance if you want to absolutely keep a 2.79b instance

smoky meadow
dry quail
#

ahahah I feel ya, my blender skills are questionable at best

smoky meadow
#

after months of making guns nonstop i try to make custom shooting animations but i didn't find any 2.79b tutorial of it, but a newer versions have. so i give it a try, when i try the newer version it felt alien to me. the new mechanics are confusing.

dry quail
#

I'm guessing a lot of ui changes happened between those 2 version? I'm sure the keyboard shortcuts are the same tho, if you are familiar with those you shouldn't feel too far from home

smoky meadow
dry quail
#

is there an export menu? Thats where the options are for me

#

file export->fbx

fast galleon
gilded hawk
fast galleon
#

doable

#

I know to set chance for sure and there is a alwaysdo parameter

gilded hawk
#

Interesting, cause I was looking for a way to burn down all the buildings

#

And I know there is a building story for it

fast galleon
#

RandomizedBuildingBase is the java base

#

there are 3 burned stories

gilded hawk
#

Oh wait, RBBurnt, RBBurntCorpse, RBBurntFireman

fast galleon
#
        for i=1,getWorld():getRandomizedBuildingList():size() do
            local story = getWorld():getRandomizedBuildingList():get(i-1)
            if instanceof(story,"RBBurnt") or instanceof(story,"RBBurntCorpse") or instanceof(story,"RBBurntFireman") then
                print("test fires 2: story chance",Fires.SandboxRandomChance[SandboxVars.WorldOnFire.RBBurnt])
                story:setChance(Fires.SandboxRandomChance[SandboxVars.WorldOnFire.RBBurnt])
            end
        end
gilded hawk
fast galleon
#

it's in my mod

gilded hawk
#

๐Ÿ˜ฎ

#

Can you share a link please?

fast galleon
#

I haven't updated it in a while

gilded hawk
#

This looks good enough, thank you!

dry quail
#

Did you apply the transforms? meaning scales are all at 1.0, rotation and position is at 0 for each axis?

smoky meadow
dry quail
#

hmmm, and what if you import it in 2.92 and just export the same model with the options I sent you?

smoky meadow
fast galleon
gilded hawk
undone elbow
#

Does it work from server side? lua player:getInventory():AddItem(item);

brisk pilot
#

hey kinda new to programing does anybody know how to make a script that shutsdown the server when theres no players

bronze yoke
#

there's a few mods that shut down the server when mods need updates, have a look at how they do it

astral dune
#

I just wish one of these interpreters would give you the opportunity to mess with require

brisk pilot
bronze yoke
#

udderly up to date does it

dreamy flicker
astral dune
#

why would I when clean simple interpreters exist that I don't have to compile or store? haha

quasi geode
#

lol. well you dont need to compile, getting precompiled binaries is simple enough. but sure you'd have to store it, but at least then you wouldnt have to hunt around looking for online versions wishing for features that are missing XD

#

not like a lua installation is large

astral dune
#

I wouldn't know, I haven't tried to look for prebuilt binaries, with a nice gui like Haskell has so I don't have to set up another dev environment, etc etc

quasi geode
#

being mainly a debian linux user, i'm lazy and get to apt-get install them. my dev machine keeps 5.1, 5.2 and 5.3 installed

astral dune
#

The LuaBinaries files are intended for advanced users and programmers who want to incorporate Lua in their applications or distributions and would like to keep compatibility with LuaBinaries

#

ya, lots of dev stuff is easier in linux

quasi geode
#

lol

astral dune
#

I've had a vendetta against python ever since a university course I took expected you to know it even though there was no other course that taught it or required it, lol

#

"you don't know python? Well I suppose I could let you write your course work in jython"

quasi geode
#

lol. ya i ended up learning it because it was a requirement for a course

astral dune
#

should learn it someday, it does seem to get used everywhere

quasi geode
#

yep its worthwhile to know

gilded hawk
#

Did anyone found where TIS is doing the check for the count of rooms in a building for the random stories?

I'm referring to this from the "Update 41.78 Patch Notes"

Disabled some Randomized Survivor Safehouses from occurring in instances where a building has over 10 rooms, or is a spawn location.
The limit is 10 for some and 20 for other Randomized Survivor Safehouses.
This also means the Toilet Paper story is now disabled in buildings that have over 10 rooms or are spawn locations, which will likely reduce the amount of Reddit posts about it by 50%.
#

If found the line for the room check inside java\randomizedWorld\randomizedBuilding\RBOther.java

But I'm still struggling to figure out how to re-enable it or manipulate it, I would like to re enable this "feature/bug" and make it so you can decide to spawn in a specific story

astral dune
#

Once you figure it out, please make a mod where every house is a toiletpaper house

gilded hawk
#

I'm trying to make that everything is burned down, but I will also do that ๐Ÿ˜›

astral dune
#

lol

gilded hawk
#

So, for my understanding

The code that handles the random stories is inside java\randomizedWorld\randomizedBuilding\RandomizedBuildingBase.java and inside java\randomizedWorld\randomizedBuilding\ are all the building stories.
Inside java\randomizedWorld\* are also the random survivor and vehicle zones

little dust
#

got my modlist working heck yeah

deft falcon
#

is there a way to, say, get a table of all player skills and their levels?
alternatively, just all player skills, like carpentry etc.

gilded hawk
deft falcon
#

kk

gilded hawk
# deft falcon kk
    local perks = {}

    for i=0, Perks.getMaxIndex() - 1 do
        local perk = PerkFactory.getPerk(Perks.fromIndex(i));
        local parent = perk:getParent()
        local isNotPassiveOrAgility = parent ~= Perks.None and parent ~= Perks.Passiv and parent ~= Perks.Agility
        local currentXp = player:getXp():getXP(perk)
        local info = player:getPerkInfo(perk)
        local level = info and info:getLevel() or 0
        table.insert(perks, perk:getName())
    end
deft falcon
#

mk

flint beacon
#

If there is any server owners looking for a modder / admin with experience, DM me im open to do commissions and have alot of free time.

I know how to set up servers - mods - make mods or pack mods into mod packs if allowed.
Basic knowledge of blender
Great knowledge with graphic design.

deft falcon
#

@gilded hawk what's the "parent ~= Perks.None" about?

gilded hawk
#

I can't remember exactly tho

deft falcon
#

kk ig

#

@gilded hawk for the weapon related skills, would it be Perks.Combat?

deft falcon
#

yea it worked

#

tysm i think i cut down my code by like 50 lines lmaoo

#

and also made it compatible with mods that add new skills

gilded hawk
deft falcon
#

and even worse it didnt even include modded skills lul

gilded hawk
#

Oh, damn

gilded hawk
#

WOOOOOOOO

#

I did it!@

#
local EBD = {
    RBBurntDef = nil
}

function EBD:getBurnedDownStory()
    if self.RBBurntDef ~= nil then
        -- print('cached RBBurntDef')
        return self.RBBurntDef
    end

    for i = 0, getWorld():getRandomizedBuildingList():size()-1 do
        local rb = getWorld():getRandomizedBuildingList():get(i);
        if rb and rb:getName() == "Burnt" then
            self.RBBurntDef = rb
            -- print('rb:getName(): ', rb:getName())
        end
    end
end

function EBD:burnItAllDown(square)
    if not square then
        return
    end

    local x = square:getX()
    local y = square:getY()

    
    if isClient() then
        return
    end
    
    local building = square:getBuilding()
    if not building then
        return
    end
    
    -- randomizeBuilding(BuildingDef var1) inside RBBurnt, will set building to all explored
    if building:isAllExplored() then
        return
    end

    print('burn down building in square: '..x..', y:'..y)

    self.RBBurntDef:randomizeBuilding(building:getDef());
end

function EBD:LoadGridsquare(square)
    self:getBurnedDownStory()
    self:burnItAllDown(square)
end

Events.LoadGridsquare.Add(function (square)
    EBD:LoadGridsquare(square)
end);
#

There is only one issue tho ๐Ÿค”

if a building in split in between 4 squares, and the game only loads 1 square, only the part of the building in that single square will be burned, and the other 3 will not, because randomizeBuilding will set that building building:isAllExplored to true :(, does anyone of you have a suggestion? ๐Ÿ˜ฆ

thick karma
#

Anyone have any good guesses re. the precise name of something someone would call the "Equipment Tab" mod?

meager obsidian
#

whats the mod i see on yt where people have a canteen equiped to their belt

gilded hawk
#

It works!

I updated the code too, found a nice way to check if a building is fully rendered

#
local EBD = {
    RBBurntDef = nil
}

function EBD:getBurnedDownStory()
    if self.RBBurntDef ~= nil then
        -- print('cached RBBurntDef')
        return self.RBBurntDef
    end

    for i = 0, getWorld():getRandomizedBuildingList():size() - 1 do
        local rb = getWorld():getRandomizedBuildingList():get(i);
        if rb and rb:getName() == "Burnt" then
            self.RBBurntDef = rb
            -- print('rb:getName(): ', rb:getName())
        end
    end
end

function EBD:burnItAllDown(square)
    if not square then
        return
    end

    local x = square:getX()
    local y = square:getY()


    if isClient() then
        return
    end

    local building = square:getBuilding()
    if not building then
        return
    end

    -- randomizeBuilding(BuildingDef var1) inside RBBurnt, will set building to all explored
    if building:isAllExplored() then
        return
    end

    local buildingDef = building:getDef()
    if not buildingDef:isFullyStreamedIn() then
        return
    end

    print('burn down building in square [x: ' .. x .. ', y:' .. y .. ']')

    self.RBBurntDef:randomizeBuilding(buildingDef);
end

function EBD:LoadGridsquare(square)
    self:getBurnedDownStory()
    self:burnItAllDown(square)
end

Events.LoadGridsquare.Add(function(square)
    EBD:LoadGridsquare(square)
end);
gilded hawk
#

rip meta locations

meager obsidian
gilded hawk
pale cradle
#

are there any events related to voice chat? or is it possible for a mod to interact with the voice chat system at all?

zealous wing
#

So I've been working on a patch to Small Town First Responders. Basically, the idea is to add a bunch of clothing and bag options from SWAT Pack, Paw Low Loot and ADVANCED Gear to the STFR zed spawns. I've also incorporated the SWAT Pack SWAT zeds into the STR tables, and tweaked their gear to share a bit of the same aesthetic. So SWAT zeds from different towns will have different helmets.

#

The Riot Zeds have a bit more gear variety, and the bags and rigging bits look real nice on them:

#

I also touched up the EMS spawns. They'll have chest rigs and carrier vests from Adv Gear, as well as bags and pouches from SWAT Pack and PLLoot.

#

I made some custom textures for the Medic vest and Paramedic version of the SWAT pouch so they match the PLLoot Medic bag aesthetic. I'm particularly proud of them. ๐Ÿ˜„

#

IDK when I'll release this, maybe this weekend? Still got to sus out some issues and do some bugfixing to make sure everything works right.

quartz ledge
#

could i get some help downloading the multiplayer true music mod? My computer is being dumb and not allowing the file to download on my browser so i need someone to dm me it

#

hoping this makes sense

#

its kinda just downloading a shortcut to the download

#

im wondering if mod people who do this more often could help

thick karma
ancient grail
#

Im going to pm u instead hehe

ancient grail
fast galleon
#

nice burn down code

#

obviously LoadGridSquare is a not good event, but there are no better alternatives.

#

I guess you only sleep in cars now

#

oh, burn down cars too

ancient grail
#

so i got this from burryaga.. (thnx dude ๐Ÿ™‚ )
but i dont know how to convert it into something the context menu only works on other player or items

Example.addMenuOptions = function(playerIndex, menu, objects, test) 
    
    if test then return true end

    local player = getSpecificPlayer(playerIndex)
    if not player then return end

    menu:addOption("Option Name 1", player, Example.functionName);
    menu:addOption("Option Name 2", player, Example.functionName);
    menu:addOption("Option Name 3", player, Example.functionName);

end 

Events.OnFillWorldObjectContextMenu.Add(Example.addMenuOptions)
#

do i remove the player index if i want to target items
and if i want to target players do i change the player index into playernum?

fast galleon
#

playerIndex is the game giving you the playerNum
if you want to add option for specific item, go through worldobjects (called objects above) and check if they match the item you want.

little iron
#

hey guys
is there a mod that makes the ui larger?
playing in 2k and above makes is rather small, and i noticed that the character overall menu and other stuff like that are much larger on mod page screenshots
is it because of a lower resolution or a mod?

ancient grail
#

you would see burryagas mod about making UI bigger

little iron
#

Or every UI? Because the overall page where the lifelong stats, medical tab etc are

#

isn't mentioned in the description

ancient grail
#

idk

little iron
#

i think its only the inventory ui.

#

sadly.

unique harbor
#

What exactly is zombie.characters.IsoPlayer?
I searched the type up but I can't access fields like accessLevel or username

deft falcon
#

i think isoplayer is the player character

velvet wyvern
#

I'm trying to increase the muzzle flash size (I find the default one too tiny), anyone knows how this could be done? Increasing the muzzleflash texture resolution doesn't do the trick.

unique harbor
deft falcon
#

you mean hp?

#

you want hp?

#

getBodyDamage():getOverallBodyHealth() is the thing ur looking for

unique harbor
#

Just trying to access anything really... figuring this mess out

#

I want to get the safety status from both players from the OnWeaponHitCharacter event

#

by safety status I mean the built in pvp switch

#

I want to make a mod where you can change the pvp / pve status only in the safehouse and BOTH need pvp enabled to damage each other, current safety system makes no sense to me.

unique harbor
#

I have zero clue what kind of variable that is, I can't access anything from both IsoPlayer and IsoGameCharacter

thick karma
#

Anyone have a list of useful vanilla coords? Awesome houses? Police stations? Etc?

thick karma
# unique harbor I have zero clue what kind of variable that is, I can't access anything from bot...

A) Try something like attacker:isAsleep() and :getForname(). I don't know if the field variables are directly accessible from your context (i.e. public).
B) If those don't work, attacker is probably an index. Try local player = getSpecificPlayer(attacker), then try player:isAsleep(). Keep in mind, you need a : not . for all of these method calls on the Java functions.
C) If neither A nor B gets you anywhere, the doc is probably wrong, but as far as I know you declared the function correctly.

#

See different package non-subclass -- that's probably your condition.

unique harbor
fast galleon
#

reborn version may have still have them, not sure

weak sierra
#

but use getters when they exist

thick karma
thick karma
#

Anyone know of any mod or vanilla uses for the keyboard "X" key while the world map is open?

unique harbor
weak sierra
#

getNumClassFields, getClassField, getClassFieldVal

#

you have to loop thru the fields using the first two and then call the third one using the info from that

#

easy to write a little wrapper for it

#

not sure why they didn't just offer one lol

unique harbor
weak sierra
#

a few fields just plain don't work btw

#

it only works on public fields, but even some public fields just throw exceptions

#

one in particular i've found is "dir" on vehiclezones

#

so if u hit that, probably isn't you

unique harbor
#

Thx will give it a try!

astral dune
#

Part of getClassField sets it to be accessible, should work on private fields too

#

But if the class of the thing isn't exposed to the Lua you won't be able to manipulate it

bright drift
#

Question in Noir's shop and the subsequent Shopsx is there a way to get multiple items (Such as stray nails) to show up in a group rather than populating as a single item. Specifically asking for the sell tab. Looking to tweak this for a future server and im just not sure listing every single nail is the best ui experience

fast galleon
#

If I use setName on an inventory Item, will it stop being translated?

I want to change name of recipe result and that's how evolved recipes do it too.

#

hm, maybe I'll use doparam displayName everytime before give item

fiery pecan
dreamy flicker
#

One of the biggest pains with my self-hosted server are mod updates.
Workshop items will be updated and if I dont catch it in time and restart the server, users will not be able to connect anymore. Their clients will be updated and my server will be stale.
I wanted a way to automatically restart the server if a mod updates.

#

I am open to hear everyone suggestions on how to resolve this problem. but I did go ahead and put together a little hodge-podge solution using bash, steamcmd and rcon

#

I would love to receive any feedback, good bad and ugly on this one

bronze yoke
#

there's a couple mods to do this

#

udderly up to date will shut down your server a little after a mod updates, under the assumption that your server will restart itself

bright drift
#

Was gonna say you can use udderly with rcon and a daemon service, but if you can packacge it simpler that would be good too

quasi kernel
#

Does anyone know when distributions are applied?

ancient grail
#

im trying to figure out how to capture the gas from the gasstation and be able to refil and depleat it.. its not a moddata .. not sure if its properties yet.. but if anyone knows anything pls help... im super stuck

   local player = getPlayer()
          local cell = player:getCell()
          local x, y, z = player:getX(), player:getY(), player:getZ()
          local xx, yy, zz
          local rad = 3
    for xx = -rad, rad do
    for yy = -rad, rad do
          local square = cell:getGridSquare(x + xx, y + yy, z)
          for i=0, square:getObjects():size()-1 do
          local obj = square:getObjects():get(i)
          if obj:getPipedFuelAmount() then        

           obj:getPipedFuelAmount()
           print(obj:getPipedFuelAmount())

          end
    end
    end

    
#

thnx

#
 obj:getPipedFuelAmount()
fast galleon
# ancient grail ```lua obj:getPipedFuelAmount() ```

if (this.hasModData() && !this.getModData().isEmpty()) {
Object var3 = this.getModData().rawget("fuelAmount");
if (var3 != null) {
var1 = (Double)var3;
}
}

     if (this.sprite.getProperties().Is("fuelAmount")) {
#

that's what it checks

#

obj:setPipedFuelAmount(int) might work

ancient grail
#

๐Ÿ™โค๏ธ

#

Omg thank you finaly
I really should make it a habit to check the java . But k always forget.
Ill try this tomorrow.

Thank you poltergeist!

quasi kernel
#

I think I've run into a problem.

#

Is there a way to properly modify distributions via a sandbox setting before they're applied?

#

In other words, making it so I can remove / replace items in accordance to a sandbox option before they spawn?

bronze yoke
#

sandbox settings load after distributions are applied, but you can just reapply them before the world actually loads any items

quasi kernel
#

What do you reckon I should connect to for that?

bronze yoke
#

i use OnInitGlobalModData

#

you just need to call ItemPickerJava.Parse() after you've messed with the distributions

quasi kernel
#

I see

#

I'll give it a shot, thank you!

wet axle
#

Hey guys, a couple friends and I were trying to implement a pvp gamemode where there are extraction points people can use to teleport into vaults, from which they can trade their items ranging anywhere from guns, stolen jewellery, other players' dog tags to food and cigarettes etc.; much like an isometric escape from tarkov.
I was able to install/code the mods for teleportation from extraction points and shopping (both of which were previously moderated by admins), however my friends who were fairly new to the game constantly complained about the gunplay.
Imo the combat in the game is mostly fine for pve stuff, though now that they have easier access to guns it didn't feel that engaging when it comes to pvp. We have theorised a system where players instead of clicking on targets they want to shoot at, would have a visible arc which would get narrower and narrower based on: how high their aiming skill is, for how long they have been standing still, what gun they use etc. From that, any targets that are in this arc and are visible to them would have a probability of getting shot when the attacking player fires the gun based on: distance, if there are any other targets between them such as zombies or other players etc.
All this would basically provide a more conventional aiming system. But, I'm completely stuck and have no idea on which class functions to use to implement such a system and also whether it would conflict with the existing pvp mechanics.

#

Do you guys think that this would be feasible and/or enjoyable? Help/ideas from devs or experienced modders would be much appreciated.

haughty cedar
#

I am having issues getting a clothing mod to appear in my mods list, no clue what it could be since I followed the clothes mod tutorial to the letter than corrected myself based upon the example mod included with that tutorial.

haughty cedar
undone elbow
#

How to add an item to player inventory from server side code?

sour island
undone elbow
bronze yoke
#

afaik player inventories only exist on the owner's client

quasi kernel
#

Y'all reckon anyone would want a compatibility mod between Le Gourmet Revolution, Soul Filcher's Awesome / Farming Time, and Mo' Crops?

#

They each add at least one crop the others don't have, so personally I think it'd be interesting to have a compat mod between them all.

undone elbow
quasi kernel
#

They override each other's crops on a number of occasions.

#

You can't plant the crop unless you have the right mod's seeds, which sometimes just doesn't happen??

#

Sure a conversion recipe works, but there's a better way to go about it.

#

I'm doing it in conjunction with a conversion recipe.

undone elbow
#

I'm not sure what kind of crops are overridden. But I guess the future patch will change it. It may help to improve compatibility or make it worse. Vanilla plants:

quasi kernel
#

They override stuff like corn, eggplants, lettuce, etc between one another which causes some weird effects.

haughty cedar
#

Question, When I get a error like this on a clothing modding, what would be the best solution for it?

silver widget
#

Question - would i have to make a new world object .txt and a new wepon text if i wanted it to say have a folding chair useable as a melee weapon and a peice of furniture? or just one text with properties for both? as in foldingChair_melee and foldingChair_Sitee?

ancient grail
#

this worked but it only printed true or false

#

doesnt allow me to edit the value still

#
local function checkFuel()
    local player = getPlayer()
    local cell = player:getCell()
    local x, y, z = player:getX(), player:getY(), player:getZ()
    local xx, yy, zz
    local rad = 1
    for xx = -rad, rad do
    for yy = -rad, rad do
    local square = cell:getGridSquare(x + xx, y + yy, z)
        for i=0, square:getObjects():size()-1 do
        local obj = square:getObjects():get(i)
            if obj:getPipedFuelAmount() and obj:getPipedFuelAmount() > 0 then                        
            local fuelamt = obj:getPipedFuelAmount()         
            print(obj:getProperties():Is("fuelAmount"))
            print(fuelamt)
            CheckFuelOff()    
            end        
        end
    end
    end
end
function CheckFuelOn()
getPlayer():setHaloNote("CheckFuelOn") 
Events.OnTick.Add(checkStuff);
return true
end

function CheckFuelOff()
getPlayer():setHaloNote("CheckFuelOff") 
Events.OnTick.Remove(checkFuel);
end
#

heres what i have so far

fast galleon
#

sorry, what is not working
did you try the setPipedFuelAmount ?

ancient grail
#

i did that at first

#

didnt work

#

but imight have done it incorrectly

fast galleon
ancient grail
#

it just reverts but i think i know why

#

its porobably on how i tryied to reduce it

#

it hink its working now

#

how do i get the max?

#

obj:getPipedFuelAmount():getMax() ?

#

lol dindt work

fast galleon
#

I'm not sure there was a sandbox check and some other thing.

#

starting value is random

ancient grail
#

so everything has getPipedFuelAmount() by default? cuz i get all the zeros

#

if idont do this

obj:getPipedFuelAmount() > 0
#

os if incase i accidentaly make it zero i wont be able to refil anymore?

#

lol

fast galleon
#

did you try if Is("fuelAmount) then print .Val("fuelAmount")

ancient grail
#

Ah ok so thats what determines if it its the fuelpump object
But everything else
Has getpipefuel to zero instead of nil
Ok got it

Its kinda weird

unique harbor
#

So when you want to control the WeaponHitCharacter Hook so the damage doesn't happen based on target / attacker would I put it in client / shared or server? ._.

fierce cipher
#

Are crossbows and bolts easy to mod in?

#

I was thinking of copying the structure of a bolt action but limit the mag size to only be the chamber

#

But I imagine having the bolt be in the zombie would be a bit rough

fast galleon
ancient grail
#

Yeah you probably have to do math for that mod
Like if you miss.it will calculate where you are aiming and spawn an item on the ground

#

Anyone knows how far the

 getUseableVehicle()
``` checks?
rain iron
#

Is there a way to use a custom book model while reading? using a custom book model always seems to result in an invisible book model.

thick karma
#

@fast galleon Pushed a copy shortcut into Position Breakdown

rain iron
#

Yeah it was using a model without any vertex group

#

I don't need to create the XML file for it do I?

ancient grail
#

Xml are for animations and clothing afaik

rain iron
#

It's like for book items, reskins work but custom models seem to not work

#

pretty weird (at least that's what happens on my end)

ancient grail
#

It might have worked but its scale is too big or is under the ground or something

#

Try using the attachment editor its not my forte but thats what i know atleast

ancient sandal
#

I don't know if someone will read my request but may I humbly ask for a death korps of krieg armor and a templer knight armor? I think since we already have all the other utilities and weapons it would make a great addition

unique harbor
#
local function hookChecker(attacker, target, weapon, damage)
    local atkSafety = attacker:getSafety()
    local tarSafety = target:getSafety()
    
    print(atkSafety:isEnabled())
    print(tarSafety:isEnabled())

    if (atkSafety:isEnabled() or tarSafety:isEnabled()) then
        print("AVOIDED")
        return false
    end

    print("DEALT")
    return true
end
Hook.WeaponHitCharacter.Add(hookChecker)

Why exactly doesn't it work?
It seems to deal no damage both returning false and true

thick karma
#

Does OnCreatePlayer fire when players are initially created during Character Creation, or does that fire when a player object is initially created after joining a server?

ancient grail
#

Post on the comment section of his mod

unique harbor
#

So you have a 'real' PVE / PVP system

ancient grail
#

Havent seen any pz mod code with the
Hook.
Instead of Events.

unique harbor
#

So you mean using the event and avoidDamage()

ancient grail
#

You have to look at the lost of pz lua Events

thick karma
ancient grail
#

I dont hink it exists
But we could be wrong
If it does this would be revolutionary

unique harbor
thick karma
unique harbor
#

Very new to this modding and hate it so far lol, trying to get into it

unique harbor
#

I guess the only other way would be to use the WeaponHitCharacter and then avoidDamage() ?

thick karma
#

Well, that person is a genius, so they're probably right.

#

ASSUMING you CAN do what you're trying to do, I would guess it's Hooks.HookName.Add not Hook.HookName.Add

#

Following the Events.EventName pattern.

#

Try adding an s

unique harbor
#

I mean Hook does seem to work, but it negates every damage for me rn even to zombies

#

doesn't matter if I return true or false

thick karma
#

Oh so it IS doing something

#

But not the desired effect

#

Hmmm

ancient grail
#

It worked?!

#

Omg

thick karma
ancient grail
#

Whats that going to do?

thick karma
#

Also, just FYI, based on Fenris message, the Hook event seems like it should be called HookWeaponHitCharacter, not WeaponHitCharacter, so I'm very confused about the path from his message to your code

#

When game fires OnWeaponHitCharacter we catch OnWeaponHitCharacter... so if game fires HookWeaponHitCharacter I would expect to catch HookWeaponHitCharacter, not WeaponHitCharacter

#

So I would expect Hooks.HookWeaponHitCharacter.Add

thick karma
#

Hmmm

unique harbor
ancient grail
#

I never knew this till today thank you. Imight explore more of this

#

WeaponHitCharacter is a vanilla event right?

thick karma
#

@unique harbor Okay Hook.WeaponHitCharacter is correct

#

I just checked the table in game

ancient grail
unique harbor
#

You can do stuff like for k, v in pairs(Hook) do print(k , v) end and stuff

#

Fenris comes to the rescue

ancient grail
#

Anyways so youre code is like part of the original function right and it justs adds to it not overwrite it right?

quasi geode
ancient grail
#

So whats the difference between hook and events?

Ow hi fenris

#

๐Ÿซก

quasi geode
#

its been quite a few years since i actually used this feature

unique harbor
quasi geode
#

ya you may have to use the event and avoidDamage()

unique harbor
#

Ahh okay, thx for letting me know!

quasi geode
fast galleon
#

does anybody have experience with making items multipurpose, I can make bucket be container but then equipping it in hand has no sprite, weapon bucket works fine in primary hand but has no container.

unique harbor
#

When I reloadlua on the server, why does it not take the changes?

fast galleon
#

and bucket with water probably reset container items