#mod_development

1 messages · Page 527 of 1

hearty herald
#

I think spawnchances are relative to the value of other things. Like a pool of values, and the higher the total value is the rarer 1 is

So if there are 10 cars which all have the value 4, if you add a new car withg the value 40 it would have a 50% chance of spawning

willow estuary
#

Yes, but unless you have lua checksum disabled (which is important for anticheat), you will get file mismatch errors when people try to connect unless the server and the clients have the same version of the modified file installed.

still meadow
#

@willow estuary thank you, I went through the whole process to make sure we all had the same version of the mods, its just me and a few friends running on a dedicated computer in my house

willow estuary
still meadow
#

@hearty herald ok thank you I'll mess around with it more

still meadow
#

eyyy I found the instructions in the VehicleZoneDefinitions.lua in the game files

drifting ore
#

Can you explain me again what you trying to do ? I'm pretty good at math and geometry

faint jewel
#

see that screenshot up there with the faces?

#

i can make it do the red. i need it to be green.

drifting ore
#

Yep

#

Mmmm ok

#

GetAngleY() is beteween [0-360]

#

?

faint jewel
#

nope!

drifting ore
#

Or it's radiant ?

faint jewel
#

it's hell on earth. lol.

drifting ore
#

Ok nice, that better

#

Are you sure it's angle Y that you want ? Because for me that should be angleZ

faint jewel
drifting ore
#

Can you check for angleY/angleZ ? I will draw you something to make you understand, that gonna be easier

faint jewel
#

?

#

that's how the stupid angle works lol

drifting ore
#

For me the right angle ro use is the Z rotation, are you sure it's angleY that need to be use ?

faint jewel
#

local angle = vehicle:getAngleY()

drifting ore
#

So you mean there is only 2 angle ? 0 and 90 ?

faint jewel
#

no... between -90 and 90.

#

northeast and south west are zero.

drifting ore
#

Mmmm so there should be something to know if you face north or sud

faint jewel
#

the green arrows show how it adds up or counts down.

#

the mower in that shout would be going 0.

#

even though 0 is behind him as well.

#

that means his dealta1 is 0 instead of 1.

#

trust me this whole maffs and vehicles

#

i miss doing tiles, where the only math i needs was 27.5

drifting ore
#

Ok and what append is you set an angle >90 ou <-90 ?

faint jewel
#

i'm 36+ hours without sleep lol

drifting ore
#

Haha developping game is a lot of math, I love it but that not for everybody

faint jewel
#

i could have set one to mickey mouse and i wouldn't know.

drifting ore
#

Ok xD

#

I have 10min, I will check you code

faint jewel
#

you want the current mod? you can test and what not.

drifting ore
#

Can you send me the whole mod ? Or put it unlisted on steam ? Like that I can try something

faint jewel
#

do whatever you need to code wise... i just want it so that when i run over a zombie a corpse it removes them and does a spray of blood out the RIGHT side of the mower.

buoyant sky
#

Is it currently not possible to make mounted guns or why isnt there one in the workshop?

bronze arch
#

do you guys know if the day/night cycle and weather cycles are locked behind java or are they open for modding? I want to make a map set in antarctica but I don't want to waste my time if I can't make the summers have 24 hours of light and the winters have 24 hours of dar

spring kraken
tame mulch
#

Only by params of server for all sleep and something else

spring kraken
#

Alright, I wanted to make something so that time could speed up if all players are doing longer timed actions like reading or resting

tame mulch
spring kraken
#

Doesn't seem to exist. Is it feasible to modify the base files of a dedicated server to implement it?

#

In terms of obfuscation / file integrity issues

vivid flare
#

looks like the new update has icons that are inspired by our extra map symbols :>

#

and the "rest map symbols" option not only deletes all icons, but literally clears the whole map. not sure if i like that.

rigid snow
#

Anyone playing Brita's Weapon Pack can tell me which gun is better? M16A1 vs M16A2 vs Colt CAR-15 Survival Rifle?

spring kraken
bronze arch
spring kraken
#

If you want to change the length of day / night, I think you could hack it together by manually setting the time of the GameTime instance

#

Might break some stuff though

spring kraken
#

What is the best way to communicate between server and client?
Is there a serverside event for chat events?

#

Guessing OnCoopServerMessage?

#

Do the events pass any arguments, and if so, how do we know which?

hot patrol
#

Any texture artists available to to help me out with something in DMs?

zinc token
#

Would it be possible to add a firearm, but replace the damage dealt with the player/zombie tripping over?

willow estuary
# zinc token Would it be possible to add a firearm, but replace the damage dealt with the pla...

Yes, you could use the OnWeaponHitCharacter event for this, here's a quick and sloppy example of a way t could be done, substitute your own weapon script name for "WEAPON_THAT_TRIPS", ie if you used "Axe" then the Axe would do this.

However, I think that this this specific example might not work for making the zombies trip? I use it to make players trip, never tried with zombies, but regardless it's an example of how one could go about it?

function Trip_Weapon(wielder, target, weapon, damage)
    if not weapon then return end
    if not weapon:getType() == "WEAPON_THAT_TRIPS" then return end
    target:setBumpType("stagger")
    target:setBumpFall(true)
    target:setBumpFallType("pushedFront")
end

Events.OnWeaponHitCharacter.Add(Trip_Weapon)
#

This is not a good general solution, in that the player always falls backwards, I don't know if it works for zombies, but it's a start for you? 🙂

#

You could randomize the direction

if ZombRand(2) == 0 then target:setBumpFallType("pushedFront")
else target:setBumpFallType("pushedBack") end
#

It would get more complicated if you wanted the positioning of the shooter vs the target to dictate what direction, but not impossible.

zinc token
willow estuary
#

There's likely a function in the code somewhere for knocking zombies down as well, so you could do "if a player do this but if not do that instead" if you had the function? Just don't know if/what offhand.

spring kraken
#

Is the debug command console's lua input client or serverside?

zinc token
willow estuary
jade helm
#

Hi!!! After a lot of googling and googling, and trying to create my mod, I get questions.

I have a delicate linux server and I would like to test the mods that I make on it. It can be done somehow without adding it to the workshop. Thank you very much

odd notch
#

i assume you meant dedicated not delicate

#

if you meant delicate i would suggest sending your linux machine to karate classes or something

jade helm
#

Dedicated yes 🤣

odd notch
#

is the place you want to be :)

#

i use the localhost server to test my mods

spring kraken
#

I am really struggling to find relevant documentation. Almost all tutorials are simple item additions.
How do I distinguish between server and client in the debug tools?
How do I know which java classes and methods I can access via lua and whether it is from client or server?
Do I have to decompile the source code myself, in order to get any documentation on the java stuff?
E: also, what is the convention for communicating between client and server?

jade helm
#

Thanks @odd notch :)

#

I want to make a small mod that saves the time I've been alive and the zombies I've killed in a file, that part is done and it works locally, but I need to use it on my server.

odd notch
#

honestly its a pain to setup intellij and to then decompile everything. i just use the javadocs or ask the grand magicians here about functions if im unsure

odd notch
#

there's a really nice json file writer utility i see a lot of people use

jade helm
#

Bufff

#

I have no idea about java hahaha

I only know how to use javascript, vbs and powershell

#

Jajajaja

#

The mod works and export that to a file

#

the only drawback is calculating the time I have survived, I don't know how to calculate it with LUA and I do it with powershell. The game returns a Double that I don't know how to change in time format

#

@odd notch in servertest.ini I only have to fill in mod= right?

jade helm
#

I don't know if this is the channel to ask or if it's #mod-support, Sorryqueasy

#

Thank you! I'll try or I'll give it up lol

zinc token
#

Anyway to get a weapon to do 0 damage and only apply the staggering effect to zombies? I've set all the dmg/crit options to 0 and its still killing them.

willow estuary
zinc token
willow estuary
zinc token
#

Yeahh, I'm pretty new to lua. I've only really done some Python stuff. Apologies if I'm asking dumb questions.

willow estuary
# zinc token Yeahh, I'm pretty new to lua. I've only really done some Python stuff. Apologies...

Nah, it fine. You've just reached a place where you need to develop some simple lua familiarity in order to be able to do what you want to do and all?
Lua is not that terrible as far as programming language go.
However, I am a gigantic stoned idiot, and not a fancy pants code smart guy, so teaching anyone that stuff is way outta my capabilities?
I just share the lego pieces that work for me and such.

#

I'd say find some "hello world" tutorials and such, and suffer through them.

zinc token
#

Yeah I understand, will do then. Thanks for the help 👍

spring kraken
slate stag
#

Its there a mod for better and stronger walls

slate stag
#

Why do I need to ask that in support?

#

Just normal question

willow estuary
#

Aside from gently directing people to mod_support when they're looking for help with bugs as mod users, there's no need to be fussy about people asking that sort of stuff.
People chit chat about all sorts of mod-related business in this channel, it's fine 🙂

willow estuary
slate stag
willow estuary
#

Well, your best bet is probably to search "walls" on the workshop and check out what comes up? That's the only one I knew about, but from doing a search it looks like there's quite a few of them 🙂

slate stag
#

Aye thnx

willow estuary
drifting ore
# zinc token Yeahh, I'm pretty new to lua. I've only really done some Python stuff. Apologies...

In this introductory video we take a look at what Lua is, What we need to run lua and we set up a little test project to make sure everything was done correctly, If you enjoyed the video be sure to leave a like and subscribe if you wish. Thank you.

LuaForWindows : https://code.google.com/p/luaforwindows/
Sublime Text : http://www.sublimetext.com/2

▶ Play video
#

this is a playlist

#

codeblue teaches good shit

#

where i learned GLUA

#

thats the basics then it's similar to java too

bright iris
# willow estuary I've never used this mod or anything, but it does exist and sounds like what you...

I think the ideal for a multiplayer raid experience would be this mod, combined with a new mod that has a door that could only be destroyed with an explosive (sledgehammer disabled). With admins controlling how players acquire a C4 (or EXTREMELY rare).

Or similar to Dead Side, where when you kill a player, you can collect the dogtag (in this case, the key chain) and then an area is revealed on his map with approximate location of the base, only in this way a raid is possible (with the above method)

