#mod_development

1 messages · Page 52 of 1

lyric bolt
#

Fuuuuuuuck, why is this not working....

local player = getPlayer();

local modData = player:getModData();

#

I am literally just trying to access the modData as a test and its firing a null table

#

Nvm I think I found that issue at least, was trying to do that before the player existed

#

This has been a troublesome one...

rain iron
#

Is there a way to hide items like armor, bag, hat and such on characters? <m_Masks> and <m_UnderlayMasksFolder> don't seem to work for those stuff

agile lily
#

Does anyone have experience with adding new shaders to PZ or know if it's even possible?

bronze yoke
#

doesn't the blind trait add a shader? it must be possible

lyric bolt
#

Gaaaaaaah this is so fucking annoying. I keep getting a attempt to index non table error from the last block in this function.... maybe I am just not initializing the modData right?


    function transporter.AddPoint( player, id, x, y, z )
        
        local player = getPlayer();
        local modData = player:getModData();
        
        modData.SavedTeleportPoints[id] = modData.SavedTeleportPoints[id] or {};

        if not id then
            error("There was no ID given", 2 );
        end
        if type(id) ~= "string" then
            error("The given ID is not a string", 2 );
        end
        
        
        
        
                -- transporter._regPoints[ id ] = {

        
        modData.SavedTeleportPoints[id] = {
             X = x,
             Y = y,
             Z = z or 0
         };
        

    end

#

Like from where I try to save the coordinates

astral dune
#

is this on the server? getPlayer() only works on the client

lyric bolt
#

yea

#

i assume so at least, its in a Client folder

#

does it need to be on server to save it?

bronze yoke
#

is modData.SavedTeleportPoints initialised somewhere?

lyric bolt
#

how would I do that? I thought this would take care of that

    modData.SavedTeleportPoints[id] = modData.SavedTeleportPoints[id] or {};
bronze yoke
#

modData.SavedTeleportPoints = modData.SavedTeleportPoints or {} before that

#

your code only creates the sub-table for that id, you never created the main table so it's bugging out

thick karma
#

When this happens, you can click Error and still see console info

#

Even when everything is wonktastified.

lyric bolt
#

Yea, still though when you break the debugger you probably fucked up royally somehow

lyric bolt
#

😩 finally

#

Harder than dark souls

ancient grail
#

how do i disable the esc key

#

im doing a heroin mod and i want to make it so that any controls is disabled thru out the effect

#

im almost there its just that when the player pressess esc key the player stands up and cancels the animation

bronze yoke
ancient grail
#

i should replay the animation every tick?

thick karma
bronze yoke
#

nice!

thick karma
#

lmk if anyone has any issues at any screen sizes and I'll fix but I think the way the code is written should work for all sizes.

ancient grail
#

congrats man

thick karma
#

I mean honestly trivial mod lmao but I'm super happy to have it myself

#

Esp on controller it sucked because we don't get the mouseover effect

#

So even the selected mod's name is invisible for us (okay half visible when it's long... We can see short mod names okay.)

ancient grail
#

anyways is there a better alternative than to flood actions ? i mean cant i just store the players keybind then force the keys to do nothing then revert it back to original?

bronze yoke
#

you should check what code makes escape cancel timed actions

#

i'd be interested if you find it, i don't have time to look for it right now but it is causing an unfortunate side-effect with the downed thing

ancient grail
#

im searching every getcore() on the lua

#
-- the true boolean is to create the file is it doesn't exist
    local keyFile = getFileReader("keys.ini", true);
    -- we fetch our file to bind our keys (load the file)
    local line = nil;
    local version = 0
    -- we read each line of our file
    while true do
        line = keyFile:readLine();
        if line == nil then
            keyFile:close();
            break;
        end
        if not luautils.stringStarts(line, "[") then
            local splitedLine = string.split(line, "=")
            local name = splitedLine[1]
            local key = tonumber(splitedLine[2])
            if name == "VERSION" then
                version = key or 0
            elseif knownKeys[name] then
                key = MainOptions.upgradeKeysIni(name, key, knownKeys[name].key, version)
                -- ignore obsolete bindings, override the default key
                knownKeys[name].key = key
                getCore():addKeyBinding(name, key)
            end
        end
ancient grail
#

@bronze yoke

function ISVehicleMechanics:onKeyRelease(key)
    if key == Keyboard.KEY_ESCAPE then
        if isPlayerDoingActionThatCanBeCancelled(self.chr) then
            stopDoingActionThatCanBeCancelled(self.chr)
        else
            self:close()
        end
    end
    if key == getCore():getKey("VehicleMechanics") then
        self:close();
    end
end
#

found it .. but how am i supposed to use this

#

and its for vehicle

rough goblet
rough goblet
astral dune
thick karma
thick karma
rough goblet
#

havent tested the mod

#

I will though

thick karma
#

Cool

ancient grail
ancient grail
faint jewel
#

maybe working on a thing again.

bronze yoke
#

let's goo

wintry stag
bronze yoke
#

oh that's sick

wintry stag
#

You can find it in random male wardrobes

#

It's pretty op btw.

bronze yoke
#

haha well i'd imagine it would be

wintry stag
#

90% of protection against bullets, 85% against bites and 80% against scratches.

#

However, it's heavy too.

#

Probably I will add it to the Workshop soon.

astral dune
#

Found a way to get a list of all the valid targets when a player attacks, but only zombies, not vehicles 😩 I was so close

#

Try again tomorrow

fast galleon
#

#mapping message
You'll probably need to export the right pack, not sure where the flags are though.

ancient grail
#

Can we get the link to this mod? If its uploaded already

mellow wave
#

Hey, quick question. I'm new to modding, and I was wondering if there was a way to create a simple custom meta event, specifically the one that spawns 3D objects like with the chips & soda party?

agile lily
#

Heyo fellas, what's the thing needed to do so you don't have to restart PZ everytime you make changes to your code?

ancient grail
silk hollow
#

Is there somewhere some documentation on how to write the sandbox-options.txt files?
I'm trying to understand what I can do with it (like adding text or maybe a field that is not enabled in which I can write some info etc)

ancient grail
ancient grail
ancient grail
#

Nit sure if theres float actually

silk hollow
#

I think you misunderstood the question @ancient grail. I know about the various type of options. What I am asking is if there is a documentation somewhere because "go and dig random mods" is definitely NOT the way everyone can go about it. For example in the "core" configurations there is the "proper zombies" checkbox that disable the entire page and set it to default values. Is it possible for mod's config? I guess so but how to do it? Someone must know.

gilded hawk
ancient grail
#

Ow thats sad to hear

gilded hawk
# ancient grail Welcome back Mx!

Thank you, I'm here just to inform the devs about this weird thing, I haven't touched my mod in weeks now, so I'm confident is something that happened in the last update

ancient grail
#

Heres the email mx write em some

sour island
#

I assume there's no errors @gilded hawk

#

You'll have to plug in prints every step/if statement and see what it prints

faint jewel
gilded hawk
ancient grail
#

@faint jewel we work for the same server btw

faint jewel
#

oh?

fast galleon
gilded hawk
ancient grail
#

Ye saw a post on support claiming ripping sheets has a bug or something

#

Must be the same issue

fast galleon
#

not last patch but I remember a note saying ripping will be limited

gilded hawk
#

Did they explain it anywhere?

ancient grail
#

Cuz you end up ripping your stuff im guessing

fast galleon
#

I think it was to together with lowering maggots for performance.

#

not that it solved the issue

sour island
#

You can't rip stuff your wearing unless you do it directly afaik

#

There's a specific check for it

#

Performance has probably more to do with it

#

Being you can generate hundreds of objects quickly and scatter them around

fast galleon
#

I'm not sure about this but I think ripping with right click only checks that inventory, e.g corpse clothes. But the crafting UI seems to get all the containers(multiple corpses).

sour island
#

Right click context grabs all I believe

#

You can right click a shirt and see rip (50) if your next to a pile of bodies

#

If they removed that feature that's a good change

fast galleon
#

I saw difference a few days ago, again not 100% in this.

thick karma
#

omg why does anyone do animations this is insanity.

sour island
#

I wonder how hard an actual stack item system would be to work out

#

I imagine it would need a bit of overhaul

#

A simpler solution could be to force the rip action into the recipes that need them

#

i.e.: if you're bleeding you can use a rippable piece of clothing and the means to rip it

#

dirty bandages after the fact can act as normal

#

but that's to avoid people from I assume dumping hundreds of easily creatable objects

#

Which if someone is determined enough they could get around

vague hedge
#

So would one issue my mod wont upload is that the ID in workshop.txt is identical to the mod template's ID in workship.txt? How do I get a new id?

sour island
vague hedge
#

Then why do I keep getting this? The folders are structured correctly.

sour island
#

What is 2880293575?

vague hedge
#

The default modtemplate

#

Ok then don't remove the ID

sour island
#

Why are you uploading the default modtemplate?

ancient grail
#

Ouch. My solution to this is upload it with new ids . But happened only for personal more that are unlisted so no biggie

vague hedge
#

I am not, I used it as said template

ancient grail
#

But you have to edit it

sour island
vague hedge
vague hedge
sour island
#

that looks fine

vague hedge
#

And there is no "do you want a new ID?" prompt

sour island
#

yeah there is

vague hedge
#

it goes from this

#

To this

sour island
#

right before that screen

#

the ID I was speaking about was not the modID but workshopID

ancient grail
#

I never bothered to change the versions for somereason. Does it auto update?

sour island
#

I don't know if that matters tbh

ancient grail
#

Probably if u have a to jump back to previous version via steam

vague hedge
sour island
#

Are you using any mod menu related mods?