I say this based on feedback from 2 months running a server, with players generating issues and arguing about safehouses (which is not worth it, nor should I extend it here)
I'm going to post this suggestion on the forum, but I wanted to say it here too to see if I can inspire someone with more free time and knowledge than me 😆

faint jewel
#

@tame mulch hate to ping you but can i bug you real quick?

tame mulch
#

Yep, what problem?

drifting ore
#

What in a world getAngleY() is from [0-90] and [0--90]. How do I know if I face sud or north ?

faint jewel
#

i need to be able to spawn and yeet a blood spatter like i hit a zombie with an axe. how do?

drifting ore
#

Yes

tame mulch
drifting ore
#

Afternoon everyone, I'm new to the PZ discord! I'm planning to add additional weapon stats to the hover tooltip since I haven't been able to find such a mod. Seems fairly straightforward, I'm basing the code off of the Show Material mod but I can't find ISToolTipInv in the javadocs, would anyone know where I could find it? Also, is there any recommended getting started guide for modding apart from the wiki page?

#

mmmmm I kind of see

#

So I need the vector right ?

tame mulch
drifting ore
faint jewel
#

i already do that ut they all look the same

tame mulch
drifting ore
faint jewel
tame mulch
faint jewel
#

that's the problem.. all 20 variations... ar the same thing.

#

i mean it can be varied but only slightly.

tame mulch
#

Also maybe will help creating IsoZombieGiblets for visual effects

faint jewel
#

would love to. so how do you throw them? lol

drifting ore
#

did you have to use CustomQuaternion to find the direction of the helicopter?

tame mulch
tame mulch
faint jewel
#

i can send you what we have.

#

bounty is working on it too.

tame mulch
#

Good, PM me

shadow flower
#

Does anyone know why this would be throwing a STACK TRACE of "attempted index: getTexture of non-table: null"

table.insert(ProceduralDistributions.list["all"]["crate"].items, "MCM.testItem")
table.insert(ProceduralDistributions.list["all"]["crate"].items, 0.5)
#

oh i was using the wrong item xD

#

the error is actually "attempted index: crate of non-table: null"

fading citrus
#

Hello, I am trying to make a clothing mod for a server I'm in. Right now I'm using the t-shirt template pinned in #modeling and this guide ( https://steamcommunity.com/sharedfiles/filedetails/?id=2648115890 ). I can get the items to appear in the game, but when I put the shirts on, they don't appear on the player model. I suspect it's because I'm pointing m_MaleModel and FemaleModel to "MaleBody.X" and "FemaleBody.X", but I can't seem to find the default t-shirt model the game uses if this is an incorrect model to point to. Does anyone know what model I should be pointing them at instead?

willow estuary
shadow flower
#

Now its a "Callframe at: table.insert"

chrome egret
thin hornet
#

is it just me or ISBaseTimedAction:start is not always called? (in the new unstable branch)

#

it goes to perform directly and doesnt run start() not sure why

#

im just hooking into start to print something to test but it doesnt get in

#

ah right, its not calling the parent function.. (never did)
ex: ISBaseTimedAction.start(self);

#

would be usefull if we could get vanilla events to detect action start, stop, perform.

local function onAction(actionType, actionMethod, actionInstance)
  print(actionType) -- print ISGrabItem
  print(actionMethod) -- print stop
  print(type(actionInstance)) -- print table (the action instance itself)
end
Events.OnAction.Add(onAction)
drifting ore
#

Huh, looks like WeaponLength is set twice for the Katana for whatever reason, probably a bug

#

Anyone know what BaseSpeed on weapons does? I assume it's a run speed modifier?

daring palm
#

Just finished my first mod and it's now avaiable on steam workshop. I wanna thank you guys for helping me out

chrome egret
#

Drop the workshop item link!

chrome egret
#

Congratulations!

daring palm
#

thank you. You guys helped me alot to get started. Very kind of you

chrome egret
#

Programming thrives on community 🙂

thin hornet
#

that new item OnCreate is such a massive feature 😄

modest yarrow
thin hornet
#

when the ItemFactory creates it

#

so basically i suspect anytime it is created

modest yarrow
#

even in containers in the world I guess

wise remnant
#

Any windows devs out there, a little powershell script to watch console.txt in real time (with the options to clear it on run)

$yesno = Read-Host "Clear Zomboid log before proceeding? (Y/N)"
$consoleFile = "<console.txt-location>"

if ($yesno -eq 'y')
{
    Clear-Content $consoleFile
}

Get-Content $consoleFile –Wait```
thin hornet
#

So I had written an event system for actions and the start method wasnt triggering. Here is a fixed version.
With this you can detect any action that has Started, Stopped or Performed.
File: ActionEvents.lua

require 'TimedActions/ISBaseTimedAction';
require 'TimedActions/ISTimedActionQueue';

LuaEventManager.AddEvent("OnBeforeActionStarted");
LuaEventManager.AddEvent("OnActionStarted");

LuaEventManager.AddEvent("OnBeforeActionStopped");
LuaEventManager.AddEvent("OnActionStopped");

LuaEventManager.AddEvent("OnBeforeActionPerformed");
LuaEventManager.AddEvent("OnActionPerformed");

-- Hook the action event when adding it to the queue
local ISTimedActionQueue_add = ISTimedActionQueue.add;
function ISTimedActionQueue.add(action)
    
    local action_start = action.start;
    function action:start(...)
        triggerEvent("OnBeforeActionStarted", self.Type, self);
        action_start(self, ...);
        triggerEvent("OnActionStarted", self.Type, self);
    end

    local action_stop = action.stop;
    function action:stop(...)
        triggerEvent("OnBeforeActionStopped", self.Type, self);
        action_stop(self, ...);
        triggerEvent("OnActionStopped", self.Type, self);
    end

    local action_perform = action.perform;
    function action:perform(...)
        triggerEvent("OnBeforeActionPerformed", self.Type, self);
        action_perform(self, ...);
        triggerEvent("OnActionPerformed", self.Type, self);
    end

    return ISTimedActionQueue_add(action);
end

-- HOW TO USE
-- Might have to require this ActionEvents.lua before adding your events in a different file.

-- OnActionStarted
local function onActionStarted(actionType, actionInstance)
    print("Action " .. actionType .. " started!");
end
Events.OnActionStarted.Add(onActionStarted);

-- OnActionStopped
local function onActionStopped(actionType, actionInstance)
    print("Action " .. actionType .. " stopped!");
end
Events.OnActionStopped.Add(onActionStopped);

-- OnActionPerformed
local function onActionPerformed(actionType, actionInstance)
    print("Action " .. actionType .. " performed!");
end
Events.OnActionPerformed.Add(onActionPerformed);
worldly olive
#

Hi hi!
I have a doubt related to the OnPlayerUpdate, is known how many times it runs per second? I have been thinking it runs every tick but now I see there is a OnTick event so... is not that it changes anything for my code but to not use wrong information 🤔

chrome egret
#

Hm, it was validated recently that that doesn't run per tick, but I don't remember if the rate was discussed

faint jewel
#

is there a way to play an animation in a while loop?

worldly olive
#

I have been using the word tick to explain my mod but I'm wrong with that. Damn xD

faint jewel
#

where as longa st hey are in that loop it plays that animation, other wise it does the regular anims.

chrome egret
#

buffy asked in January and an answer then stated that OnPlayerUpdate runs every frame

thin hornet
chrome egret
#

interesting

worldly olive
#

Interesting hmmm

#

Thanks for the answer, will keep using that then 😂

thin hornet
#
local function onPlayerUpdate(playerObj)
  print(playerObj:getPlayerNum()); -- will print which player (split-screen) is updating.
end
Events.OnPlayerUpdate.Add(onPlayerUpdate);
#

would be similar to loop through all players in a OnTick event (but doing this would be less efficients)

worldly olive
#

Yes, I mean, I use the OnPlayerUpdate on certain situations to modify modData but wasn't sure if say: "The moddata is modified in X amount per tick" is correct when that's done in the OnPlayerUpdate

#

It is something I want to know for my mod guide, not really affect my code, I just want to give correct information

thin hornet
#

and doing this

local function onTick()
  local playerObj = getPlayer();
  -- would give you the first player only so wouldnt get you the splitscreen additional players obj.
end
Events.OnTick.Add(onTick);
frank rivet
#

is there a mod that allows you to attach items and bags from the ground to your back?🍞

worldly olive
#

So, knowing it runs per tick. It is correct to assume in PZ also applies this calculator?
https://mapmaking.fr/tick/
1 second --> 20 ticks

thin hornet
#

i believe player ModData is only transmitted when saving the character on the server.

#

for my computer 1 second = 60ticks

modest yarrow
thin hornet
#

probably depends from computer to computer not sure

worldly olive
#

Hmmm, I know that most of the games standardise that but not sure if PZ does the same

wise remnant
#

anyone know of a way to check performance stats. for instance if frame rate is taking a big hit? i would like to include in the mod i'm working, a way to automatically tune check frequency if there's a performance penalty

#

in other words, to remove my mod (temporarily) from extra performance burden

thin hornet
#

kind of weird that we can drink water from washing machine
probably only does that with the new combo washing machine

faint jewel
#

omfg... i am in the middle of testing and now my lua is invisible to you!?

wise remnant
#

@thin hornet mmmmmmm delicious washing machine nectar

faint jewel
#

any idea why my lua just randomly decided to not show up anymore?

thin hornet
#

if it doesnt show up there is a good chance there is a syntax error preventing it from loading

faint jewel
thin hornet
#

verify your console for an error

faint jewel
#

nothing.

thin hornet
#

:\ you sure it's loading the workshop from your zomboid directory and not the one subscribed (steam dir)?

faint jewel
#

it was never put on the workshop

thin hornet
#

mhm

#

try restart?

faint jewel
#

have.

thin hornet
#

mhm

#

lol

#

well thats weird

faint jewel
#

yeah it's like it's ACTIVELY ignoring my file.

#

rather than just accidentally.

hearty herald
#

I've noticed, if there's an error in he file when you load the mod, it will not appear in the F11 menu

#

You have to reload the mod & fix the syntax error

faint jewel
#

reload the mod? hmmmmm.

#

well wait.

hearty herald
#

Yeah, simply remove it from modlist, or add a random other mod

faint jewel
#

why is it loading he OTHER file from my mod.

#

spawnlist.lua.

hearty herald
#

That still loads because it doesn't have any errors

#

It just failed to load the lawnmower.lua, so it doesn't know that it exists in the debug

faint jewel
#

hoodrat ass pz.

#

just unuse and then use again?

thin hornet
#

anyone know how to add distribution to any corpse? not just a specific outfit

faint jewel
#

player:setActionAnim("DriveMower") why would this throw nil?!

thin hornet
#

show the error

faint jewel
#

new error :/

#

player.character:PlayAnim("DriveMower")

thin hornet
#

your variable player doesnt have PlayAnim. make sure your variable player is actually an IsoPlayer

#

actually player is nil atm

faint jewel
#

player:setActionAnim("DriveMower")

thin hornet
#

is this an action?

faint jewel
#

trying to change the driving animation to one more fitting a riding a mower.

thin hornet
#

how do you assign your player variable

faint jewel
#

local function MowerUpkeep(player, vehicle, args)
thin hornet
#

i believe Events.OnPlayerUpdate.Add only has one parameter, player:IsoPlayer

faint jewel
#

local vehicle = player.getVehicle and player:getVehicle() or nil

thin hornet
#

why not just

local function MowerUpkeep(player)
  local vehicle = player:getVehicle()

  if vehicle then

  end
end
Events.OnPlayerUpdate.Add(MowerUpkeep)
faint jewel
#

okay done.same issue.

#

lol

thin hornet
#

what is player.character:PlayAnim("DriveMower")

#

player:PlayAnim("DriveMower")

#

should be that

faint jewel
#

back to calling nil.

thin hornet
#

and player:setActionAnim("DriveMower") should be self:setActionAnim("DriveMower") and self is the action object.

#

hum playerObj:PlayAnim("Idle"); should be ok from an IsoPlayer object.

faint jewel
#

that's the self.setactionanim

thin hornet
#

setActionAnim is a function for Action only. not IsoPlayer

#

what you want in your case is player:PlayAnim("AnimName");

faint jewel
#

player:PlayAnim("DriveMower")) soi that one?

thin hornet
#

yeah

faint jewel
#
<?xml version="1.0" encoding="utf-8"?>
<animNode>
    <m_Name>DriveMower</m_Name>
    <m_SpeedScale>0.80</m_SpeedScale>
    <m_AnimName>Bob_Idle_Lawnmower</m_AnimName>
    <m_BlendTime>0.20</m_BlendTime>
</animNode>
``` that's the xml for the animation.
thin hornet
#

if the animation was not found or not ok it wouldnt throw the error anyway. But it look ok

faint jewel
#

:/

#

does the animation have to be in a SPECIFIC folder?

thin hornet
#

the anim must be in anims_X and the xml in AnimSets i dont know if it need more specific

faint jewel
#

yeah that's where they are.

thin hornet
#

so i supose you dont get the error anymore but the anim not playing?

strange sequoia
#

Hey hey, i recently posted my first mod hair on the Workshop and some people have problems with the hair showing as bald for them even with Fluffy Hair downloaded. Anyone already had this problem before and know a fix ??

For me it works perfectly so i really don't know where to look first

faint jewel
#

no i get the error.

#

oh this "no lua for you" thing is annoying.

thin hornet
#

if you can share the faulty lua script maybe we can spot what cause it

grizzled grove
strange sequoia
grizzled grove
faint jewel
#

okay so diabling and renabling it is not working anymore :/

strange sequoia
#

I already made different models for each headwear groups if that's what you're talking about 😮

I works for me with hats, bandanas and caps

grizzled grove
#

ok cool

strange sequoia
#

They don't appear bald for me :c

#

For now i only had two person come to talk to me about this bug

#

So i don't know if anyone else experiences it too, because i don't and don't know how to reproduce it

grizzled grove
#

i see that it requires fluffy hair, but i can't find a way to make the game load your mod without that also being present.

strange sequoia
#

Is it not good that it is required ?

grizzled grove
#

i'm sure it's fine. I was wondering if somehow they managed to load the game without Fluffy Hair and that bungles things

willow estuary
#

Are people making this report about playing in MP?
Because, unfortunately, servers don't automatically set up requirements, and there's many many many "bug reports" from people using mods on servers that don't have the requirements.
So if you need fluffy hair for your mod to not have the bald heads, it's very likely that people are using your mod on servers without also using fluffy hair.

winter bolt
#

the only thing loading it without fluffy hair would do is make hats use the wrong hat categories

strange sequoia
strange sequoia
grizzled grove
#

it's working for me too, btw

strange sequoia
#

That's really weird then

#

I told them to try checking the game's file integrity, i don't know what else to do 😦

willow estuary
strange sequoia
#

I'll see if anyone reports that kind of bugs again in the future, but for now i'm confused

grizzled grove
winter bolt
#

it works fine for me

#

it might just be workshop weirdness so maybe resubbing might fix it

strange sequoia
#

I hope, because i'm not remaking the entire mod 🥴 ahahah

supple sapphire
#

Maybe someone could help me. Ive been rebuilding my mod list for past few days, but i cant seem to find anything pertaining to two things i am looking for - mod that would increase interaction range(like how far from container i need to be to "see" into it) and custom crating values(aka instead of just "one" and "all" being able to enter custom number).

shadow geyser
#

does anyone have experience with working with the global object system? I made and object accompanying system, and I am able to update the moddata on the serverside through EveryTenMinutes event, but I can seem to get that update to the client side. I can see for the server in the logs that the moddata is indeed changing for the object, but from the clientside when using the CMyObjectSystem.instance:isValidIsoObject: to get the correct object, it is as if the moddata has not been changed at all. I am using transmitModData on the isoobject on the serverside script but it doesnt seem to transmit it to the client

hushed mesa
#

Any mods with dogs/pets?

shadow flower
#

Getting this error for the distributions am I doing something wrong.

--Farmstorage
table.insert(SuburbsDistributions.farmstorage.all.items, "MCM.testItem"); <---- line 17 
table.insert(SuburbsDistributions.farmstorage.all.items, 1.4);
#

I get the same issue when I do

--Farmstorage
table.insert(SuburbsDistributions["farmstorage"]["all"].items, "MCM.testItem"); <---- line 17 
table.insert(SuburbsDistributions["farmstorage"]["all"].items, 1.4);
thin hornet
shadow flower
#

all doesn't work either

thin hornet
shadow flower
#

oof

#

well ["all"]["crate"] is an error as well

thin hornet
#

there is no all

willow estuary
shadow flower
#

^

#

well it should

thin hornet
#

i mean

shadow flower
#
Callframe at: table.insert
function: MCM-Distributions.lua -- file: MCM-Distributions.lua line # 17
thin hornet
#

crate doesnt have items

#

xD

shadow flower
#

good grief

thin hornet
#

you have to add it to the procedural list for that one

#

i supose

shadow flower
#

So the way I had it before where it didn't work -_-

willow estuary
#

Basically, you have to scrupulously check every roomdef/container combination to see how you need to set up each individual distro table insertion.

shadow flower
#

Will do thanks

#

I'll get this eventually lol

willow estuary
#

In Distributions.lua and ProceduralDistributions.lua, located in media/lua/server/items

shadow flower
#

so for ["all"]["crate"] that is suburb?

willow estuary
#

It is for me

table.insert(SuburbsDistributions.all.crate.items, "CokeBaggie")
table.insert(SuburbsDistributions.all.crate.items, 0.01)
shadow flower
#

okay sweet thats how mine looks

#

So this should be right

table.insert(ProceduralDistributions.list.farmstorage.crate.items, "MCM.testItem");
table.insert(ProceduralDistributions.list.farmstorage.crate.items, 1.4);
#

or do you not get access to the container with procedural

willow estuary
#

No, I think you're fundamentally misunderstanding how the distributions tables work with procedural distribution tables.

thin hornet
willow estuary
#
table.insert(ProceduralDistributions.list.WardrobeWomanClassy.items, "CokeBaggie")
table.insert(ProceduralDistributions.list.WardrobeWomanClassy.items, 1)
thin hornet
#

ProceduralDistributions.list.CrateFarming.items for example

willow estuary
#

You have to insert to the actual procedural tables,.

shadow flower
#

right

willow estuary
thin hornet
#

Are you working on a drug mod?

willow estuary
#

Nah, that's been on the workshop for a while?

thin hornet
#

kk

shadow flower
#
table.insert(ProceduralDistributions.list.gardenstore.items, "MCM.testItem");
table.insert(ProceduralDistributions.list.gardenstore.items, 1.2);
#

So like that

thin hornet
#

no

shadow flower
#

that one doesn't have items right

thin hornet
#

When the Distribution table use procList
It mean it take the procedural list

#

so you have to go into C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\lua\server\Items\ProceduralDistributions.lua

#

then you find the proc List there

shadow flower
#

so for example GardenStoreMisc

thin hornet
#

yeah

shadow flower
#

sooo

table.insert(ProceduralDistributions.list.GardenStoreMisc.items, "MCM.testItem");
table.insert(ProceduralDistributions.list.GardenStoreMisc.items, 1.2);
thin hornet
#
table.insert(ProceduralDistributions.list.GardenStoreMisc.items, "MCM.testItem");
table.insert(ProceduralDistributions.list.GardenStoreMisc.items, 1.2);
#

yeah

shadow flower
#

okay sweet, now I get it

thin hornet
#

cool 😄

shadow flower
#

So you can't choose what containers they go in with procedural

thin hornet
#

many Distribution could use that procedural list yes

#

you could create your own and add that list to the distribution

#
ProceduralDistributions.list.MyOwnProcList = {
        rolls = 4,
        items = {
            "MCM.testItem", 10,
        },
        junk = {
            rolls = 1,
            items = {
            
            }
        }
    }
table.insert(SuburbsDistributions.gardenstore.crate.procList, { name="MyOwnProcList ", min=0, max=99, weightChance=100 })
shadow flower
#

Thanks

#

Well this makes my distributions file alooot smaller lol

thin hornet
#