#

I see the issue

#

Check your workshop text

#

remove the ID there

#

assuming you are using the mod template workshopID

#

The game skips that step if you already have a workshopID

vague hedge
#

Found the issue I think

sour island
#

Which goes back to when I said 'remove the ID line' but I got the mod.info and workshop.txt mixed up

agile lily
#

Anyone know where you can find the scripts for the different medical items?

vague hedge
#

I deleted the workshop.txt altogether

agile lily
#

When creating a new item the only tag you can use is "medical"

sour island
#

that works too

vague hedge
#

Will see if this works

sour island
#

It should generate one

vague hedge
#

It did.

#

The issue I had was I copy pasted the template's workshop.txt and then just edited the file

sour island
#

You could just remove the ID line from it

#

it populates missing parts too

vague hedge
#

I did, but it just put it right back.

#

I left it at id= and it would put the same ID back in

sour island
#

uhh

#

you should see the new button for get new ID

#

hm, trying to test it now

#

Nah it seems to work if I remove the ID line

#

did you make sure to save and restarted your game?

lyric bolt
#

Is there a function to modify player speed?

#

Im making a drug that gives a player turbo speed for a few seconds

ancient grail
agile lily
ancient grail
ancient grail
#

It even has its own events if i remembrr correctly. Anyways goodluck

bronze yoke
#

most health stuff isn't lua

lyric bolt
#

What is the 'proper way' to get the player in lua, I see people doing it all different kinds of ways, passing a player param, just using getPlayer(). self.character?

bronze yoke
#

self.character is a property of timed actions, if you're using one you should definitely use it

#

otherwise, a lot of events and functions pass either a player object or a playernum for getSpecificPlayer()

#

and then you can consider looping through getSpecificPlayer, and then you can use getPlayer()... but honestly little of that matters when nobody plays in splitscreen anyway

lyric bolt
#

So self.character is probably the best?

bronze yoke
#

when available!

lyric bolt
#

When is it available tho?

bronze yoke
#

in a timed action

lyric bolt
#

Kk so the function needs to be a timed action?

ruby urchin
#

Is there a limit to the cars that can be in a game?

lyric bolt
#

Hmm, I cannot find how to actually affect speed, I see more traits does some stuff with adjusting equipment speed modifiers

ancient grail
#

@deft falcon hi sorry to ping you but if you could spare some time to debunk as to how you modified the speed, will be a great lesson for us

ripe warren
#

Hey, Just wanted to ask. I am starting to learn how to mod and want to make sure. Are the Fenris Wolf and RoboMat guides the best place to start or is there something newer more up to date out now?

ancient grail
#

I personally just look at the media folder most of the time tho

ripe warren
#

okay thank you. I just asked because I noticed RoboMat's guide is from 2013 and most of the images in the tutorial are 404 errors. But if its still relevant I will definitely go trough it

astral dune
#

Fenris' is relevant, don't know robomat's

ancient grail
ripe warren
#

I am trying to understand Lua and how to work with it.
I want to make a mod that gives the vanilla cars attachment options for homemade armor. Thats the end goal at least. I know its been done before but I have no idea how hard it will be haha.

ancient grail
#

Probably very advance for a first mod proj.

astral dune
#

giving them an armor item is easy, making it actually do something efficiently is hard, rendering it on the car is ????

ripe warren
#

oh yeah not a first mod. Thats just what I am aiming to be able to do

ancient grail
#

Cool goodluck!

ripe warren
#

I am guessing this is quite unoptimized though

#

but its a solution I can at least wrap my head around

astral dune
#

yes, they do that by checking the condition of every part of the vehicle every cycle, very inefficient. I haven't looked yet but I'm unclear on whether anybody actually handles damage to vehicles when nobody is in it

ripe warren
#

I am guessing theres no "on vehicle damage" event

astral dune
#

unfortunately no. Thats actually the mod I'm making, lol

ancient grail
#

Thats a good suggestion the devs tho

ripe warren
#

oh

#

well that sounds fantastic

#

so what is the mod youre making?

#

it it an event extension library?

astral dune
#

ya, we mentioned it to Aiteron the last time he was around, sounds like build 42 may get some of that

ancient grail
#

Lit

astral dune
# ripe warren so what is the mod youre making?

I'm attempting to create an event based damage framework for vehicles. Currently I have events for

  • Crashing into players
  • Crashing into zombies
  • Crashing into inanimate objects
  • Player breaking into a car through the window
  • Zombie attacking windows
  • Offroading wear and tear
    Still working on...
  • Player attacking vehicle with a weapon
  • Zombie attacking parts other than windows when they can't reach the window
ripe warren
#

oh thats really really cool

agile lily
#

What's the command to set someone's pain levels?

astral dune
#

I don't know if vehicles can take damage from something like a grenade, so I'd still have to look into that, but as far as I know that's a complete list of damage a vehicle can take

ripe warren
#

will this framework be publicly available?

astral dune
#

If I finish it before 42, lol

ripe warren
#

thats fair enough

ancient grail
ripe warren
#

anyways I gonna go try a mod or something

astral dune
#

best of luck

ruby juniper
#

The mods I like for survival: 1) Mod Manager
2) Tsar's Common Library v.1.30
3) The Forest
4) Primitive Survival
5) Craft Helper Continued
6) Yaki's Makeshift Clothing
7) Improvised Backpacks by Maxwell218
8) Fluffy Hair
9) Handmade Weapons
10) Recipes+ By Revolution
11) Zaedyn's QoL Recipes
12) Torch By Revolution
13) Zombies drop more lighters and matches
14) TrueActions_1.08
15) Zaedyn's Wilderness Recipes
16) Rugged Recipes
17) Insect Ingredients
18) ST Survival Tailor
19) Torch
20) Yaki's Makeshift Clothing
21) Bow and Arrow
22) Snake's Modpack
23) Well's Construction

tardy wren
#

Their armor system is among the best I've heard

ripe warren
#

doesnt bring up anything on the workshop

astral dune
#

ki5 is the developer, he makes a tonne of vehicle mods

ripe warren
#

oh I read that as K15

ripe warren
#

haha yeah its gonna take me a bit to understand how this works

astral dune
#

its more or less what you described earlier

fast galleon
#

he added armour?

astral dune
#

many of his vehicles have armor, ya

fast galleon
#

but not the one I have obviously...
time to change my vehicle mods list again

ripe warren
#

before I start doing any of this. Its possible to make a mod that modifies the base vehicles right? Or do I have to make a copy of a vanilla vehicle to be able to modify it?

astral dune
#

yes, you can. Vehicle scripts can be altered at runtime

ripe warren
#

well this is going to be an interesting weekend

vague hedge
#

So my mod seems to make the game freeze on startup when it syas "Loading Scripts" and I either have to close it through task manager by repeatedly clicking end task, or let it run it's course and close on it's own

astral dune
#

As a side effect of working on damage events I found and fixed a bug with the blood on vehicles lol, don't know how no one noticed it before me

vague hedge
#

Odd seeing as it's just a recipe txt

astral dune
#

rounding errors cause the bloodIntensity to get stuck at 3.9999%

#

so nobody got to see the vehicles in full bloody glory after mowing through a couple dozen zeds

ripe warren
#

oh

#

now I am curious how thats supposed to look

astral dune
#

I took screenshots but I'm not at home atm

bronze yoke
agile lily
#

Hello there friends, how do you play an animation through LUA?

mint sphinx
#

does any one know what kind of value the carbs.proteins,lipidscalories. is based on ?
yea but what metric are they using per kg or pr 100 gram or is it number / weight
like have an item weight 100gram so if i write the 100 lipid is that based on the 0.1 weight from the items or is it based on a fix amount of weight

ancient grail
mint sphinx
deft falcon
#

u could before but not anymore

ancient grail
#

Ah ok

#

@lyric bolt theres your answer

ancient grail
ancient grail
agile lily
fast galleon
#

ok, but debug has 2 ways of moving faster

agile lily
fast galleon
#

teleport forward slightly and less time for animation

ancient grail
#

I did this to the zed on the floor with back against the wall. Used it for my heroin mod

agile lily
#

Gmhahahhh

#

Exactly what I’m making now too

#

But can’t you just play one of the normal animations that are in the game?

ancient grail
ancient grail
#

Etc

agile lily
#

Ahhh alright, then I understand

#

Thank you

ruby juniper
#

Does anyone have wilderness survival based modlist they use?

ancient grail
sour island
#

mod_support is for figuring out how to install / figure out issues one could be having with mods

astral dune
#

its for "end user questions", while this channel is for "making mods I guess"

sour island
#

a mod recommendation would fit better in pz_chat

#

although it doesn't matter too much

thick karma
#

Does anyone know exactly how reportEvent turns "EventSitOnGround" into a signal to the data that actually makes you sit? I have a custom XML and a custom FBX and I am trying to figure out how to trigger my event similarly to how sitting is triggered (as it would be an alternate sit animation associated with a trait).

#