So what would happen if we ran a dedicated server on the unstable branch and then the main branch update later? Also how do we specify the beta branch for the dedicated server?

shell terrace
#

With the new substation.... Please un-hardcode generators 😢

thin hornet
shell terrace
#

I was hoping to increase the range from the Substation out, depending on how many of the pylons are repaired.

faint jewel
#

is there an online lua checker or something? it will NOT load my file any more.

shell terrace
# thin hornet what do you want to do with the generator?

Maybe set an invisible generator at the center of the map that would have maybe 100 tile range, and then require electrical + supplies to "repair" the pylons in the substation, and for each repair, increase the range of the generator by another so many tiles or something. But Generator Range is hardcoded. I'm assuming placing a running generator every 20 tiles is not a good idea.

shadow flower
#

That would be pretty neat to do, have a whole community wired up by a cache of generators

faint jewel
shell terrace
#

Yeah, I imagine it to be some sort of community event, keeping the substation running would be pretty difficult even for a group of electricians.

shadow flower
shell terrace
#

Ooh. Could probably get some Lumberjacks to cut wood and make charcoal though.

#

Probably makes a lot of noise, have to keep the zombies off thinking3d

shadow flower
#

I'm not sure if charcoal would even work in a boiler, not nearly enough heat to turn that big of a turbine

shell terrace
#

Unfortunately we're missing a mine though, so it'd have to work lol.

shadow flower
#

now fission, thats where its at lol

faint jewel
#

SON OF A

#

why wont you load my lua now?!

faint jewel
#

LOG : Lua , 1645576304384> Loading: C:/Users/Owner/Zomboid/Workshop/RidingMower/Contents/mods/RidingMower/media/lua/shared/RidingMowerSpawnList.lua it never loads my RidingMower.lua

faint jewel
#

internal screaming

#

i give up.

#

files that DID work, dont now.

#

is there a file cache or something?!

drifting ore
#

Does anyone know how room temperatures of houses is calculated?

long edge
#

Anyone know the mod that lets you pull the water bottles off the water dispensers?

strange sequoia
#

Hey again, i made the clothing.XML for my mod and i was wondering if i absolutely have to make the "ZombieZoneDefinitions.LUA" file and set every outfits one by one or will the outfits spawn randomly like the hair from my first mod do.

When testing i sometimes see zombies wearing the outfits i made but it's very few and random

chrome egret
# drifting ore Does anyone know how room temperatures of houses is calculated?

This is tough. The only references I found in Lua are either commented out/replaced or in debug code. I see PlayerClimateDebug registers some temperature-related variables based on self.player:getBodyDamage():getThermoregulator(). Following the trail in the Javadoc, Thermoregulator has a getExternalAirTemperature() method. That's about all I can divine at the moment.

dark crescent
#

Hey all, are there any resources out there that explain multiplayer compatibility in mods? I've just finished my mod and now want to make sure that its going to be MP safe but I cant seem to find any guides on this and thought someone here might be able to point me in the right direction

frank elbow
lone otter
daring palm
slate lynx
#

Is there a mod that lets you load and unload crates and such?

#

Or access loaded containers atleast?

dark crescent
#

@daring palm Thanks, I have done that, I currently have the mod install on my dedicated server and everything seems to works fine. I was just wondering if there was an info on best practices etc. Seems I will just have to check out the source and a few mods and get an idea of what's required. My main concern is that because I interact with worldobjects and inventory that something could go wrong and either duplicate or delete items due to sync issues.

daring palm
#

well you may open as many new clients as you want and connect to the local server to test things

#

you may spot sync issues right there

chrome egret
#

Does it make much difference testing with the Steam vs. non-Steam servers?

shadow flower
final smelt
#

Hey can you guys make dragon breath shells, we want them. Thanks

rose notch
#

I wonder if it’s worth making a C.H.UD. Inspired zombie retexture

errant meteor
final smelt
#

Damn

#

Then can you add the l4d electric guitar sounds to pz's one? thanks.

dark crescent
#

Ok, I have a bit of a head scratcher. In my custom timed action PFGPushAction I can useself.inventory from function PFGPushAction:perform() just fine but when I try to use if from function PFGPushAction.isValid() I get a nil error. I can see in the source code that I should be able to use self.inventory in isValid() but mine just does not want to work

#

function PFGPushAction.isValid() for i,v in ipairs(PFGMenu.typesTable) do if self.inventory:contains(tostring(v)) then --Problem line return false end end return true end

dawn shuttle
#

Greetings! I come bearing gifts! Well, a gift, a new method to manage and quickly export translations for PZ mods! cheese777Vote1

I've made a tutorial explaining how it works here: https://steamcommunity.com/sharedfiles/filedetails/?id=2762135456

If you're tired of how your translations are managed, I suggest you give this a try. Feedback and comments are always appreciated. Cheers!

Steam Community: Project Zomboid. Combining the flexibility and accessibility of Google Sheets with a one click solution to generate the Translation files!

Link to the file: https://docs.google.com/spreadsheets/d/1ooD8gsax1FKceatHDMK

dusk saddle
#

I have returned for another quick question about OnCreate recipes, and specifically, what the proper way to have them give you, say, three different items would be. I'm a big fan of having litter junk items after use, so all of my food items (packaged anyways) make use of oncreate to give you both the food and an empty wrapper. I recently made a box of mac 'n cheese, though at the moment I can't seem to have it give me extra items. For instance, making the recipe will currently give me the cheese seasoning packet and of course a saucepan with the noodles inside, but I'm also trying to have it give me the box. What would be the most efficient means for that?

final smelt
#

Can someone add the death till us apart map stand-alone. Its probably not hard bc the map is already in the game as a challenge map.

undone crag
undone crag
hidden compass
#

I would like to apply a color mask to the player, as shown in the attachment.
"setHighlighted" and "setHighlightColor" of IsoObject are also tried.
But they work for Object, but not for the player.

Any ideas?

dusk saddle
jade helm
drifting ore
late hound
#

Heyo peeps!
So a thing that changed with the unstable .66 build is how the ClothingType item tag
ClothingItemExtra = PonchoYellowDOWN, works.
Now with your mod items, you need to specify your module name to avoid the item erroring out on Double Click.
Here is an example of what I got working. My item module name is: "AuthenticZClothing".

    item Authentic_Headphones
    {
        DisplayCategory         = Electronics,        
        Type                     = Clothing,
        DisplayName             = Headphones,
        ClothingItem             = Authentic_Headphones,
        ClothingItemExtra        = AuthenticZClothing.Authentic_HeadphonesNeck, ---This line---
        ClothingItemExtraOption = WearNeck,    
        clothingExtraSubmenu     = WearHead,            
        BodyLocation             = Necklace,
        Icon                     = Headphones,
        Weight                     = 0.3,
        ChanceToFall             = 25,
        WorldStaticModel         = WorldItem_HeadPhones,
    }
#

Before in .65, you did not have to add that specification. Now with the new build, since there is new code that puts tooltips on all modded items, you have to add this little detail.

thin hornet
#

for TIS
To add onto AuthenticPeach post, it seem that the usage of the ClothingItemExtraSubmenu is broken for item with a custom module name other than Base.
So maybe it might be something about this line where it get the type instead of the fullType
client\ISUI\ISInventoryPaneContextMenu.lua line 3514

spring kraken
spring kraken
#

Could this code allow for speeding up the server by using the same variable that sleep uses? (let's assume the sleep check doesn't overwrite it, even though I know it does)

local function setFast(msg,tab)
    if msg == ".fast" then
        network.GameServer.bFastForward = true
        network.GameServer:syncClock()
    elseif msg == ".normal" then
        network.GameServer.bFastForward = false
        network.GameServer:syncClock()    
    end    

end
Events.OnAddMessage.Add(setFast)

or am I misunderstanding which java variables I can access through lua?

spring kraken
#

Looks like LuaManager$GlobalObject.class doesn't expose GameServer directly. So that is a no.
Honestly, I don't understand why all the lua methods aren't just exported directly from Kahlua and added to the wiki. Seems like minimal effort would make modding significantly more accessible.

Does anyone happen to know if tampering with the java files on a dedicated server will give issues?

drifting ore
#

Does anyone know good special infected mods? And if so can you link it thx

spring kraken
#

in network/GameServer.class, there's the following logic

int n10 = 0;
int n11 = 0;
for (int index5 = 0; index5 < GameServer.Players.size(); ++index5) {
    final IsoPlayer isoPlayer = GameServer.Players.get(index5);
    if (isoPlayer.isAlive()) {
        if (!IsoWorld.instance.CurrentCell.getObjectList().contains(isoPlayer)) {
            IsoWorld.instance.CurrentCell.getObjectList().add(isoPlayer);
        }
        ++n11;
        if (isoPlayer.isAsleep()) {
            ++n10;
        }
    }
    ServerMap.instance.characterIn(isoPlayer);
}
setFastForward(ServerOptions.instance.SleepAllowed.getValue() && n11 > 0 && n10 == n11);

Could automatic fastforwarding be implemented by simply changing if (isoPlayer.isAsleep()) { to if (isoPlayer.isAsleep() || isoPlayer.isDoingActionThatCanBeCancelled()) { on the dedicated server?

clear geode
#

Any modders online? I need help. I finsihed making a pistol gun mod, everything is okay so far but an error line came out. It says.. "Error: Missing Translation "Pistol". I wanna know how to fix it hehe

willow estuary
# clear geode Any modders online? I need help. I finsihed making a pistol gun mod, everything ...

Those messages really need to be removed from the game, as they're inconsequential "developer nagging" and not indicative of anything serious that can affect people using the mod.
However, if you want to remove that message look at \ProjectZomboid\media\lua\shared\Translate\EN and the file ItemName_EN.txt for an example of how you can set up translations for your new item.
Generally however, only console messages with "Stack Trace" are anything of genuine concern.

clear geode
willow estuary
#

Np! 👍

gilded hawk
#

Can anyone suggest me the best vscode lua extension? with something similiar to JSDocs support if possible

shadow geyser
daring palm
#

guys, I need some help. I'm about to release the exoskeleton mod, but I found some clothing issues.

There are some specifics clothes I'm wearing that overlaps the exoskeleton armor in that area. I'd like to keep the skeleton clearly visible over any cloth.

Here's the issue when I wear the bulletproof vest

#

Oh. I tried to push the faces of the exoskeleton's mesh outwards and It didn't work

little vessel
#

@late hound

Hate to do it this way but honestly this saves me some time from fixing it myself every time the mods are updated plus no other way to report it. And I don't know Shark's Discord handle, so any help on that would be welcome.

Shark's and Peach's Military Uniform Improvements
Distributions_SMUIClothing.lua
Lines 153 and 155
Items are named "SMUIClothing.Jacket_CamoUrban" instead of "SMUIClothing.Jacket_ArmyCamoUrban"
Jacket_CamoUrban doesn't exist.

Shark's Law Enforcement Overhaul
Distributions_SLEO.lua
Line 66
Item is named "SLEOClothing.GreenLegPouch_Right" instead of "SLEOClothing.GreenLegPouch_RLeg

Line 69
Item is named "SLEOClothing.BlackLegPouch_Right" instead of "SLEOClothing.BlackLegPouch_RLeg

Line 75
Item is named "SLEOClothing.ElbowGuards" instead of "SLEOClothing.ElbowPads

Line 78
Item is named "SLEOClothing.KneeGuards" instead of "SLEOClothing.KneePads

daring palm
rigid snow
daring palm
#

np

faint jewel
#

morning all

#

anyone mind testing this mod see if the lua loads for them?

#

i feel like the game cached a bad one and now it wont delete it

daring palm
#

drop it

cinder grotto
#

this is the start of my .lua

#

and the end

#

I also tried changing the spawn chance like this

#

neither works

#

can someone please help me with this?

chrome egret
#

What error are you getting?

cinder grotto
#

where can I check that?

#

I think it's this

faint jewel
#

does PZ cache mods somewhere? and if so where? i need to clear one out.

pulsar niche
#

Do we have a mod that lets you make some kind of a mark on a zombie once you are done looting it so you don't have to return back to them later, checking, did you loot them or not?

chrome egret
#

That's a handy idea!

stark crescent
#

Hey, does anybody know if it's possible to extend the discord integration with a mod? On the surface it doesn't seem possible as I guess none of it is exposed in lua 😦

#

And I presume the lua is sandboxed so wouldn't be possible to make arbitrary web requests to trigger the discord bot?

#

In which case, I would think the only alternative would be to have a separate bot which just watches the server log file and responds to things in there, and/or inspects the save files for info?

spring kraken
#

Unless you're willing to dig into java bytecode, I don't think it's feasible

stark crescent
#

I am certainly not willing to do that 😄

#

I'll knock together a standalone bot and see how that works

spring kraken
#

I am currently working on something in bytecode, but the spaghetti makes it hard

stark crescent
#

Interesting - Anything I can follow for that? Happy to offer help although Jave is not my wheelhouse

cinder grotto
#

I removed the lines causing errors but the spawn tweaks still don't work

spring kraken
stark crescent
#

I'm a c++ dev by trade and have dabbled in asm when necessary. Basically I'd like to be able to use bot commands from discord to query things about the game/server, so there's a number of ways I can imagine it being done, but fundamentally if there was something which allowed control over received/sent discord messages then that would cover most things

spring kraken
stark crescent
#

Or perhaps even if the in-game chat is exposed in lua, then that would work with just the default discord mirror

#

Ah, OnWorldMessage may be useful

spring kraken
#

says here it is obsolete

stark crescent
#

Yeah have found the new one

#

in general chat message stuff might be enough to get what I want, effectively just leave the discord bit up to the official integration, and add all the "bot" behaviour to the in-game chat

gilded hawk
#

Does anyone know the lua fuction for the attack animation? With both melee and firearms?

#

I need to make the player attack randomly Thinkedit

cinder grotto
#

someone please tell me why won't it work

nimble spoke
cinder grotto
#

yes, from Filibuster Rhymes' pack

nimble spoke
#

if your mod loads that file before Filibuster's those changes will not apply

cinder grotto
#

is there any way to give priority then?
I tried moving them up and down on the multiplayer mod list

#

didn't change anything

nimble spoke
#

You can make your file require his file

worldly olive
#

I may be wrong but you could add a require

cinder grotto
#

oo, I'll try this

faint jewel
#

oh yeah... well i hacked a gibson!

#

i even took part of a garbage file as proof.

stark crescent
#

You know the file you're editing isn't the same name as the one in the error message?

#

It also mentions which line is the problem - #24

#

It's hard to tell as you don't have line numbers visible, but I think that line is just outside your screenshot

cinder grotto
#

I added the require on steam and nothing changed
does the require have to be a line in the mod files?

#

apparently yes

worldly olive
#

It is a line in the mod files.

This is for example from my mod

require "TimedActions/ISBaseTimedAction"

faint jewel
dusk saddle
#

Hmm, for mods I guess you could look around in Steam's Workshop folder with the 108600 ID just in case it didn't remove itself

cinder grotto
#

added the require, still doesn't work

#

tested both under and above original mod on the list in the multiplayer mods

faint jewel
#

i didn't publish it. it's still all local.

worldly olive
#

No no, you need to add it to your file that does require it. For example this is one of my file, and this one in particular requires the vanilla file, so I have the require at the top of the file

cinder grotto
#

oh, so it should be in the lua file?

worldly olive
#

Yes yes exactly

#

It basically means that your file requires the other file, so it solves the problem

cinder grotto
#

okay gonna try it now

#

excuse my stupidity

#

so like this yes?

worldly olive
#

FRUsedCars is the modID right? you need to specifcy the folder/name of the file you require

cinder grotto
#

it's the mod ID yeah

worldly olive
#

You need to identify which file from the other mod you need and use that

cinder grotto
#

so the full file location like this right?

#

this is the original file with the spawn values

worldly olive
#

I'm not really sure so if somebody else confirms would be cool but I think you can simply say

require "FRUsedCarsSpawnListNEW.lua"

BUUUUT again, I'm not sure

cinder grotto
#

alrighty, gonna test it

opaque fiber
#

anyone know where base-game animations are stored at?

worldly olive
#

Again, if I'm not wrong what I understand is that it will search inside client/server/shared folders, in this case the file is in
shared/file so you don't have an extra folder like

shared/anotherFolder/file which in this case you would require something like

require "anotherFolder/file"

opaque fiber
worldly olive
cinder grotto
#

okay

#

it seems to work

#

but

#

not fully

worldly olive
#

You may require multiple files?

cinder grotto
#

went through wreck congestions and mall parkings lots
and I didn't see any of the cars I don't want to spawn except for one

#

gonna try one more time and then another with one car set to 100 spawn chance

#

changed the volvo spawn chance to 100 and now I can confirm it works

#

@worldly olive thank you dearly for the help, I would've gone insane without it lol

worldly olive
#

Awesome!! 😄

frank rivet
#

Is there a attach to back from ground mod out there.

spring kraken
#

Well it's finally done. I managed to add fastforward in multiplayer without sleeping. Now my mates and I can read books at a reasonable pace. I don't think I will be craving Italian anytime soon though 🍝

#

Had to use IsoPlayer.isSitOnGround() instead of IsoPlayer.isReading() or IsoPlayer.isDoingActionThatCanBeCancelled because both of those are only available on the clientside though 🤡

faint jewel
#

so i did a full reinstall of PZ. the ONLY mod i am loading is mine. there are NO errors. and my ridingmower.lua is not being loaded. if i send the mod to anyone else. it loads for them. i need some help.

drifting ore
#

Is there any info on like, the actual damage/attack speed formulae or is that all still unavailable?

shadow geyser
faint jewel
#

there's NO error.

#

LOG : Lua , 1645637269235> Loading: C:/Users/Owner/Zomboid/mods/RidingMower/media/lua/shared/RidingMowerSpawnList.lua

#

that's the ONLY line

#

and my file that's missing is RidingMower.lua

#

I need an adult!

frank elbow
#

If you rename it, does it still not load?

faint jewel
#

yup

#

renamed the mod AND the file.

#

if i send you a copy of the mod it will load fine.

thin hornet
faint jewel
#

i have fully reinstalled pz.

thin hornet
#

if so then there is an error in the file

faint jewel
#

want me to send you the mod ... so it can load just fine?

thin hornet
#

just the file

faint jewel
#

it's literally JUST ME that it's not laoding for.

drifting ore
#

Anyone tried my UI library ? I'm about to update this mod with The Only Cure, so if you have any feedback, I take

faint jewel
#

i have not mr bounty. sorry. i plan to! but cannot at the moment.

drifting ore
weary crypt
#

What defines if a weapon has a detachable magazine or an internal magazine?

little vessel
#

Anyone has any idea which mod uses the "CSword" module? It also adds a EntrenchmentTool. Also does anyone knows which mod adds the 1, 2, 5, 10, 20, 50 and 100 DollarBundle? Items like "100_DollarBundle".

drifting ore
calm depot
#

not sure if it matters, since the game probably corrects it anyway, but I'd suggest using / rather than \

little vessel
calm depot
#

oh, thanks Discord for only showing me commentary from hours ago

calm depot
#

@little vessel is it a mod you have installed?

little vessel
calm depot
#

is this something not on the workshop?

#

people should be marking other mods as a dependency of theirs, if they rely on it

#

they may (should) also have done that in their mod.info

#

but depending on what you're doing, you might be able to get away with only doing the link in Steam's UI

little vessel
# calm depot is this something not on the workshop?

Dunno. No idea. It's no big deal - I'm just cleaning my console.txt out of "ghost" distributions to guarantee everything is working and spawning as it should (as the game tells you if an item doesn't exist and you are trying to spawn it). If an item doesn't exist, it still generates a log entry

ItemPickerJava.ExtractContainersFromLua> ignoring invalid ItemPicker item type

Which doesn't really break anything but pollutes the file. So I remove the items from the distribution table if their respective mods are not active, thus cleaning it. Except I cannot for the life of me figure out these two.

calm depot
#

you mean you can't figure out which mod on your HDD is putting some junk in (Procedural)Distributions?

little vessel
# calm depot you mean you can't figure out which mod on your HDD is putting some junk in (Pro...

I can figure out which mod is putting these ghost entries, I cannot figure which mod these ghost figures are supposed to be from.

For example, Expanded Helicopter Events. It adds Firearms B41 items to the loot tables. So I do

if getActivatedMods():contains("ExpandedHelicopterEvents") and not getActivatedMods():contains("firearmmod") then
        RemoveItemFromDistribution(VehicleDistributions, "Base.MP5");
        RemoveItemFromDistribution(VehicleDistributions, "Base.M60");
        RemoveItemFromDistribution(VehicleDistributions, "Base.AmmoCan762");
        RemoveItemFromDistribution(VehicleDistributions, "Base.762x51Box");
        RemoveItemFromDistribution(VehicleDistributions, "Base.Bullets9mmBox");
    end

And that cleans it up a bit.

#

EHE doesn't really suffer if I don't have Firearms B41, but the console.txt log gets a bit more cluttered.

calm depot
#

why not just query ScriptManager for each item name and see if it returns you a definition

faint jewel
#

oh god the spam.

calm depot
#

then you don't need to care what mod it is, you just have a small loop that nukes everything ScriptManager doesn't know about

little vessel
#

Hmm can you explain it with code, please?

calm depot
#

local sm = getScriptManager()
for <items> in <distributions stuff>
if not sm:FindItem(<item>) then <nuke it> end

little vessel
#

Hmm that makes sense and might be easier than what I'm doing so far. Thanks, I'm going to try it.

calm depot
#

if for some reason getScriptManager() isn't a thing, though I'm pretty sure it is, ScriptManager.instance also works

#

it also means you won't clobber items from mods that don't use a script file to instantiate them

#

though I think if you want the items to persist, you have to generate a script file - at least, I had to

#

but, you probably don't care about that.

#

However, what you might care about is caching the result, because I believe FindItem is going to be a linear search

#

and if there's a shitload of items, it might make your server startup times suck quite hard

errant meteor
#

:[

thin hornet
#

xD

weak jay
#

before im going to even research how to make a mod for zomboid - is it even possible to change the mainmenu music?

weak jay
#

thanks

left plank
#

I’d appreciate if you followed the rules, specifically with including a full dick in the image.

faint jewel
#

I need to know how to make an animation work period lol.

slow graniteBOT
#
Robert Mölders#6123 has been warned

Reason: Don't post stuff like that here.

gilded hawk
lusty nebula
#

@left plank Ok understood ( But you should have had a bit of humor as it was clearly intended )...and by the way....That frog displaying a human ass is not exactly in line with your moderation mate...just to say....

stark crescent
#

I thought it was funny

rain current
#

does anyone happen to know if there is a way to detect a player has "quit" the server but before that user's chat session closes?

#

...from the client side of course

gilded hawk
#

Is there a way to manually invoke this events?

Events.OnPressReloadButton
Events.OnPressRackButton
thin hornet
#

triggerEvent("OnPressReloadButton", param1, param2, etc)

gilded hawk
#

Oh thank you so much ❤️

#

i was mashing my head on this stuff for the last hour

gilded hawk
#

because I need to summon Hook.Attack too

thin hornet
#

i dont think so\

#

TriggerHook doesnt seem to be exposed

gilded hawk
#

Ah, >.< so how can I force the player to perform the attack or shove?

weak jay
#

i dont get my mod to show up in the modlist, its supposed to be a mainmenu music replacer and i had some help by copying the filestructure of a 41.50 version mod. Does that mean they changed the method

thin hornet
#

maybe LuaHookManager.TriggerHook() works idk

gilded hawk
thin hornet
#

try it

gilded hawk
weak jay
weak jay
#

you maybe want to have a look at it?

#

just to confirm its correct

weak jay
#

i see

thin hornet
#

for the file structure did you try make a mod with the template mod?

weak jay
#

no i deleted that

thin hornet
#

use it

#

and place the files in the correct locations

#

remove what you dont need like the template maps that come with it

thin hornet
#

using Hook.<EventName>.Add() seem to only add it to a kalhua table that java will read

gilded hawk
#

Oh, okay sad, but okay

thin hornet
#

but if we look where that hook is triggered in java we can maybe call that method

gilded hawk
#

Thinkedit?

#

Can we cal java function rom lua?

thin hornet
#

so you want to trigger Attack hook

gilded hawk
#

Yes

#

And the shove, if possible

thin hornet
#

its triggered when

#

playerObj:AttemptAttack(float) is called

gilded hawk
#

So, player:AttemptAttack(0)?

thin hornet
#

and doesnt trigger with barehand

gilded hawk
#

Ah

thin hornet
#

so must have a weapon

gilded hawk
#

Barehands goes directly in the shove function?

thin hornet
#

now when isoPlayer call AttemptAttack(this.useChargeTime); it pass in the useChargeTime

#

i supose it like the delay between each attack

#

actually idk

#

i think you can omit the parameter

#

player:AttemptAttack() should do

gilded hawk
#

So, with a melee weapon player:AttemptAttack(0) is working

#

Still, no bash yet

thin hornet
#

AttemptAttack work with any living character but the hook will only trigger for IsoPlayer type of character

#
   public boolean AttemptAttack(float var1) {
      HandWeapon var2 = null;
      if (this.leftHandItem instanceof HandWeapon) {
         var2 = (HandWeapon)this.leftHandItem;
      } else {
         var2 = this.bareHands;
      }

      if (var2 != this.bareHands && this instanceof IsoPlayer) {
         AttackVars var3 = new AttackVars();
         SwipeStatePlayer.instance().CalcAttackVars(this, var3);
         this.setDoShove(var3.bDoShove);
         if (LuaHookManager.TriggerHook("Attack", this, var1, var2)) {
            return false;
         }
      }

      return this.DoAttack(var1);
   }
#

also if it find a hook return true it will not do the attack

gilded hawk
#

Oh, okay interesting

#

So, the issue of the Attempt attack is solved, what about invoking the shove? Thinkedit

thin hornet
#
   public boolean DoAttack(float var1, boolean var2, String var3) {
      if (!this.authorizeMeleeAction) {
         return false;
      } else {
         this.setForceShove(var2);
         this.setClickSound(var3);
         this.pressedAttack(true);
         return false;
      }
   }
#

var2 is boolean and mean force Shove

#

so player:DoAttack(0, true, ""); i supose could work

gilded hawk
#

I will test it right now

faint jewel
#

PLAY MY DAMN ANIMATION GAME.

#

it's either no animation or error.

gilded hawk
thin hornet
#

yay

gilded hawk
#

local function Tourette_Init()
    if skipFirst then
        skipFirst = false
        return
    end
    local player = getPlayer()
    local roll = ZombRand(100) + 1
    local vehicle = player:getVehicle()
    local weapon = player:getPrimaryHandItem()

    print('Tourette roll:'..tostring(roll))
    if roll > 0 then
        if vehicle and vehicle:isDriver(player) then
            ISVehicleMenu.onHorn(player)
            return
        end
        if not (player:isDoShove() or player:isSprinting() or player:IsRunning()) then
            if weapon then
                -- Rack the gun
                if weapon:isRanged() then
                    if ISReloadWeaponAction.canRack(weapon) then
                        triggerEvent("OnPressRackButton", player, weapon)  
                        return
                    end
                else
                    -- Swing melee
                    player:AttemptAttack()
                    return
                end
            else
                -- do shove
                player:DoAttack(0, true, "")
                return
            end
        end 
        player:Callout()
    end
end
willow estuary
#

Ahahahahahahah WTF?!?!?!

#

😄

gilded hawk
#

ChikaShrug I got asked to add it to my mod

willow estuary
#

😄

#

Okay, you get a Pat_Bren for this one on account of how zany it is.

gilded hawk
thin hornet
#

So does everyone update their mod for the unstable branch atm? and what will that do to the server not upgrading yet (that we already know 😆 ) but im wondering what you guys doing about it.

daring palm
#

Is there a function available to return some sort of WorldUUID?

thin hornet
#

getRandomUUID()

#

not sure if thats what you asking for

daring palm
#

I need a number that uniquely identify the world creation

#

it must be consistent as long as there is no reset

willow estuary
#

It's just a matter of waiting for 41.66 to be stable in my books, and then time to use the new cool stuff 🙂

thin hornet
willow estuary
#

Oh man, it was added for the fish or fish fillets that spawn in stores, and it's like discovering unobtanium by accident!

thin hornet
#

Cause i want to update computer mod to randomise the game CD properly using OnCreate

#

But as you say that will not break anything

#

will just not work until next official release

willow estuary
#

I feel like .66 will go stable soon, haven't heard any issues re it?

thin hornet
#

honestly didnt see any issue with my mod pack so yeah pretty good for now

willow estuary
#

Oh, isHidden for recipes is very intersting as well.

thin hornet
#

havent really tested on a server with people for now

#

hum let me check this out 😄

willow estuary
#

It makes it so recipes with that flag don't show up in the crafting interface itself, just right-click-on object.

#

So if you want to not bloat the recipe interface for stuff like, say, "unfold multitool".

thin hornet
#

sick

willow estuary
#

Oh yeah, very fucking sick.

thin hornet
#

that will make the recipe UI much faster i suposed without the bloat

willow estuary
#

||as well as puzzle/mystery stuff 🙊 ||

thin hornet
#

much easier to browse too

#

yuup

willow estuary
#

Well, I'm not sure about that, in that it might still need to evaluate the recipe?

#

But hopefully!

thin hornet
#

right it still loop it all

#

but if hidden it still skip all the code inside that loop

#

might help

drifting ore
#

How do I send an animation for a player on the server ?

willow estuary
#

But yeah, those are the two BIg Cool Things in 41.66 that popped out to me 🙂

thin hornet
#

i do think playerObj:PlayAnim() should sync too but havent tested yet

drifting ore
#

Mmmm, but I see only one game doing the animation

#

I use self:setActionAnim("WearClothing")

thin hornet
#

setActionAnim should be sync

#

if the other player start the action and is in range of you

#

if you arrive after he started it you will not see it

drifting ore
#

I think it's because in my timed action, character is the other player

thin hornet
#

but also if you try to change the animation while the action is running it will not change

#

what do you mean your timed action is on the other player

drifting ore
#

They just next to each other

thin hornet
#

the Action will be transmitted and running on the player that start it on each player clients

#

when do you define the animation in the action

drifting ore
#

I mean that the variable character, which I presume is the one the anim is set, is not the local player

drifting ore
thin hornet
#

you start a timed action from ClientA onto ClientB?

drifting ore
#

No I make a timed action an clientA, clientB got no anim, nothing, just need to stay

#

just at the end, at perfom I send a command to playerB

thin hornet
#

in your action:start()
if you run self:setActionAnim(animName); it should work for all client

#

thats very just simple like that

#

now if it doesnt work thats strange

drifting ore
#

I think I can't explain well

#

I will try something and I will back

thin hornet
#

I wonder if the door sync glitch has been fixed in 41.66
Been searching the whole source code to find what could cause it but no luck
Doors just opening randomly when passing by or walking into it (in MP only)

drifting ore
#

Ok that was it

wary kettle
#

I'm trying to get into lua modding PZ and ran into an issue I was hopping someone had experience with.
Any idea why this lua script snippet might be failing?

local function OnVehicleHorn(character, vehicle, pressed)
    print("Scripting: On Vehicle Horn Event triggered")
end

Events.OnVehicleHorn.Add(OnVehicleHorn)  -- zombie.Lua.LuaManager RunLuaInternal SEVERE: at betterHorn.lua:34

I tried the exact code on the (wiki)[https://pzwiki.net/wiki/Modding:Lua_Events/OnVehicleHorn] and also modified the function definition based on the code at ProjectZomboid\media\lua\server\Vehicles\Vehicles.lua. The vehicle enter event works with identical code, and I verified the Events object contains the method OnVehicleHorn and further contains the Add method.

I'm running the script from the lua/client directory in a single player world if that matters.
(moved from mod_support to here as this was the correct chat)

drifting ore
#

self:setActionAnim set an anim for the variable self.character and it's need to be the local player

thin hornet
drifting ore
#

No, just the local player make an anim

#

Like that it's easy

#

easier*

thin hornet
#

well if you got it working thats cool

drifting ore
#

Yep, I should of try that before asking

fair crater
#

Are there any mods that let you play custom music ingame? Is that even possible if not?

thin hornet
#

search music on the workshop youll find plenty of example

fair crater
#

I mean like using a radio to play music. And custom like you choose the song, not a mod that replaces the ingame music with whatever

thin hornet
#

You can play music into the world

#

you can play the music from a character or from a square.

abstract raptor
hot patrol
#

also how do you guys do possitioning for models?

#

I am using the attachment editor with debug and I hate it

hot patrol
#

in general

drifting ore
#

Uh

#

Well idk if you can specify different placement for different situations

#

Like without a backpack on it would make sense to just attach in on the back

#

But with a backpack on I would just not allow it to be carried on the back

hot patrol
#

oh you can.

drifting ore
#

Oh can you

hot patrol
#

without a bag

drifting ore
#

Maybe just have it sit like

#

On the bag itself

#

Like so the bag is sandwiched between the pillow and player

dusk saddle
#

^ I would think maybe a blanket roll-style of thing, though I'm not sure if you could change the model depending on where it's placed

drifting ore
#

Also yeah

#

I was gonna suggest like a blanket roll

#

Below the bag

#

But that wouldn't make sense

#

Cus the pillow would be stuffed

dusk saddle
#

I suppose it depends how stuffed, I was thinking on top with just a slight curve to it

hot patrol
#

it might not look right on the hiking bag for example

drifting ore
#

Thats why I suggest like

#

Mounting it vertically on the bag

#

Instead of next to it

dusk saddle
#

Yeah that could work too

drifting ore
#

Similar to like

#

Russian style ruck sacks

hot patrol
#

hmmm

#

you have an image example

drifting ore
#

Cant find a good one

#

Google like

#

SPLAV Backpack

#

Or even the 5.11 Tactical RUSH100

#

Basically

#

Those backs have it so the bottom of the bag sits at butt level

#

But the top of the bag goes above the wearers ehad

#

Head*

#

Like it sits higher on the back

#

But do that with the pillow

hot patrol
#

oh yea that's what I was talkling about

drifting ore
#

So like, the pillow mounted on the back of the bag itself

#

But slightly higher up on the bag

#

Idk how to explain it really

hot patrol
#

that would look kinda gooft do to how long it is

drifting ore
#

Yeah odk

#

Idk

hot patrol
#

I think I might just have to leave it alone

#

looks best this way I think

#

either way like I was saying what do you guys use to position models on the player?

brazen chasm
#

guys

#

we need a mod that adds bicycle

#

bicycles would be a really useful addition

dusk saddle
#

Well, I suppose I'm going to ask here again as I still haven't fully understood so far. Trying to get an OnCreate recipe to add multiple items, eg. saucepan, empty box, and packet. Can only have it give me two items, what's the format for adding an extra item?

#

eg. the AddItem("EmptyRootBeerBox"); for an example on my box of root beers, but would I need AddItem(s), any extra commas or different formats?

hot patrol
brazen chasm
#

yes, but the bicycle would be much better than the skateboards

#

they could make them spawning tied to something with a chain and that to guide them you need to break the chain. And could add a whole part of mechanics, repair, painting and spare parts just for the bicycle

faint jewel
#

anyone here good at tuning cars?

hot patrol
#

problem with 2 wheeled vehicles is they really need more physics to look good. Granted we have the motorbike mod but I feel like a normal bike would be even harder. More animations and such.

brazen chasm
hot patrol
#

oh for sure

chrome egret
#

I noticed this is apparently also coming with 41.66 "Added functions for modders to add trait/profession definitions."

teal slate
#

is 41.66 out now?

#

if so, thank goodness, my radio semi-fix mod is now obsolete

#

ah, looks like it's on an unstable branch, so i'm glad i just edited the title of the mod instead of outright hiding it

brazen chasm
chrome egret
#

Yeah, it's good if it's easier to accomplish now though

brazen chasm
teal slate
#

... oh wait

#

it's not actually in the patchnotes

#

so i'll have to decompile 😩

chrome egret
#

41.66 is released under the Betas tab as "unstable"

teal slate
#

yeah

#

i need to update and crack it open to see if the function i fixed with my patch is... actually fixed

#

since the 'fixed radios' bit seems to have disappeared between the prospective changelog list and the official one

drifting ore
#

Got my mod working but before I publish it, how do I ensure compatibility with other mods that also override the same function, ie. ISToolTipInv:render()?

chrome egret
#

Run an instance of the dedicated server, install both mods, and play on it

drifting ore
#

Let's now pray that I didn't make explode every server xD

drifting ore
chrome egret
#

Yeah, they also have to be written specifically to be compatible is my understanding

#

Which of course not everyone does

#

In fact it specifically mentions ISToolTipInv:render()

nimble spoke
drifting ore
#

how do I get coordinates for a spawn point (like worldX=10, worldY=7, posX=133, posY=163)? Ingame it gives me smth like 3002/5789 when I use the teleport tool

willow estuary
#

The first set of numbers, worldX=10, worldY=7, are the Cells, If you multiply them by 300 they should align with the coordinates you get when you arrive. You might have to apply an offset of 300, just test and see what's necessary.

But what you'd do for the spawn points is divide the X and Y coordinates by 300 to get worldXand worldY, and use the remainder for posX and posY. There may be a 1 cell offset, not sure offhand without testing and doing the math myself?

dusk saddle
drifting ore
#

I don´t get it, so if I want the 3002/5789 spawn I divide 3002 by 300 which is 10.00666666666667 and then ???

#

It´s not going well

#

now I got it

#

so u dont do 3002 / 300 but instead 3000 / 300 and 2 remaining

faint jewel
#

is it possible to change a zombies player model?

#

say i made a model of a box. could i change an existing zombies model to that?

verbal quest
#

Hey all, I'm looking for as much information as possible on Mod IDs

#

I need to know what characters are allowed/not-allowed in a Mod ID

faint jewel
#

I need a vehicle tuner.

#

someone who can make cars drive like they are supposed to.

warm sparrow
#

Hi, what's the fix to making vehicles appear on modded maps in logical locations i.e parking spots, roads etc without spawning them in via cheats?

dusk saddle
faint jewel
#

i just want my mower to drive like a mower, and the trailer to not be an anchor.

lusty nebula
#

What's the difference between OnRenderTick and OnTick? I mean...OnTick is called at every game tick ( or rather about 8-10 milliseconds ) but the display is also continuosly rendered...Maybe the difference resides in the time duration for the event to be called ( Sample: OnTick = 8-10 milliseconds, OnRenderTick = 20 milliseconds )
Any idea?

nimble spoke
runic sparrow
dusk saddle
#

I'd think it'd be a mistake for the code more than the item, as the item spawns just fine if you choose the option to just take the cheese packet out

lusty nebula
#

@runic sparrow Thanks mate, very good guess 😉

runic sparrow
#

I am trying to run a function on the player every update, but its not working. I copied this code from the modding wiki and it wont print anything. can someone help?

lusty nebula
#

Question 2: Is there another event that can be used to replace the OnGameBoot one? ( Asking bacause the mod I'm using generates an error on game start if I use it ). I mean: Is there another event that activates on game boot ( or close by ) but that is not the OnGameBoot one? ( ...and that is not the ONTick one too )

#

@runic sparrow It depends...what you wanna do?

runic sparrow
#

check if the player has an infection, probably by using the isInfected() method

lusty nebula
#

SP or MP?

runic sparrow
#

Preferably both

lusty nebula
#

mmm..ok...the hello word message is displayed on screen or in the chat?

#

Try using OnEveryTenMinutes or EveryHours

runic sparrow
lusty nebula
#

... or EveryOneMinute depending on your needs

#

Just remember that the more is called the more strain is put on the PC ( In theory ) so tests it well first 😉

runic sparrow
#

my mod wont be nearly complex enough for that to be a problem

#

its going to be like, and if statement, and a couple calculations

runic sparrow
lusty nebula
#

What you mean by modifying the player?

strange sequoia
#

Hey hey, anyone know if being on Windows 11 can make some mod glitch or just not work at all ?? My mod doesn't work for someone and the only thing we found is that he's on Win11 and me on Win10

runic sparrow
lusty nebula
#

@strange sequoia Just a guess but I think that the problem is in some mods/files you're using not in the OS...

strange sequoia
lusty nebula
#

@runic sparrow In that case I would use OnTick ( Not recommended but it continuosly call the event ) or EveryOneMinute because I do not think that the infection could spread/change status faster than a less than a minute

runic sparrow
faint jewel
#

either of you two any good at changing animations?

strange sequoia
lusty nebula
#

@Yaki So based on my experience I could say that if you got only 3 people having the issue, most probably they are making some error on their side (...and as always if asked they'll reply " No I've done it all correctly, I'm 100% sure LOOLL 😄 )

#

Another thing that may help....Steam updates are tricky and can generate different files inside a mod even if the mod is exactly the same...I suggest to tell to your user to completely delete the mods of interest and then re-subscribe...

strange sequoia
#

I'm going to update my mod with new content soon so maybe it'll unlock it for them 🤷‍♂️

dusk saddle
#

I can't say I know much about hair modding, but I wish you luck in finding a solution

lusty nebula
#

Maybe..My suggestion is that if it's a critical updated to indicate to users what I wrote above in my previous commet ( ...and don't forget to make a backup first of your currently working mod..Just in case something may go wrong... 😉 )

#

@runic sparrow I was guessing a bit...Most probably for your needs the best one is EveryHours

#

( or rather every some mins IRL )

faint jewel
#

i do believe i am going to scream now.

lusty nebula
#

@runic sparrow Start with this one...if you need something called faster go for the 1 min one

runic sparrow
#

does print("text") not work when i use it inside a function?

lusty nebula
#

@runic sparrow If they don't work there's something wrong in the script or the way in which you are using the events...events can't fail by themselves... 😉

#

@runic sparrow (by the way if you quote your script will be more easy to help you...there's lot of talented people here willing to help with good ideas/fixes 😉 )

runic sparrow
faint jewel
#
local function MowerAnimation(player)
    local vehicle = player.getVehicle and player:getVehicle() or nil
   
    if vehicle and string.find(vehicle:getScriptName(), "Base.RidingMower") then
        local seat = vehicle:getSeat(player)
        --print(seat)
        vehicle:playPassengerAnim(seat, "Mower")
    end
end

Events.OnPlayerUpdate.Add(MowerAnimation)
``` why does this WORK but do NOTHING!?
runic sparrow
faint jewel
#

i mean there's no error but it's not playing my animation./

#

or ANY animation.

leaden notch
#

well firstly player.getVehicle is a method not a property

modest yarrow
faint jewel
#

if i OVERRIDe the default it work, but that will mess up ALL motorcycle mods

#

it's only one frame long

#

this is the default.

#

this is the new one.

#

i want it to use the new one but ONLY if you are in the mower.

hidden compass
modest yarrow
#

try that: vehicle:playPassengerAnim(seat, "Mower", player)

lusty nebula
#

Can you chew zeds with it too? LOOL 😄

faint jewel
#

?

#

same, no error. but no animation either.

modest yarrow
#

So I guess the vehicle is overriding your animation

hearty herald
#

Sanity check, is it actually being called?

modest yarrow
#

and doing it in player update won't work

faint jewel
#

is what being called?

hearty herald
#

The function

faint jewel
#

yeah

#

--print(seat) spams 0

hearty herald
#

And what Ziboo says seems appropraite as well

leaden notch
hearty herald
#

It probably needs to be a vehicle related function where you set the animation

faint jewel
#

on vehicle update?

hearty herald
#

Sounds like a good start to investigate

modest yarrow
#

try "OnEnterVehicle" events

faint jewel
#

is there a list of events?

modest yarrow
#
function ISEnterVehicle:perform()
    self.vehicle:setCharacterPosition(self.character, self.seat, "inside")
    self.vehicle:transmitCharacterPosition(self.seat, "inside")
    self.vehicle:playPassengerAnim(self.seat, "idle")
--    if self.vehicle:isDriver(self.character) and self.vehicle:isEngineWorking() then
--        self.vehicle:startEngine()
--    end
    triggerEvent("OnEnterVehicle", self.character)
    -- needed to remove from queue / start next.
    ISBaseTimedAction.perform(self)
    --ISBaseTimedAction.stop(self)
end
lusty nebula
modest yarrow
#

You should be able to register to OnEnterVehicle

#

and then call self.vehicle:playPassengerAnim(seat, "Mower")

faint jewel
#

Events.OnEnterVehicle.Add(MowerAnimation) like that?

cursive glade
#

yo instead of typing the mod id and name into my config file directly can i add the workshop item in the workshop file for my save?

faint jewel
#

okay NOOOOOO not like that.

#
local function MowerAnimation(player)
    print("fired")
    local vehicle = player.getVehicle and player:getVehicle() or nil
   
    if vehicle and string.find(vehicle:getScriptName(), "Base.RidingMower") then
        local seat = vehicle:getSeat(player)
        --print(seat)
        vehicle:playPassengerAnim(seat, "Mower", player)
    end
end

--Events.OnVehicleUpdate.Add(MowerAnimation)

Events.OnEnterVehicle.Add(MowerAnimation)
``` that just went ham with "fired"
hearty herald
#

Well yes

#

player.getVehicle would error

#

it should be player:getVehicle()

#

and, you don't need "or nil" i think, because player:getVehicle() would return nil if you're not in a vehicle?

runic sparrow
#

would anyone happen to know how to print messages to the chat?

hearty herald
#

Just print or the :say("text") ?

modest yarrow
# faint jewel okay NOOOOOO not like that.
local function MowerAnimation(player)
    print("fired")
    local vehicle = player.getVehicle()
   
    if vehicle == nil then return end
    
    if not string.find(vehicle:getScriptName(), "Base.RidingMower") then return end

    local seat = vehicle:getSeat(player)

    if not seat then return end
      
    vehicle:playPassengerAnim(seat, "Mower", player)
    
end

Events.OnEnterVehicle.Add(MowerAnimation)
hearty herald
modest yarrow
#

Make sure this line works too: string.find(vehicle:getScriptName(), "Base.RidingMower")
print vehicle:getScriptName() to be sure

hearty herald
#

I think string.find might return index number not a boolean

#

And I think in lua, all integers are true?

#

So even if it returns -1 for not found it might still be "true"

#

String1:Contains(String2) I think is usable, which does return true/false

lusty nebula
#

I'm using the OnGameStart event but my script seems to take a couple of seconds before loading the script while starting a new game....any way to let load the script load faster?

hearty herald
#

I think OnGameLoad is when you load the mods in start screen/after changing mods

modest yarrow
#

if string.find(vehicle:getScriptName(), "Base.RidingMower") == nil then return end

#

this should work then

hearty herald
lusty nebula
#

@hearty herald Can't using it, it generate an error when I start the game...I'm starting to get convinced that when you start a new game the game take a couple of seconds to load the scripts by default ( hardcoded I presume )

hearty herald
#

There is also OnCharacterCreate I've seen. What is it you're trying to do?

hearty herald
lusty nebula
#

@hearty herald Basically I'm in the advanced stage of a mod that auto-equips player's clothes...Everything working as planned but in the UI mod ( the one that displays the player's weapons,belt ect ) it takes some second to load the belt slot/icon....I have to check if it's not directly that mod that it takes that time to update ( It works but it takes -10-15 secs to load the correct icon slot )

hearty herald
#

In Lua it seems you can simply check for equality with strings in most cases, so vehicle:getScriptName == "Base.RidingMower" Should work too

hearty herald
lusty nebula
#

@hearty herald Good point I have to check....

hearty herald
#

Atleast the base game UI has a framerate cap, I think default is like 15fps?

lusty nebula
#

( Checked it's already set to max or rather 30 fps )

#

Maybe I need to create something to switch it to 60....

hearty herald
#

It could be that the UI mod has not detected the changes until something else notifies it

lusty nebula
#

I'll take a look at the UI mod let's see if there something in it...

hearty herald
#

If it's waiting for some kind of event to trigger to make changes it's likely that

#

Is the normal inventory UI updating properly that the stuff is equipped?

hearty herald
#

Yeah I checked it too

#

I did reply to myself saying that yes it would work like that

#

But even simpler is probably just using string1 == string2

modest yarrow
#

yep if you are sure that it's a 1:1

hearty herald
#

It should be a 1:1 match in the case of what he is trying to do

#

The lawnmowerscript doesn't change name

modest yarrow
#

yep I don't know never worked with vehicle and don't know what getSCriptName() return

lusty nebula
#

@hearty herald I think I've found the culprit...The UI mod ( Namely the Weapon Condition Indicator one ) uses the event OnPlayerCreated that works but that's slower in respect to OnGameStart....

modest yarrow
#

What happens when you die and recreate a character though ?

hearty herald
#

Could also be a timing/update thing. If there's a way to prod it for force update you could work with it

modest yarrow
#

I guess OnGameStart is not called but OnPlayerCreated is

#

I have some mods that don't work after you respawn a new character, and you have to quit and continue to make them work again

lusty nebula
#

@hearty herald On game start is called while the new game is loading...OnPlayerCreated instead is triggered after that the player spwans....that's why is delayed...

willow estuary
hearty herald
#

@lusty nebula , do you have a lot of mods loaded?

#

It might be delayed extra time if you have a lot of mods using the event which need to finish first.

lusty nebula
#

@hearty herald Yep actually yes...that could be also another cause....what's the ideal/suggested max number of mods enabled to keep activated ( if any)

hearty herald
#

I don't think theres a guideline for it, but things like that is the reason it's good to make efficient code!

lusty nebula
#

Agreed

#

Thanks for the help mate 😉

hearty herald
#

When I was testing stuff I disabled all the mods except the one I was testing, the game loads a whole lot faster

lusty nebula
#

@hearty herald Yep I know ( and I've done the same ) but I've already passed that fase...Now I'm testing how the mod behaves in a normal environment ( or rather with mods activated to simulate the user's standard usage )

#

Everything works fine there's just that little delay in loading the UI icon slots...nothing major but I'm picky as hell so it annoys me LOOL 😄

hearty herald
#

Did you notice the delay when you were going with just your mod?