(Trying this in #modeling, too, not sure where the question is more likely to get answered.)

astral dune
#

Didn't Dislaik write a guide on animation? haven't looked at it yet but it might have something useful in it for this

thick karma
#

I may be using it for all I know but the guide ends with some odd sitch where you loop the new animation into the walking state by tying to a boolean and toggling that boolean on or off, rather than discretely triggering it.

#

Yeah I am using Dislaik's guide.

#

The animation he teaches us to include works a bit differently than my goal... trying to change the animation that happens when players click "Sit on ground", but conditionally.

ruby urchin
weak sierra
bronze yoke
#

yeah i just decided not to say anything when that was going on 😅

weak sierra
#

now we just need a mod to make them work

#

:P

#

placebo effect is serious though, i know ppl tailoring their clothes on my server, and it's good for RP shrugEyeRollGirl

bronze yoke
#

there are many other mechanics in pz that don't do what people think they do, but thinking they do makes the game more fun...

thick karma
#

I do not know if that requires instantiating animations "between" players... I would hope / assume not.

#

I just want my one player to sit down according to a specific animation and then fall into my new animation loop after that. Instead of sit causing player to sit and then remain sitting, I want player to cross legs and stay that way.

bronze yoke
#

it uses player:setVariable('SitGroundAnim', 'Idle')

ruby urchin
thick karma
#

Okay well I'll start with SP and expand from there

thick karma
bronze yoke
#

from what i can tell, yeah

thick karma
#

So that explains this pretty well @bronze yoke

    <m_Conditions>
        <m_Name>SitGroundAnim</m_Name>
        <m_Type>STRING</m_Type>
        <m_StringValue>Idle</m_StringValue>
    </m_Conditions>

But I'm not sure how the animation clears that idle string after finishing the initial sit, and how the code passes into

    <m_Transitions>
        <m_Target>sit_loop</m_Target>
        <m_AnimName>Bob_SitGround_ActionToSitIdle</m_AnimName>
        <m_speedScale>1</m_speedScale>
    </m_Transitions>
#

From:

<?xml version="1.0" encoding="utf-8"?>
<animNode>
    <m_Name>sit_action</m_Name>
    <m_AnimName>Bob_SitGround_ActionIdle</m_AnimName>
    <m_deferredBoneAxis>Y</m_deferredBoneAxis>
    <m_SyncTrackingEnabled>false</m_SyncTrackingEnabled>
    <m_SpeedScale>0.30</m_SpeedScale>
    <m_BlendTime>0.30</m_BlendTime>
    <m_Conditions>
        <m_Name>SitGroundAnim</m_Name>
        <m_Type>STRING</m_Type>
        <m_StringValue>Idle</m_StringValue>
    </m_Conditions>
    <m_Conditions>
        <m_Name>hasTimedActions</m_Name>
        <m_Type>BOOL</m_Type>
        <m_BoolValue>true</m_BoolValue>
    </m_Conditions>
    <m_Transitions>
        <m_Target>sit_loop</m_Target>
        <m_AnimName>Bob_SitGround_ActionToSitIdle</m_AnimName>
        <m_speedScale>1</m_speedScale>
    </m_Transitions>
</animNode>
#

This seems key in moving from SitGroundAnim = Idle ("Sit down, Bob") into sit_loop ("Stay sitting, Bob"), but how does the game know I finished sitting so that its time to transition?

ruby urchin
#

you will need to use TimedAction

thick karma
#

Do you know where the game does this for vanilla sitting? @ruby urchin

bronze yoke
#

you won't be able to copy the way vanilla does it, it's some java ai state stuff

thick karma
#

I see. So the way modders trigger their modded animations is pretty different from how it's triggered in vanilla generally?

ruby urchin
#

ProjectZomboid\media\lua\client\ISUI\ISWorldObjectContextMenu.lua#L4516-L4518
Apparently reportEvent is in charge of sync some anims, but they are limited

public enum EventType
{
    EventSetActivatedPrimary, 
    EventSetActivatedSecondary, 
    EventFishing, 
    EventFitness, 
    EventEmote, 
    EventClimbFence, 
    EventClimbDownRope, 
    EventClimbRope, 
    EventClimbWall, 
    EventClimbWindow, 
    EventOpenWindow, 
    EventCloseWindow, 
    EventSmashWindow, 
    EventSitOnGround, 
    wasBumped, 
    collideWithWall, 
    EventUpdateFitness, 
    EventFallClimb, 
    EventOverrideItem, 
    ChargeSpearConnect, 
    Update, 
    Unknown;
}
bronze yoke
thick karma
#

Totally fair, thanks, I have nfi

#

I am trying to guess based on names of stuff

#

If I had to guess, "sit_loop" seems to be about just staying in the sitting position somehow

bronze yoke
#

it's sit_in > sit_loop (at any time during this, sit_rubhands and sit_warmhands can be triggered by changing SitGroundAnim, and sit_action can be triggered by setting hasTimedActions) > sit_ext

thick karma
#

Ohhhhh... I see... I was just looking at sit_in... So what is sit_action vs sit_in?

#

I would've thought sit_action was the action to sit down

#

Clearly not...

#

Sit_in makes sense... going into the sit state

bronze yoke
#

sit_action is when your character stretches out their legs while reading or reloading

thick karma
#

Ohhhhhhhhhhhhh

#

Okay so basically to do my animations I just need to activate my animation conditions, and the animation just started happening? Literally just setVariable on my player and voila (in SP)?

bronze yoke
#

i believe so

thick karma
#

Interesting

ruby urchin
thick karma
ruby urchin
bronze yoke
#

yeah that's pretty much what i was thinking

thick karma
#

For some reason I was just hoping that I could reportEvent in a way that led to my animation the same way I could report sitting. I'll just make my own reportEvent so things look clean and do my variable setting in there

sour island
#

I know these words

ripe warren
#

how would one go about adding another mesh on a vehicle, Like when I put the hood on the vehicle a separate mesh appears

thick karma
#

Haha I am open to solutions from wherever they come!

#

I would also think this may be a modeling question

ripe warren
#

he was responding to me

thick karma
#

Ohhhhh

#

Timing confused me

ripe warren
#

I deleted my question and posted it in modeling

thick karma
#

ahhaaaaaa

#

thanks so much

sour island
#

Btw, no biggie asking general stuff here - as topics can blend - I just figured people in there might know more. 👍

bronze yoke
thick karma
#

Hmmm... getPlayer():setVariable('SitGroundAnim', 'Idle') actually does not trigger the sit animation @bronze yoke

bronze yoke
#

i think you need to report the event first

thick karma
#

Well reporting the event is sufficient by itself

bronze yoke
#

that's what the event uses to change which animation is currently playing

thick karma
#

Hmmm

#

Well that unfortunately does not clarify the connection I'm trying to make...

bronze yoke
#

try sitting and using getPlayer():setVariable('hasTimedActions', true), i think that will switch you to the action animation

thick karma
#

getPlayer():reportEvent("EventSitOnGround") -> ?????? -> player:setVariable("SitGroundStuff", values) -> Player is Sitting

bronze yoke
#

you just wanted to change the sitting animation based on a trait right?

thick karma
#

Nada on getPlayer():setVariable('hasTimedActions', true)

#

yyyyup

#

But I don't even really know how to trigger my animation yet

#

tbh

bronze yoke
#

did you look at the example dislaik sent? that seemed exactly like what you're looking for

#

ah, it has to be 'true'

#

getPlayer():setVariable('hasTimedActions', 'true')

#

basically just copy how sit_action works but set its variable based on whether you have the trait

thick karma
#

No dice on getPlayer():setVariable('hasTimedActions', 'true') either

bronze yoke
#

please try the mod dislaik sent earlier - i'm pretty sure it's exactly what you're looking for

#

ah... you're just not allowed to do that

#

i think if it were your own variable it would work fine

thick karma
#

I see.

agile lily
#

Where can I find which variables I can use to modify stuff through code?

bronze yoke
thick karma
agile lily
#

Very good, thank you!

thick karma
#

@ruby urchin In your example you just sent me, I notice you changed the idle folder to sitonground and in sit.xml I see that instead of naming the AnimName "AnimationGuide" you named it "Bob_SitGround"... How did you make that decision? Where is "Bob_SitGround" used in your files?

bronze yoke
thick karma
#

No biggie, I can't even get the basic step of seeing my animation in game yet

#

I'll worry about flow once I can at least trigger the gd thing

bronze yoke
#

the standing up animation is getup/fromSitOnGround

thick karma
#

That's the hurdle for now

void fractal
#

anyone got some good tips? i'm just getting into project zomboid modding, know how to use lua, but no clue how modding project zomboid works

#

got like atleast a year and a half experience with lua

void fractal
#

yeah i've taken a look at project zomboid's directory but my question mostly is like

thick karma
void fractal
#

can i just tap into project zomboid's functions or do i need to require them in some way

bronze yoke
#

you can just use them

void fractal
#

oh damn

#

thats pretty neat

thick karma
#

(meant to reply to him woops)

bronze yoke
#

with a year and a half of lua experience i assume they know about scope!

void fractal
#

yeah

#

i guess i'll try to do a lil bit of digging to see if i can make my own timed action

#

thanks for the links

bronze yoke
#

that's a good place to start

void fractal
#

yeah i thought it would

#

seems relatively easy to do

thick karma
#

LOL @bronze yoke

#

That is NOT how it looked in Blender...

void fractal
#

oh god

thick karma
#

Lmao horrifying...

void fractal
#

is he okay

thick karma
#

I think I killed him

bronze yoke
#

LOL

thick karma
#

Blender:

#

Lmao why?

#

becuase it's also sitting?

void fractal
#

tbh i wish project zomboid had a "dev quickstart" much like rimworld does

bronze yoke
#

of course it's the meditation mod again

void fractal
#

creates a basic world instantly without having to choose anything

thick karma
#

Haha I want to add animation before I publish it 😈

bronze yoke
#

you haven't even published it yet?? wow

thick karma
#

Nah it's the one I'm holding back

#

I've published 6 other lmao

#

Been working on that one 2nd longest

#

But I can't resist urge to learn animation for it

void fractal
#

what program yall modding on anyways?

thick karma
#

I use VS Code.

void fractal
#

ah same

thick karma
#

IntelliJ for decompiling the Java

void fractal
#

well do you have any handy plugins for vscode?

#

i mostly use vscode for c# so no clue if there's any good lua plugins

thick karma
#

Not for this game but if you ever do web design you absolutely must install Live Server

#

Live Server is a priceless time saver for many little things lol

void fractal
#

ooh i do web design sometimes

thick karma
#

Right click file -> run local website in your browser.

#

That's what Live Server lets you do

void fractal
#

wait thats neat

ruby urchin
bronze yoke
#

the guid plugin can be useful for zomboid, but not exactly a huge deal

ruby urchin
thick karma
#

@ruby urchin Your posted config:

#

What I'm about to do:

#

Am I missing anything?

ruby urchin
#

Yeah, the primary and secondary bone orientation

thick karma
#

ohhhhhh lmmfao

#

That WOULD explain the insanity we just witnessed

#

Tysm

#

You're awesome

void fractal
#

are you able to remotely play a timed action using the debug console?

#

kinda just wanna test if i set this up correctly but have no code to trigger it

ripe warren
#

or am I way over my head on this one?

bronze yoke
bronze yoke
void fractal
#

ah sick thanks

bronze yoke
#

i.e. if you want it to be the hood, make sure the hood part has

model Hood
{
    file = HoodModelName
}
thick karma
#

I've done a thing!

bronze yoke
#

let's gooo

thick karma
#

Thanks sooo much for the help @bronze yoke @ruby urchin

#

The animation works too!

bronze yoke
#

i'm glad you got it figured out, i was starting to do some insane stuff

thick karma
#

lol that was the best kind of bug

dull moss
#

anyone knows a way to check any of the following:

  • number chunks explored by player
  • any kind of measurement how much of map is revealed by player (since it's revealed in squares, there should be some way of counting how many of those squares is present on players map)
  • anything similar
    What I'm trying to do is figure out a way of finding any kind of indication how much of map player has explored.
    So far best thing I came up with is checking character coordinates every 1/10 in-game minutes and calculating distance to last position and then storing that value and that would kinda represent how far character traveled but you can jsut walk in same town forever and it would keep increasing which is not the best way
thick karma
#

@dull moss If you're fine with a solution that only starts counting once the mod is installed, have you tried

MM = MM or {}
-- Stored in a file, you have to write loadSquareCounter
MM.mySquareCounter = MM.loadSquareCounter() 

local function LoadGridsquare(square)
  MM.mySquareCounter = MM.mySquareCounter + 1
end

Events.LoadGridsquare.Add(LoadGridsquare)

?

bronze yoke
#

yeah i forgot to respond but i went through a bunch of java and concluded that that was probably the only way to do this

dull moss
#

Will check

thick karma
#

idk haven't tried it

dull moss
#

In a bit though, cooking 😄

bronze yoke
#

none of the map discovery stuff is exposed

thick karma
#

I am busy running slow tests trying to get my animation perfect 😦

astral dune
#

Its actually surprisingly difficult to hit a vehicle with a gun. You pretty much have to stand directly beside it

bronze yoke
#

i've had difficulties hitting them with melee weapons

astral dune
#

Well, I should be able to very efficiently detect weapon damage then, thats pretty heartening

#

now to test molotov cocktails. If I can figure out how to throw one

#

ya, that's what I thought, they don't damage cars either

#

All I have left is to figure out how to detect when a zombie attacks something that isn't a window, and I think I have all bases covered for vehicle damage, aside from something a mod might add

#

btw this is the difference in maximum blood from hitting zombies in vanilla (left) and with the rounding issue solved (right)

thick karma
#

Legendary

#

Nice job @astral dune

astral dune
#

Almost there, lol. Then I can make the mod this whole mess was intended to support

thick karma
#

Are we allowed to use goto in Zomboid? Getting a mysterious error lookin for an equals sign in a place it doesn't seem to need one...

#

Anyone?

Yogi.ticksSpentWaiting = {}

Yogi.awaitBlessing = function(ticks)

    local nobodyWaiting = true

    for playerIndex = 0, getNumActivePlayers() - 1 do
        
        local player = getSpecificPlayer(playerIndex)
 
        -- ERRORS ON LINE BELOW
        if not player then goto next end

        if not Yogi.ticksSpentWaiting[playerIndex] then goto next end

        nobodyWaiting = false
. . . 
bronze yoke
#

i don't think kahlua has goto

thick karma
#

Oof

#

Rip

quasi geode
#

it doesnt. wasnt added til 5.2 (kahlua is based off 5.1)

thick karma
#

Ugly conditions it is

#

Ty for confirming

quasi geode
#

you trying to use goto for a continue like statement? (ie skipping to the next for)

thick karma
#

Correct

#

Got a good idea?

#

Or just observing?

quasi geode
#

this

#

as long as you dont need break

#

basically converts break into a continue

thick karma
#

Fascinating actually

#

Thanks for the pro tip

#

Tempting

#

I literally just finished rewriting with a skip variable when I saw your response

#

Deciding whether it's worth replacing it with this other style

#

Yeaaaaaah you sold me

#

Ultimately saves me like 4 or 5 boolean checks

#
  • NumActivePlayers potentially
#

Tyvm @quasi geode

thick karma
#

Ugh so close yet so far. Just cannot get my animation to trigger when I want it to be happening. Blargh.

#

It just doesn't show the animation on the way to the ground for some reason. If I manually trigger the animation state while I'm on the ground, it loops with proper timing, but on the way down the character just rapidly collapses into the loop state...

thick karma
#

Okay the solution is not nearly as event driven as I want it to be but it is very near working locally...

#

I am doing a thing!

thick karma
#

Sigh now the problem... the way I forced it to work is not framerate friendly... reaaaally need to figure out how to run the animation once and smoothly transit into the loop on sit...

#

I.e., this is no good:

<animNode>
    <m_Name>Meditate</m_Name> 
    <m_AnimName>Meditate</m_AnimName>
    <m_EarlyTransitionOut>true</m_EarlyTransitionOut>
    <m_SyncTrackingEnabled>false</m_SyncTrackingEnabled>
    <m_SpeedScale>1.50</m_SpeedScale> 
    <m_BlendTime>0.20</m_BlendTime> 
    <m_Looped>false</m_Looped>
    <m_Conditions> 
        <m_Name>Meditate</m_Name>
        <m_Type>BOOL</m_Type>
        <m_BoolValue>true</m_BoolValue>
    </m_Conditions>
</animNode>

Because it doesn't automatically replace the sitting part of the sit down on ground animation set.

#

I really need to figure out how to sub my animation for just that sitting part conditionally...

#

@ruby urchin If you have any enlightening input here when you have time, would appreciate... probably gonna give up on it for the night soon. (Gotten a lot closer though so still happy with the proximity to being finally done. Thanks for that.)

ruby urchin
#

You can try to add the rest of the conditions

#

each animation is executed at a certain moment due to certain conditions that are met (should be the same way for sit_in, sit_loop, sit_out, etc...)

ruby urchin
#

SNIPPET: run a lua file

local file = getModFileReader("Id_Mod_Here", "Test.lua", false);
local script = loadstream(file, "Test.lua");
script();
astral dune
#

lol oh man, that is so ripe for exploit I don't even know what to say

bronze yoke
#

is it? you'd already need to be able to execute lua code to do it

quasi geode
#

shouldnt that be loadstring not loadstream?

astral dune
#

anyone who would want to run their own code would just have to use your mod and copy in a file after the checksum test

#

granted zomboid isn't really secure in any way, but this just add insult to injury, lol

ancient grail
#

how does healing someone else work on lua side

quasi geode
bronze yoke
#

maybe that's related to that exploit i couldn't reproduce

ruby urchin
#

its from kahlua, loadstream -> return callFrame.push(loadis((Reader) input, name, null, callFrame.getEnvironment()));

#

getModFileReader return a Reader Class

quasi geode
#

its only problematic if your mod does it clientside. its perfectly valid to store lua code in files server side and only read it there, which allows you to:

  1. edit without having to redistribute updates
  2. keep server side code secret from snooping players
ruby urchin
#

Probably loadstring is more insecure, you simply need to find the memory address of the string variable

quasi geode
#

dont define the variable or call the function unless its the server & clients wont have a memory address to find

ruby urchin
#

I would like this to work like that, but always there will be a bro doing difficult things

fast galleon
quasi geode
#

ya use another folder and w/e file extension you want, such as getFileReader for files stored in the Zomboid/Lua cache directory, that way its not in the mod folder, and not distributed to clients at all

astral dune
#

being able to have secret serverside code is intriguing ngl

ancient grail
#

do i
put local on both var declare or just one of em


          if result:get(i):getType() == " BottleMeth" then
                            local safeChance = 70
                            else
                            local safeChance = 90
                            end
#

if i declare it like this

#
                    local safeChance = 90              
                        for i=0, result:size()-1 do
                            if result:get(i):getType() == " BottleMeth" then
                            safeChance = 70       
                            end
                        end    
#

or is this better

fast galleon
bronze yoke
#

if you make it local in the if then you won't be able to get the variable later, you should do it like in the second example

ancient grail
#

then how do i properly declare local

ancient grail
#

its above

bronze yoke
#

then if you put local in the if it's going to be a new variable with the same name and you still won't be able to access the value when that scope ends

ancient grail
#

ok so ill just put local everytime?

outer vigil
#

anyone know which mod allows you to sit in chairs, among other things?

#

I thought this was #pz_b42_chat, my b... but hey, it is modding at least.

ancient grail
outer vigil
#

Thank you.

ancient grail
#
    recipe Make Biscuits
    {
       destroy MuffinTray,
       keep Spatula/[Recipe.GetItemTypes.Spoon]/[Recipe.GetItemTypes.Fork],
       keep Bowl,
       Water=1,
       Flour=1,
       Salt;1,
       BakingSoda=1,
       [Recipe.GetItemTypes.BakingFat];1,

       Result: Muffintray_Biscuit,
       NeedToBeLearn:true,
       Category:Cooking,
       Time:50,
    }
#

anyone knows why the salt uses ;

#

biut water doesnt

#

they are both drainables

#

ow wait salt isnt drainable

#

ahh its probably cus it means evolverecipe

#

nvm i answered my own question lol

#

damn got alot of questions i really dont know how to test

#
item Sodium_Thiosulfate
    {
        DisplayCategory = Meth,
        Weight    =    0.2,
        Type    =    Drainable,
        UseDelta    =    0.1,
        UseWhileEquipped    =    FALSE,
        DisplayName    =    Sodium Thiosulfate,
        Icon    =    Sodium_Thiosulfate,        
        StaticModel = Sodium_Thiosulfate_Hand,
        WorldStaticModel = Sodium_Thiosulfate_Ground,    
        CantBeFrozen = TRUE,
        EvolvedRecipe = Pizza:1;Soup:1;Stew:1;Pie:1;Stir fry Griddle Pan:1;Stir fry:1;Burger:1;Salad:1;Roasted Vegetables:1;RicePot:1;RicePan:1;PastaPot:1;PastaPan:1;Sandwich:1;Sandwich Baguette:1;Taco:1;Burrito:1;Beverage:1;Beverage2:1;Beer:1;Beer2:1,
        Spice = true,
        HungerChange = -5,
        ThirstChange = 10,
        UnhappyChange = 1,
        WorldStaticModel = Salt,
        FoodType = NoExplicit,
        Tags = MinorIngredient;Salt,
        Poison = true,
        PoisonDetectionLevel = 1,
        PoisonPower = 5,
        UseForPoison = 5,
    }
#

will this work as an alternative to salt?

jaunty marten
ancient grail
jaunty marten
#

no I meant u can't use this variable outside if statemtn

#
local b = true


if b then
  local a = true
else
  local a = false
end
print(a) -> nil

local a
if b then
  a = true
else
  a = false
end
print(a) -> true
ancient grail
#

ahh gotcha

drifting ore
#

Hey hello everyone. I'm working on a big project at the moment but I'm stuck: Do you know if there is a way to disable trait selection in the game? thanks!

ancient grail
#

i thought stuff like this was only within functions

tribal sparrow
#

could someone help me with creating a simple lua code that will allow me to have access to the admin/debug vehicle spawning feature in singleplayer wtihout having to turn on debug?

ancient grail
#

sp doesnt have chat box right?

#

its not possible

#

try to download necroforge it might have something you need

#

not sure

tribal sparrow
#

i have managed to get the UI to show up, but error counter wouldnt stop counting and i cant spawn vehicle nor close the UI window again

ancient grail
#

it would be easier if you use local hosted server instead of sp

#

only cons would be is that you dont have the fastforward and the pause

#

other than that you have everything multiplayer has

thick karma
thick karma
#

@ruby urchin @bronze yoke Omg I finally got it. I had accidentally tried to assign a string variable to a boolean animation condition, so my add-on to the vanilla sit-in and sit-loop wasn't working. Thanks so much again for all the help guys!

ancient grail
#
    @LuaMethod(name = "sendBandage", global = true)
    public static void sendBandage(final int n, final int n2, final boolean b, final float n3, final boolean b2, final String s) {
        GameClient.instance.sendBandage(n, n2, b, n3, b2, s);
    }
    
    @LuaMethod(name = "sendCataplasm", global = true)
    public static void sendCataplasm(final int n, final int n2, final float n3, final float n4, final float n5) {
        GameClient.instance.sendCataplasm(n, n2, n3, n4, n5);
    }
    
    @LuaMethod(name = "sendStitch", global = true)
    public static void sendStitch(final IsoGameCharacter isoGameCharacter, final IsoGameCharacter isoGameCharacter2, final BodyPart bodyPart, final InventoryItem inventoryItem, final boolean b) {
        GameClient.instance.sendStitch(isoGameCharacter, isoGameCharacter2, bodyPart, inventoryItem, b);
    }
    
    @LuaMethod(name = "sendDisinfect", global = true)
    public static void sendDisinfect(final IsoGameCharacter isoGameCharacter, final IsoGameCharacter isoGameCharacter2, final BodyPart bodyPart, final InventoryItem inventoryItem) {
        GameClient.instance.sendDisinfect(isoGameCharacter, isoGameCharacter2, bodyPart, inventoryItem);
    }
#

how do i do something like this if its not even part of the lua code

#

i want to use sendBandage()

thick karma
#

@ancient grail sendBandage is in GlobalObject:

sendBandage​(int int1,
            int int2,
            boolean boolean1,
            float float1,
            boolean boolean2,
            java.lang.String string)
frank elbow
#

^ so you should be able to just call it directly

thick karma
#

Not sure what the values are for

#

I believe that's just because decompiled but idk

#

I assume they didn't name their variables int1 and boolean1 everywhere.

frank elbow
#

Checking out GameClient should give a better idea of their purpose, idk either

ancient grail
#

not exactly the same

#

i want to applyNacrcan()

#

which is some nasal spray that you apply to people that are high on heroin

#

so you wake them up

#

so im looking to do something similar but not the esxact thing

#

any ideas?

#

yeah sorry i wasnt clear

#

cuz the thing is i can just copy and paste the whole bandage code and just modify it but then im going to be stuck on that particular global. unless i have the ability to code the function itself

#

how will that be possible tho

thick karma
#

I'm not really familiar with activating functions of items in inventory that affect the player state... I would look for a mod that does that using original items. Maybe Green Fire?

#

@ancient grail

#

Sorry I can't offer details there.

ancient grail
#

Ive done the state

#

The part where someone elses intrupt that state is the hard part
Maybe albion knows

#

Cuz she did made an arrest mod

thick karma
#

If you already know how to change the player's state, can't you just change it again the same way?

ancient grail
#

I just need other players to wake up other players that are heroin drugged

ancient grail
#

Using narcan item

#

Its other player affecting other player

#

Thats the thing i need

#

Maybe if i can capture a diffrent player like right click context menu it be alot easier

#

Sorry for the typos using mobile

drifting ore
midnight bobcat
#

I wanted to check in and see if people had similar experiences with the Expanded Helicopter Events mod; seems not to be working with the latest patch. Can anyone confirm this?

ancient grail
#

question if i nil a moddata thats non exsitent will it cause error

#

modData['plNarcan'] = nil

#

or do i need to check

#

if not modData['plNarcan'] == nil then modData['plNarcan'] = nil end

#

ill just do the checks lol

bronze yoke
#

no

ancient grail
#

ayt

#

so its better to not do the checks ? to save ram?

bronze yoke
#

the checks won't do anything

ancient grail
#

why

#
    local modData = getPlayer():getModData();   
            --nill the mod datas
            if not modData['heroinDuration'] == nil then modData['heroinDuration'] = nil end
            if not modData['plDisabled'] == nil then modData['plDisabled'] = nil end
            if not modData['heroinDuration'] == nil then modData['heroinDuration'] = nil end
            if not modData['plNarcan'] == nil then modData['plNarcan'] = nil end
bronze yoke
#

if you couldn't assign values to table keys that didn't exist already you'd never be able to make a table

sour island
#

You can also house those within another table

#
modData.glytch3rsMod = {}
modData.glytch3rsMod.heroinDuration = 1
#

You don't need the [""] if there aren't spaces I believe

#

if anything the checks should be ```lua
if modData['heroinDuration'] then modData['heroinDuration'] = nil end

ancient grail
#

ok cool thnx chuck

#

amm is it possible to add OnTest to an item with OnEat

#

i can make a lua for on eat too right?

#


----- OnEat_WildFoodGeneric IS NOT RECIPE CODE.  IT IS CALLED BY IsoGameCharacter.Eat() -----
-- if item is poisoned, apply the rest of its negative effects here
function OnEat_WildFoodGeneric(food, character, percent)
    local script = food:getScriptItem();
    local bodyDamage = character:getBodyDamage();
    local stats = character:getStats();
    if food:getPoisonPower() > 0 then
        bodyDamage:setFoodSicknessLevel(bodyDamage:getFoodSicknessLevel() + (50 * percent));
        if bodyDamage:getFoodSicknessLevel() > 100 then
            bodyDamage:setFoodSicknessLevel(100);
        end;
    end;
end
#

tho it says its not a recipe code

#

then i cant make on test if i use oneat omg

#

cuz i have smokeable heroin and its doing the inject function using oneat

#

while the other thats injectables are oncreate

fast galleon
#

So I want to highlight a whole chunk, I tried adding IsoSprite and renderGhostColour but it did nothingwhich is weird. Same thing works when I have setDrag in other places.

So I will test next the addGridsquareMarker, any tips?

quasi geode
fast galleon
#

I'd really like to highlight the whole square and not some weird circle, without adding new textures.

sour island
#

some of the debug tools highlight squares

fast galleon
#

thanks, that reminded me something I will go investigate

quasi geode
#
local square = getCell():getGridSquare(x, y, z)
if square and square:getFloor() then
    square:getFloor():setHighlightColor(r, g, b, a)
end

what i used to use (probably still valid)

fast galleon
#

nice I can set colour like that?

quasi geode
#

yep

ancient grail
#

Oow sorry i forgot to post

#

Figured out how to capture nearby players

Just need to know if i can put moddata on them

#
function applyNarcan() 
local player = getPlayer()
local cell = player:getCell()
local x, y, z = player:getX(), player:getY(), player:getZ()
local xx, yy, zz
    for xx = -4, 4 do
    for yy = -4, 4 do
    local square = cell:getGridSquare(x + xx, y + yy, z)
        for c = 0, square:getMovingObjects():size() - 1 do
        local chr = square:getMovingObjects():get(c)
            if instanceof(chr, "IsoGameCharacter") and player ~= chr and chr:hasModData() then 
                if chr:getModData()['plDisabled'] == true then
                --print(chr:getUsername())
                chr:getModData()['plNarcan'] = true;  
                end
            end
        end
    end
    end
end 
#

if this works then i have done what i need

#

without going thruu the istimedbase thing

wet gorge
#

How to get full partID? Currently using: part:getId(), doesn't include Base. or whatever mod it is apart of.

#

Tried part:getScriptName() but return nil.

#
local part = vehicle:getPartByIndex(i)
local partId = part:getId()
#

maybe getScriptPart()

bronze yoke
#

i've noticed that modules don't really work very well in vehicle scripts, so it might just not be possible

wet gorge
#

getInventoryItem() is what I want I think

#

When there is a will there is a way.

#

partItem:getModID() or partItem:getModName() - gonna test

karmic wind
#

Hey all - software dev here very new to modding for zomboid and looking for some help. I've found this template which allows to write mods in TS and then compile to lua, which looks pretty neat. I'm a bit confused with how the reactivity for getPlayer() works. I'm trying to run a simple function which makes the user say something when a zombie is targeting them -> player.isZombieAttacking(), this should return a boolean. Trying to run it within the onPlayerUpdate event, but it always returns false. Any ideas?

ancient grail
#

If you function has (player)
Then you just use player

#

Thats what i know atleast

#

I just go with getPlayer() most of the time cuz its easier to just copy and paste on debug console

karmic wind
#

does getPlayer() always get updated regardless of the event you're running?

#

I've noticed the onPlayerUpdate event has a player parameter, which I expected would be reactive but seems to always be false anyway

karmic wind
#

player.isZombieAttacking() is a boolean I mean

#

not IsoPlayer

fast galleon
#

checking java...
one line
return false

#

It's old or not developed function

ruby urchin
#

yeah, you need use isZombieAttacking() on zeds

ancient grail
#

IsServer() and not isClient()

#

Iguess

fast galleon
#

wrong reply again?

ancient grail
#

😭

#

Ow cuz its on player update lol

fast galleon
#

omg mixing highlight and WorldMarker looks nice

#

it's so nice I want to make to add sound and make them blink for Zombie Party

ancient grail
fast galleon
ancient grail
#

Gotcha

fast galleon
#

so far I only change position
I'd tell you but I quit the game.

astral dune
#

the damage zombies do to your hood and trunk when trying to eat you is clientside only and not real 😩 how am I supposed to detect this

bronze yoke
#

i don't think the difference is going to matter very often but that's what i was thinking about

bronze yoke
#

how did you do that?

wet gorge
#

part:getInventoryItem():getFullType()

bronze yoke
#

that's the item, not the part

#

parts are more like slots

#

as i said, the difference will rarely if ever matter, but there is one

wet gorge
#

Outputted to this, what I wanted.

#

So I'd say mission accomplished.

astral dune
#

Is it possible to detect when a particular sound has been played, or to add an event to a sound script?

astral dune
#

The answer to the first question appears to be "No, but you can detect when a WorldSound has been played, as well as where, how loud and at what radius"

#

"and what object did it"

thick karma
#

So I was thinking about importing vanilla animation into Blender and I find that instead of FBX they are all just "X" files (literally I found the X files)... Can these somehow be imported into Blender to mod them and make custom versions of these vanilla animations?

drifting ore
#

Hi guys, im new to modding and I started trying to do simple recipes about crafting beef jerky. Thats the recipe, i've tried to make it work but the recipe inst working. Can someone check it for me and tell what is wrong with my mod?

hallow plover
#

can i commission someone to make me a car in game?

ruby urchin
drifting ore
#

Ty

#

its working now

astral dune
vague hedge
#

Hey, anyone here have some suggestions for the cost of a Military BPV in Hydrocraft money?

#

I set it at 30$ because zombies will rip it and such, but IDK if that's too little.

astral dune
#

I remember a debate recently about whether Cell always describes the same 300/300 square area or if it can move around. In my research I've found that IsoWorld.CurrentCell is what is used for selecting valid targets, so if it really is just the cell you're in and not something centered on the player, then you can't target anything across cell lines with a weapon. Just something I noticed

#

I don't see anything in the code to imply it moves, either

bronze yoke
#

i've always been concerned by that possibility but never really bothered to test it

#

if it works...

astral dune
#

if there is an easy way to find a cell border in game, it could be tested without too much trouble

harsh hawk
#

Hello! I was wondering how difficult it'd be to make a mod that when you put out food while it's cold, it'll either freeze or become, well, cold depending on the temp outside

astral dune
#

I'm dismayed to hear that isn't the vanilla experience. I don't have any experience working with items though

harsh hawk
#

I've not checked that that's not vanilla but given the info in #pz_b42_chat it seems likely

#

Nevertheless such a feature makes sense lmao, we put out our food into the cold all the time

astral dune
#

I have been known to put beers in the occasional snowdrift, ya

#

well in my test world its -4C and the apple I just threw on the ground has no temperature effects, so I guess its not vanilla

harsh hawk
#

Dang

#

Well at least we know now 😂

astral dune
#

looks like food's freezing state is given by the container it is in, and "floor" is explicitly not capable of freezing anything

harsh hawk
#

o

#

huh that sounds interesting

astral dune
#

there is an OnContainerUpdate that fires when a piece of food updates, but only if the food has gone from Fresh > Not Fresh or Not Fresh > Rotten, so that doesn't look useful either

#

I'm not going to look any further, but it doesn't look promising.

harsh hawk
#

so in short, you'd need to make yer own check for it huh?

astral dune
#

I suppose you could try to detect any time someone drops a piece of food on the ground, and have something running in the background keeping it updated, but that could get laggy

bronze yoke
#

you can loop through dropped items near the player every now and then and change their temperature

#

and simulate all the time spent away when you come near an item

#

if necessary

astral dune
#

which reminds me, is there a "detect objects within radius" function? or is it always "get all objects in cell then filter them by distance"

bronze yoke
#

not that i know of

#

that's probably how such a function would work anyway, so it's not a massive loss

astral dune
#

if its a small radius (like melee) I suppose I could get all the nearby squares and check what objects are in them

bronze yoke
#

that's how i would do it

sour island
#

@hearty dew Sorry to ping you, but do you think it would be possible to hijack print() to include the origin file/mod?

thick karma
#

Using ISImage, can you change the opacity of the .png you draw on screen?

#

Or is there a better way to draw an image with variable opacity?

sour island
#
local print_original = print
function _G.print(...)
    
    print_original("\[TEST\]",...)
end
#

Just need to figure out the much more difficult thing about grabbing the mod or file that's relevant 🤔

astral dune
#

next to impossible, I imagine

ancient grail
sour island
#

The snippet works to add test on it

ancient grail
#

Is this cuz of the smash no smash? Lol

sour island
#

hm? no

ancient grail
#

Haha ok

sour island
#

Someone put a print message in clientcommands

#

it's spamming the shit out of people

ruby urchin
#

Has anyone worked with pcall? apparently don't work

ancient grail
#

Lool if its a unique string it can easily be traced

sour island
#

it says 'client command' + the module and command

#

so pretty generic

hearty dew
hearty dew
hearty dew
ruby urchin
sour island
#

I don't have the mods the end-user does

#

Don't really want to download 50+ mods either lol

#

This should probably be a vanilla feature

crimson sequoia
sour island
#

Similar to how stack traces list filenames

crimson sequoia
#

I will pay $$ to have a patch that fixes this mod

hearty dew
crimson sequoia
#

Idk who to go to but this mod is broken but it's so awesome, I will pay for someone to please make a patch for it so it can work again.

sour island
#

You mean forcibly throw an error?

#

Hmm

crimson sequoia
#

The author of the mod is basically displaced by Ukraine War

#

it's been six months, no word from him

#

Do you guys know anyone who will take paid commission for patch?

hearty dew
ruby urchin
sour island
#

Looking over stuff now

hearty dew
hearty dew
ruby urchin
#

probably this version of lua works differently

sour island
#

There's this under kahluautil

   public static String rawTostring2(Object var0) {
      if (var0 instanceof String) {
         return "\"" + (String)var0 + "\"";
      } else if (var0 instanceof Texture) {
         return "Texture: \"" + ((Texture)var0).getName() + "\"";
      } else if (var0 instanceof Double) {
         return numberToString((Double)var0);
      } else if (var0 instanceof LuaClosure) {
         LuaClosure var6 = (LuaClosure)var0;
         return var6.toString2(0);
      } else if (var0 instanceof LuaCallFrame) {
         LuaCallFrame var5 = (LuaCallFrame)var0;
         return var5.toString2();
      } else if (var0 instanceof LuaJavaInvoker) {
         if (var0.toString().equals("breakpoint")) {
            return null;
         } else {
            LuaJavaInvoker var1 = (LuaJavaInvoker)var0;
            MethodDebugInformation var2 = var1.getMethodDebugData();
            String var3 = "";

            for(int var4 = 0; var4 < var2.getParameters().size(); ++var4) {
               if (var2.getParameters().get(var4) != null) {
                  var3 = var3 + var2.getParameters().get(var4);
               }
            }

            String var10000 = var2.getReturnType();
            return "Java: " + var10000 + " " + var0.toString() + "(" + var3 + ")";
         }
      } else {
         return var0 != null ? var0.toString() : null;
      }
   }
#

Not sure if I can grab the 'object' in question

#

specifically the 'LuaClosure' of the print being passed

hearty dew
#

@sour island Look at how LuaThreatWindow.lua gets the filename using the globalobject functions

#
    local coroutine = getCurrentCoroutine();
    local count = getCallframeTop(coroutine);
    for i= count - 1, 0, -1 do
        local o = getCoroutineCallframeStack(coroutine,i);
        if o ~= nil then
            local s = KahluaUtil.rawTostring2(o);
            if s ~= nil then
                self.callframeStack:addItem(s, {call = o, line = getLineNumber(o)});
            end
        end
    end

Can trim that down to get only the top callframe

sour island
hearty dew
#

believe so

#

Didn't test it

sour island
#

My concern would be it just returns the file containing my edit lol

#

testing now

hearty dew
#

If so, get the frame right below that

sour island
#

LOG : General , 1668912620592> [function: SuperSurvivorsOnTick -- file: SuperSurvivorsMod.lua line # 73 | MOD: Superb Survivors] weaponhitcharacter

#

😮

hearty dew
#

😮

astral dune
#

😲

ruby urchin
#

😮

sour island
#

I could just use string manipulation at this point -but I wonder if I can grab the MOD: piece alone

bronze yoke
#

😮

astral dune
#

I will never say anything is impossible again

sour island
#

with enough elbow grease anything is possible

astral dune
#

tough act to follow, but I did make some progress today myself. I've officially found ways to detect all the different types of damage a vehicle can take, and am now working on differentiating things. Like for example the difference between hitting a vehicle and a tree. Or who is to blame in a vehicle/vehicle collision

hearty dew
#

Or who is to blame in a vehicle/vehicle collision
Maybe can sell your algorithm to state farm insurance 😂

astral dune
#

maybe once I've worked out the kinks, lmao

sour island
#

Nice

#

Having a suite of more functions would be great

#

Going to wrap up the print debugger thing tomorrow

#

Need to formulate a poster concept

astral dune
#

haha, the important part

sour island
#

I forgot multiple arguments in print indent

#

also parsed vanilla prints by checking for the " | MOD: " string

#

thank you @hearty dew

#

I'll stream the poster creation in discord

astral dune
#

is os.time() in seconds?

#

whole seconds?

ruby urchin
ruby urchin
astral dune
#

what's my best bet if I want ms?

ruby urchin
#

mb, no secs, milisecs

#

I was use this local time = math.floor(os.time() * 1000) but I think TIS already added that (or probably always was there)

astral dune
#

ya, I was kust using os.difftime(os.time(), timestamp), but its giving me seconds. Wasn't sure if it was the difftime or the os.time() function that was giving me seconds

bronze yoke
#

does getTimestampMs() not work for you?

astral dune
#

that doesn't show up in my autocomplete, is that also in os?

#

oh I see, its in _G, what is the difference between it and getTimeInMillis?

bronze yoke
#

getTimeInMillis exists on the GameTime too, maybe it counts simulation time

astral dune
#

the coordinate system of a vehicle's extents doesn't match the coordinates of the game world, lmao

#

z is vertical in the world and y in the vehicle's extents. Silly

astral dune
#

extents x = width, y= height, z = length

coarse nacelle
#

is there a proper way to add a mod requirement via the steam workshop upload menu? Or do I need to edit the item in steam outside of PZ?

ruby urchin
coarse nacelle
#

ok, that's what I figured just wanted to make sure there wasn't a "proper" way

hearty dew
#

mod requirement you specify in mod.info. Workshop item requirement you have to do it via the steam ui afaik

astral dune
#

which one causes the auto-load of the requirement in ModOptions?

hearty dew
#

Might help to imagine workshop items as steam concepts that are sets of pz mods

bronze yoke
#

the workshop is barely any more than an automatic download/updater

astral dune
#

man, I've tried getName(), getScriptName() getObjectName() and getSpriteName() on every IsoObject I've come across and they all come back with nil or "none" or "IsoObject", what gives

hearty dew
#

What gives is pz's software design uses inheritance where it probably doesn't make a great deal of sense, heh

astral dune
#

ya, like my favourite thing to point out, the fact that a potato or a sock or a notebook all have suspension compression

#

still, I'm trying to get a user-readable list of objects and its being difficult. trying getTextureName now

fast galleon
#

from IsoObject getItem, then getName or getFullType or whatever

#

just know devices like radios might not work, only sprite from them

hearty dew
astral dune
#

The results of IsoGridSquare:getObjects()

#

trying to determine what a vehicle hits when a collision happens, so I scan the area at the point of collision. If its not a vehicle I want to look for walls, fences, that sort of thing

hearty dew
#

Oh, for world objects, I've seen a mod use the sprite name like poltergeist suggested

#

and yea, some don't have sprites, like radios. That mod actually has a bug where it causes an exception when you click on radios

astral dune
#

IsoObject doesn't have a getItem() method

hearty dew
#

believe this vague code I'm recalling used getSprint() then getName() on the sprite?

astral dune
#

would be funny if getSprite():getName() worked but getSpriteName() didn't, but its possible

hearty dew
#
function Basement.IsObjectHatch(obj)
    local spriteName = obj:getSprite():getName() or obj:getSpriteName();
    for _, size in pairs(Basement.Sizes) do
        if spriteName == Basement.HatchSprite[size].E or spriteName == Basement.HatchSprite[size].N then
            return true;
        end
    end
end
#

radios (and maybe some other objects) return nil when getSprite() is call though

#

so don't write it like above :)

astral dune
#

interesting

hearty dew
#

Another option is to check the type and use a method/field appropriate to that type

fast galleon
bronze yoke
#

what kind of name are you trying to get when you say 'readable'?

fast galleon
#

getSprite can return nil, so you either check is it exists and call getName or use getTextureName directly without getSprite

bronze yoke
#

i think quite a lot of objects don't have a name good enough to be shown to players, but i don't know if that's what you're going for

hearty dew
astral dune
#

it just needs to be readable by me while I roam around ramming into things, so I can make sure my hit detection is actually picking up relevant tiles

#

so far all I'm getting is the road under the car, so I'm not sure

hearty dew
#
ProjectZomboid/media/lua/client/Camping/CCampfireSystem.lua:    return instanceof(isoObject, "IsoObject") and isoObject:getName() == "Campfire"

getName() works on campfires I presume :p

hearty dew
#

or a combination of all these things

astral dune
bronze yoke
hearty dew
astral dune
#

we're getting there

bronze yoke
#

oops i replied the wrong message 😅

hearty dew
#

Ah

hearty dew
#

that's how I print out userdata (java) objects

#

which prints out something like zombie.blah.IsoRadio if memory serves

astral dune
#

ya, its usually just IsoObject in this scenario, but that's ok, the sprite thing worked

#

I quite quite yet figure out if something is collidable, but I can tell if something can be damaged by the vehicle, so its a start

#

oh here we go getProperties().Is(IsoFlagType.collideN) on a square

hearty dew
# astral dune

This makes me wonder if there is a sprite property that determines if an object is collidable

astral dune
#

There is IsoFlagType.collideN and IsoFlagType.collideW, which is called on the whole square. I'm about to try it

astral dune
#

well I'm able now to detect collideable squares, and damageable tiles, but surprisingly not trees

LOG  : General     , 1668926407641> 40,865,616> searching for collision objects
LOG  : General     , 1668926407642> 40,865,616> Collideable square at x-4 y-2
LOG  : General     , 1668926407642> 40,865,617> Collideable square at x-3 y-2
LOG  : General     , 1668926407642> 40,865,617> Potential Collision: fencing_01_24 x-3 y-2
LOG  : General     , 1668926407643> 40,865,617> Collideable square at x-2 y-2
LOG  : General     , 1668926407643> 40,865,618> Potential Collision: fencing_01_25 x-2 y-2
LOG  : General     , 1668926407643> 40,865,618> Collideable square at x-1 y-4
LOG  : General     , 1668926407644> 40,865,618> Potential Collision: fencing_01_27 x-1 y-4
LOG  : General     , 1668926407644> 40,865,618> Collideable square at x-1 y-3
LOG  : General     , 1668926407644> 40,865,619> Potential Collision: fencing_01_26 x-1 y-3
LOG  : General     , 1668926407645> 40,865,619> Potential Collision: fencing_01_29 x-1 y-2
LOG  : General     , 1668926407646> 40,865,621> End of collision search
short ferry
#

So this is gonna sound stupid, but i have never made a mod for anything before and i have been intrested in adding a bunch of new songs into PZ (the true music mod with the mixtapes), i was wondering if this is an extremely hard task or not, and what skills i need, like programming etc

bronze yoke
#

not really anything more than slightly technical computer use, they have a tool to make music packs for that

short ferry
#

Aight

astral dune
#

@hearty dew have you tried using the getClassFunction function? I've been able to grab a private method, but can't seem to call it, was hoping you knew the syntax

hearty dew
#

Can only invoke it in -debug mode

#

You need to use the invoke method on the java.lang.reflect.Method object to call it

astral dune
#

hmm, will invoke takes an object and an array of inputs. Doesn't seem to work for me, but maybe a lua "array" is insufficient

#

in the end I want this for non-debug code, so if invoke is provisionally exposed I'll just to have to do something else

hearty dew
#

I thought you could pass in individual the parameters (including the self object as the first if the method is an instance method)

#

Might be an overload for invoke to do that

#

But, yes, it is only exposed in -debug

ancient grail
#

this what you looking for or no?

#
canPassThrough = true;

    javaObject:setModData(copyTable(ISItem.modData));
    javaObject:setIsThumpable(ISItem.isThumpable);
    javaObject:setCanPassThrough(false)
    javaObject:setCanBarricade(true)
    javaObject:setThumpDmg(8)
    javaObject:setIsContainer(false)
    javaObject:setIsDoor(false)
    javaObject:setIsDoorFrame(false)
    javaObject:setCrossSpeed(1.0)
    javaObject:setBlockAllTheSquare(false)
    javaObject:setName("WoodenWallFrame")
    javaObject:setIsDismantable(false)
    javaObject:setCanBePlastered(false)
    javaObject:setIsHoppable(false)
    javaObject:setIsThumpable(true)
    javaObject:setModData(copyTable(modData))
    javaObject:setMaxHealth(50)
    javaObject:setHealth(50)
    javaObject:setBreakSound("BreakObject")
    javaObject:setSpecialTooltip(false)
#

Probably not

fast galleon
#

@ancient grail

...
getWorldMarkers():removeGridSquareMarker(marker)
ancient grail
#

but if i spawn alot

#

like alot

#

i cant delete it anymore

#

also is it possible to make it show to everyone

ancient grail
# fast galleon <@591976049592631298> ```marker = getWorldMarkers():addGridSquareMarker(...) .....
        local x, y, z = getPlayer():getX(), getPlayer():getY(), 0
        local xx, yy, zz
        local stand = getPlayer():getCurrentSquare():getRoomID()
        local mainSq = getPlayer():getSquare()
                for xx = -12, 12 do
                for yy = -12, 12 do
                local square = getPlayer():getCell():getGridSquare(x + xx, y + yy, 0)
                        if square:getRoomID() == stand then 
                            table.insert(PoisonTiles, square);
                            if  isDebugEnabled() then
                            mark = getWorldMarkers():addGridSquareMarker("circle_center", "circle_only_highlight", square , 1,0,0, true, 0.5)
                            TestMarkers.add(mark);
                            end 
                                if not square:getModData()['isMethlab']==true then
                                square:getModData()['isMethlab']=true;  
                                end
                        end
                end 
                end
#

heres the code i used to spawn it

#

it will be a great feature to be able to remove it after the tile isnt poison anymore but its not important for me to do that

#

ill try this if i can find time ... thnx. im sure itll work.

ancient grail
#

im curious what will happen if you name your char nil....

#

ow nvm just remembered usernames are strings

ancient grail
#

how do i print all moddata of an object

#

its a table so why cant i get the contents of it

#

nvm figured it out

#
for k, v in pairs(getPlayer():getModData()) do
  print("k: ", k, "   v: ", v)
end
jaunty marten
# ancient grail ```lua for k, v in pairs(getPlayer():getModData()) do print("k: ", k, " v: "...
local format, concat, rep, ipairs, pairs, tostring = string.format, table.concat, string.rep, ipairs, pairs, tostring
local istable = {["table"] = true}
local isstring = getmetatable("")

function table.ToPlain(tbl, lvl)
	lvl = lvl or 1
	local out = {}

	local indent = rep("\t", lvl)

	local len = 0
	for _ in pairs(tbl) do
		len = len + 1
	end

	if len == 0 then
		return "{}"
	end

	local isSeq = len == #tbl

	for k, v in (isSeq and ipairs or pairs)(tbl) do
		if isSeq then
			k = ""
		elseif isstring ~= getmetatable(k) then
			k = "[".. tostring(k) .."] = "
		elseif k:find(" ", 1, true) then
			k = "[\"".. k .."\"] = "
		else
			k = k .." = "
		end

		if istable[type(v)] then
			out[#out + 1] = k .. table.ToPlain(v, lvl + 1)
		else
			out[#out + 1] = k .. (
				isstring == getmetatable(v) and format("%q", v) or tostring(v)
			)
		end
	end

	if len == 1 then
		return "{".. out[1] .."}"
	end

	return "{\n".. indent .. concat(out, ",\n" .. indent) .."\n".. rep("\t", lvl - 1) .."}"
end

function table.Print(tbl)
	print(table.ToPlain(tbl))
end

PrintTable = table.Print
#

PrintTable(table)

ancient grail
#

ow shit this a new util u wrote?

#

thnx man 🙂

#

your timer mod is always part of my mods

#

lol

#

The mod im trying to do now is the narcan
A nasal spray that wakes up players from heroin effect

The heroin effect makes the player unable to move
So i just need the item to re enable em to move

My approach is using moddata
Like once a specific moddata is detected on tick then player wakes up

#

I think my code is just too messy atm which is why it wouldn't work lol

thick karma
sour island
#

I feel like everyone makes one of those eventually lol

thick karma
thick karma
#

Mine just boringly shows the one table I am looking at

#

Also depends on my knowing it's a table

sour island
#

I've made at least two

#

I forget what the second was for half but it parsed every other entry

#

There was a community project that fell through

#

It was supposed to be a community API

#

Kind of wish there was a GitHub repo to add changes to game Lua files

#

Strictly for moddability + more utility

true vault
#

That would be sooo useful TBH

#

...maybe some more up-to-date docs too on where to find different functions, what shizz does, etc.. more updated item list... lolz

...I had to manuallt use debug mode to get base names for a third of the jewelery for example, because things like bellybutton rings aren't in the existing wiki >.>

I don't mind doing the work, but it would be nice if there was a simple way to share that info I gather with others that might eventually use it. I have zero clue how to update the wiki personally, soo... ;-;

sour island
#

Would let you ctrl+shift+f through files

#

That'd be more for java exposure stuff

#

For script files you can just add the base game's media folder as a project

#

Should work out of the box to look stuff up

#

I have the media folder as a library

true vault
#

I.. kinda do that already (I only make script and recipe edits still), and although searching is way easier now, I would still love a listing of the various functions and what they do/where they are lolz l.. Or maybe more of an abstract on how the game accomplishes various things.

frigid fiber
#

is there any good hearing aid mods that work in mp

sour island
#

I need a good name for my utility mod that adds the mod's name for print()

#

I'm thinking 'fingerPrint'

rain rune
#

Lovely mod community of PZ

I propose an idea...

Someone make a mod that replaces the Zombies with bugs from Starship Troopers

Thank you friends 🙂

ripe warren
#

I can make the models. Beyond that I am kinda hopeless haah

#

than again replacing the meshes probably isnt very hard

thick karma
#

Is there any way to manipulate the transparency of an entire .png you draw into the game somehow? (As ISImage, as an element of an ISPanel, anything?)

rain rune
thick karma
#

lol (almost*) never what they're worth

rain rune
ripe warren
#

is PZ ever planning on giving proper documentation for mod makers? I am going trough any docs I can find but most of the mare either outdated or unfinished.
I am really new to modding in general and this is making it exceptionally hard to get anything working

glossy mist
#

B41.78 blew up all the mods

thick karma
#

I mean it's a fundamental issue of trying to pay for something like this. A mod < a game, so most people think "mod cheaper than game", but making a mod takes a lot of time for an individual, so the transaction is sort of inherently unbalanced.

glossy mist
#

And it also ruins a few gun mod

sour island
#

What about .78 blew up guns mods? The texture changes?

glossy mist
sour island
#

What broke in the gun mod?

ripe warren
#

also could I ask. Items have a WorldStaticModel. which pulls the model from models or modelx_X right?

#

how do I define the texture for the model?

sour island
#

it pulls from the model script

ripe warren
#

oooh

#

thank you

sour island
#

scripts/models_items.txt

ripe warren
#

yes yes

#

does the file have to be named models_items or can I name it something else?

rain rune
#

But for anyone who thinks they'd like to take it on, I am decently serious about the starship troopers bug mod idea

Open to discussing what it'd take

sour island
#

you can name it whatever you want - as long as it's the media/scripts/ folder within your mod

#

and follows the same formatting obviously

#

same applies to any script.txt

#

You can also use Lua to handle scripts

#

but it's a bit more work that way - and only suitable if you're trying to do something specific

ripe warren
#

Well at the moment I am just trying to create an item.
Than I want to make the item attachable to a vehicle
and than I want to give it functionality

sour island
#

uh

#

vehicle stuff is a bit out of my wheelhouse - as the scripts for cars are alot more nuanced

ripe warren
#

yeah Ive noticed

sour island
#

but there's a few car attachment mods you can pick apart

ripe warren
#

I treid that but many they are so confusing I could never wrap my head around it

sour island
#

I imagine there's going to be scripts for the item, with models on the floor - then there's model for being on the car

ripe warren
#

yeah thats kinda what I am hoping for

sour island
#

afaik PZ doesn't support orientation changes along x/y for it's model scripts - only rotations

#

I could be wrong

ripe warren
#

the things that will actually be difficult is adding a new attachment slot for a vehicle and giving it the functionality

sour island
#

I repurposed the on floor models to act as in-hand for a mod that makes alot of random junk weapons - and I couldn't get it to be offset to look better

ripe warren
#

hopefully I can figure that out

sour island
#

That stuff should be available in those mods for car armor and bags on top

ripe warren
#

yeah it is. I just dont understand it hhaha

#

but hey. custom item done, custom on ground mesh is done

#

so at least I am getting some kind of knowledge

sour island
#

👍

chrome bone
#

Hello everyone! Is there any official modding guides?

astral dune
ripe warren
#

okay so I am trying to understand how vehicle parts work. I know the vehicle file uses templates for all its parts like template Tire.
But I dont understand how those files define the item that that car part is associated with
For example tire has : "itemType = Base.OldTire;Base.NormalTire;Base.ModernTire," where are these items stored in? I cant find it anywhere

#

oh nvm

#

I am stupid

#

they are in the vehiclesitems.txt