#mod_development

1 messages ยท Page 113 of 1

red tiger
#

You can only do so much.

true vault
#

Alright, welp, let's see how terrible this ends up lolz

bronze yoke
#

probably not very - though i've been cautioned about it so much i haven't really experienced it myself, and i have mods relying on it

red tiger
#

Im fucking crazy because I've been lost in the sauce for too long. I don't expect you to be efficient on your first try.

#

Premature optimization is the leading cause of orphan projects.

#

For real.

#

Enjoy yourself and never forget to have fun when modding.

true vault
#

Honestly, at this point I'm not even trying for optimization, just figuring out how to make this work in the first place lolz

#

Dynamic generation is, after all, supposedly a very hard thing in this game I've been told.. >.>

drifting ore
#

Hey guys

drifting ore
#

Kay, so I got a png I want to add to a pack file

#

How do I add a png to a pack file?

drifting ore
#

there is another way to do this as im sure you might be familiar after being in the mapping discord also. just would depend on your goal really

weak sierra
#

anyone who knows how attached weapon definitions and hair outfit definitions work around?

#

tryin to figure out why a specific outfit spawns but won't spawn with the items it's supposed to anymore

#

in a mod i did not make

#
AttachedWeaponDefinitions.ScreecherKatana= {
    chance = 100,
    outfit = {"Screecher"},
    weaponLocation = {"Stomach"},
    bloodLocations = nil,
    addHoles = false,
    daySurvived = 0,
    weapons = {
        "Base.BlackKatana",
    },
}

AttachedWeaponDefinitions.ScreecherMark= {
    chance = 100,
    outfit = {"Screecher","ScreecherNoKatana"},
    weaponLocation = {"JawStab"},
    bloodLocations = nil,
    addHoles = false,
    daySurvived = 0,
    weapons = {
        "Base.ScreecherMark",
    },
}

AttachedWeaponDefinitions.attachedWeaponCustomOutfit.Screecher = {
    chance = 100;
    maxitem = 2;
    weapons = {
        AttachedWeaponDefinitions.ScreecherKatana,
        AttachedWeaponDefinitions.ScreecherMark,
    },
}

AttachedWeaponDefinitions.attachedWeaponCustomOutfit.ScreecherNoKatana = {
    chance = 100;
    maxitem = 1;
    weapons = {
        AttachedWeaponDefinitions.ScreecherMark,
    },
}```
#
cat = {}
cat.outfit = "Screecher";
cat.beard = "None:100";
table.insert(HairOutfitDefinitions.haircutOutfitDefinition, cat);

cat = {}
cat.outfit = "ScreecherNoKatana";
cat.beard = "None:100";
table.insert(HairOutfitDefinitions.haircutOutfitDefinition, cat);```
#

they are spawning with the correct clothing, but no ScreecherMark or ScreecherKatana

#
table.insert(ZombiesZoneDefinition.Default,{name = "Screecher", chance=0.01});
table.insert(ZombiesZoneDefinition.Default,{name = "ScreecherNoKatana", chance=0.03});
#

so they spawn, so the last bit works

#

as far as i can tell the HairOutfitDefinitions thing just prevents beards on them

#

therefore something's wrong with the AttachedWeaponDefinitions somehow?

#

anyone see anything?

#

compared authenticz's stuff to this, i see no issues..

drifting ore
#

i dont see anything either

#

i checkewd for like 15+ mins lol

ancient grail
#

How will u do this if it was you albion

silk owl
#

With a vampire mod out (amongst other things), are there any plans to create a superhero themed one? Something to add a little more variety, that is! I'm thinking flight, laser eyes, and other neat stuff.

humble oriole
#

yea, I give up, you can't remove items from zombies on death and I can't get this to work.

function removeLoot()
    for x,y in pairs(Distributions[1]["all"]) do
        if x:contains("Outfit_") or x:contains("inventoryfemale") or x:contains("inventorymale") then
            RemoveItemFromDistribution(Distributions[1]["all"][x], "Bullets380Box",            nil, true)
            RemoveItemFromDistribution(Distributions[1]["all"][x], "Bullets38Box",            nil, true)
            RemoveItemFromDistribution(Distributions[1]["all"][x], "Bullets9mmBox",            nil, true)
            RemoveItemFromDistribution(Distributions[1]["all"][x], "Bullets45Box",            nil, true)
            RemoveItemFromDistribution(Distributions[1]["all"][x], "Bullets44Box",            nil, true)
            RemoveItemFromDistribution(Distributions[1]["all"][x], "ShotgunShellsBox",            nil, true)
            RemoveItemFromDistribution(Distributions[1]["all"][x], "223Box",            nil, true)
            RemoveItemFromDistribution(Distributions[1]["all"][x], "556Box",            nil, true)
            RemoveItemFromDistribution(Distributions[1]["all"][x], "308Box",            nil, true)
        end
    end
end

Events.OnPostDistributionMerge.Add(removeLoot)```
drifting ore
#

this person was able to do it apparently using this code.
#mod_development message
i'm don't remember why you are targeting any outfit when you dont want it to spawn on anything right?

humble oriole
#

just zeds, there's stuff in all that aren't zombies

drifting ore
#

but it's still way more simplified than what you're doing here. also does those two zombie types cover all zombies? i didn't think it would

humble oriole
#

all the Outfit_, inventorymale/female are all under all

#
LOG  : General     , 1676269390989> 0> Distro all:      PaperTray
LOG  : General     , 1676269390989> 0> Distro all:      EmergencyAxe
LOG  : General     , 1676269390989> 0> Distro all:      RSLocker
LOG  : General     , 1676269390989> 0> Distro all:      WZLocker
LOG  : General     , 1676269390990> 0> Distro all:      ESLocker
LOG  : General     , 1676269390990> 0> Distro all:      PVLocker
LOG  : General     , 1676269390990> 0> Distro all:      FloorSafeSpike
LOG  : General     , 1676269390990> 0> Distro all:      bin
LOG  : General     , 1676269390990> 0> Distro all:      campfire
LOG  : General     , 1676269390990> 0> Distro all:      cashregister
LOG  : General     , 1676269390990> 0> Distro all:      clothingdryer
LOG  : General     , 1676269390990> 0> Distro all:      clothingdryerbasic
LOG  : General     , 1676269390990> 0> Distro all:      clothingrack
LOG  : General     , 1676269390990> 0> Distro all:      clothingwasher
LOG  : General     , 1676269390991> 0> Distro all:      counter
LOG  : General     , 1676269390991> 0> Distro all:      crate
LOG  : General     , 1676269390991> 0> Distro all:      desk
LOG  : General     , 1676269390991> 0> Distro all:      dishescabinet
LOG  : General     , 1676269390991> 0> Distro all:      displaycasebakery
LOG  : General     , 1676269390991> 0> Distro all:      dresser
LOG  : General     , 1676269390991> 0> Distro all:      filingcabinet
LOG  : General     , 1676269390991> 0> Distro all:      freezer
LOG  : General     , 1676269390991> 0> Distro all:      fridge
LOG  : General     , 1676269390991> 0> Distro all:      grocerstand
LOG  : General     , 1676269390992> 0> Distro all:      inventoryfemale
LOG  : General     , 1676269390992> 0> Distro all:      inventorymale
LOG  : General     , 1676269390993> 0> Distro all:      locker
LOG  : General     , 1676269390993> 0> Distro all:      logs
LOG  : General     , 1676269390993> 0> Distro all:      medicine
LOG  : General     , 1676269390993> 0> Distro all:      metal_shelves
LOG  : General     , 1676269390993> 0> Distro all:      microwave
LOG  : General     , 1676269390993> 0> Distro all:      militarycrate
LOG  : General     , 1676269390993> 0> Distro all:      militarylocker
LOG  : General     , 1676269390993> 0> Distro all:      officedrawers
LOG  : General     , 1676269390993> 0> Distro all:      other
LOG  : General     , 1676269390993> 0> Distro all:      plankstash
LOG  : General     , 1676269390994> 0> Distro all:      postbox
LOG  : General     , 1676269390994> 0> Distro all:      restaurantdisplay
LOG  : General     , 1676269390994> 0> Distro all:      shelves
LOG  : General     , 1676269390994> 0> Distro all:      shelvesmag
LOG  : General     , 1676269390994> 0> Distro all:      sidetable
LOG  : General     , 1676269390994> 0> Distro all:      stove
LOG  : General     , 1676269390994> 0> Distro all:      toolcabinet
LOG  : General     , 1676269390994> 0> Distro all:      vendingpop
LOG  : General     , 1676269390994> 0> Distro all:      vendingsnack
LOG  : General     , 1676269390994> 0> Distro all:      wardrobe

#

those are also in all

drifting ore
#

welp. also looks like you can't set the PickUpLevel of a sprite above 5 that i can see

humble oriole
#

not even in the tile def?

drifting ore
#

yes only there

#

i am trying to control via sandbox ๐Ÿ˜ฆ

#

getSprite(light):getProperties():Set("PickUpLevel","6")

#

soon as i go above 5 it goes potato

#

reverts to 3 always

humble oriole
#

o.O

drifting ore
#

i noticed in the vanilla tile properties file in Tilezed it's default is 5

#

i had to manually edit the file itself to change what value it allows

#

it works when i set it up to 10 in the tile properties file itself but not here

#

i have another method for this anyways i may go with. just thought this would be fun to do this way

bronze yoke
#

i wonder if you could use UnSet("PickUpLevel") first then?

drifting ore
#

o you're so fancy

#

im gonna try it

bronze yoke
#

i haven't looked exactly what that method does but if the original value matters maybe this will give it a blank slate of sorts

drifting ore
#

it doesn't cause an issue but it still wont let me set above 5

#

it goes back to 3 haha

#

nice thought though D: god i hate that it's always the last step of each function that i get caught up on

#

soo weird how i can do it with editing the .tiles itself though

weak sierra
#

delete ur map_sand.bin file before updating sandbox settings, also sandbox settings are rather borky

bronze yoke
#

the problem isn't the sandbox setting itself is resetting, it's just the application of it is being refused for mysterious reasons

drifting ore
#

yea

#

i can use every minute event and change it all daty

#

1-5

#

second i use5+ it goes to 3

#

Me and 9 other Project Zomboid YouTubers are looking for moders on our server. We need just a few simple mods
If you are interested - DM me. And I also will send you the full list of YouTubers participating, if you want.

#

gonna try to figure out the other method i think where i use a context menu that makes you "disconnect wires". so if you hit perklevel and use context menu it should let you access the option, which essentially is just me just changing the level to below the sandbox option

#

then ill just hardcode it to 10 from .tiles

bronze yoke
#

i had a quick look at the code involved and this stuff is WEIRD

drifting ore
#

my brain can't think beyond that atm lol

#

LOL

#

at least this way is being gated by the context menu always needing to be used before removing any lightswitch

#

doesn't seem the worst. unless i'm not thinking about something haha

#

really bugs me though that 5 limit lol

#

there is also no possible way to force player to use more than 1 tool to pickup or place lol

#

unless im also a dummy there. but i tried hardcoded and lua and neither

#

said not implemented lol

#

i mean there probably is outside of the box way but not with that direct setting that i can find

bronze yoke
#

it keeps every possible value for every property in a lookup table

#

it's a bit too complicated for me to understand exactly why but that's why it refuses it, those values aren't in the lookup table

drifting ore
#

can you direct me to it?

#

is it on the java side?

#

is it something i can rewrite? LOL

bronze yoke
#

it's all java

drifting ore
#

๐Ÿ˜ฆ

bronze yoke
#

i assume it's done this way for a reason so rewriting it might have a lot of consequences

glass basalt
#

where can I advertise my mod on this server? I see people usually post links in this channel, but what about others?

drifting ore
#

i have

#

i posted in pz chat lol

#

i dont endorse spamming but it's hard AF to get your mod out there with all the poo people decide needs to be posted publicly. spotlight is good but shortlived

glass basalt
#

I don't intend to spam, just want to send it out once to any potential onlookers and that's it

drifting ore
#

ah you are good. i just said it more as a disclaimer ๐Ÿ˜„

#

i love seeing posted mods anyways

glass basalt
#

gotcha. Time to upload this thing. I got ISUnequipAction working btw, the bug was incredibly stupid.

drifting ore
#

lol what was it? a missing parameter?

glass basalt
#

I was calling the player to unequip an item after it had been removed from the inventory, and the action didn't know what to look for

drifting ore
#

ohhhh

#

this is why i'm not great at coding. my brain doesn think that far through always ๐Ÿ˜„

glass basalt
#

the solution was putting "equip", "UnequipAction", then my timed action. I was very disappointed

drifting ore
#

gratz on any solution though

#

can always come back later if you want. mods done for now ๐Ÿ˜„

glass basalt
#

whatever gets the job done, right? the main thing now is having someone else solve the greater issue I have with it lolol

drifting ore
#

i was gonna messs with it later in tiles

#

try assigning an item to the sprite and set Isotype on the item. no idea tbh

#

it's all very magic-like when it works

#

if i had a better idea how it worked then np. lightswitches were already interesting to figure out

glass basalt
#

i looked at adding a sprite just for the new items, but "texturepacks" and pack files all looked very intricate and difficult to maintain, so I'm going for 3d models

drifting ore
#

it's def not more complicated than 3d model LOL

#

but i like that

glass basalt
#

perhaps a pipeline could be made with an "invisible" model that combines the InventoryItem and IsoObject but I'm not gonna waste more time on that for now

drifting ore
#

literally png file with precoded properties lol

glass basalt
#

I did not feel like reverse-engineering the xml files lol

drifting ore
#

i'll check it out and ping you if i get anywhere

glass basalt
#

sure thing

glass basalt
ancient grail
#

Me and Pao doing a colab on the reanimation mod
Basically turns the player into controllable zed once they die
Ive written a pseudo tech paper base concept of it
The animation ad the server client codes are already written
But still have alot of functions to cover

Anyone willing to colab with us?

#

The mod is posted on github but currently as private

#

This is a passion project

#

Its huge mod

Most of the listed items can be scratched as it might require lots of work for minimal impact
But i just wrote everything in mind so yeah the whole scope should be less than that

glass basalt
#

seems like you'd have to implement a bunch of properties from IsoZombie into IsoPlayer, if it's even possible
Or making a Lua class that is assigned globally to everyone to function like a Java class

drifting ore
#

could also do something like based off of udderly knocked out where when you die you have the ability to respawn and choose a specific psuedo profession or whatever that you can assign that to.

#

just an alternate thought

#

then you essentially respawn there as a new entity. not even sure if it would matter or not but it may save some headaches, especially if the char despawns and drops everything on death

#

back to lightswitches ๐Ÿ˜„

fast galleon
#

@drifting ore - Add new values property values and set them on sprite

--before OnLoadedTileDefinitions, in this example you can generate a new array with all levels and put it to PropertyValueMap without any checks
local vals = IsoWorld.PropertyValueMap:get("PickUpLevel") or ArrayList.new()
for i = 1, 10 do
  local val = tostring(i)
  if not vals:contains(val) then vals:add(val) end
end
IsoWorld.PropertyValueMap:put("PickUpLevel",vals)

--OnLoadedTileDefinitions *and later, tested with this event
--#Properties Set(string property, string value, boolean isIsoFlagType)
Events.OnLoadedTileDefinitions.Add(function(manager)
    manager:getSprite("..."):getProperties():Set("PickUpLevel",tostring(sandbox),false)
end)

#selfpins change tile properties

drifting ore
#

lol this is a thing? hell yes

#

if this works this is huge haha

#

every time i think i'm done i realize something else.... like when you hit level 5 electrical you can add battery connectors to them. ended up having to make something for that also

#

i'm addicted to the icons

weary dock
#

yo guys and ladies(if any present) , how to take timestamp when lua function called? ive got my hands on PZcalendar but syntax kinda weird and im not sure i get it

#

i need to write time when effect was applied so i can check how many of same effect is active at the time

#

and how to make item behave like Poultice

weary dock
#

ty

jaunty marten
#

u r welcome spiffo

fast galleon
#

hm, probably best to check if the array already contains the value before adding it.

drifting stump
#

os.time isnt a good choice for tracking buffs/debuffs

#

imagine you log out then come back 2h later

#

os.time gets irl time not ingame so it wouldve advanced the state when it shouldnt have

drifting ore
#

i'm about to crash but i will be spending a good amount of time looking into this. thank you @fast galleon

weary dock
#

i guess it must work the way i need

ancient grail
#

done for commish proj of the day

nova socket
#

I wonder if there is any way to control that behavior from server?
[13-02-23 13:33:41.353] LOG : General , 1676288021353> 82ย 403ย 098> Disconnected player in CurrentCell.getObjectList() removed.

shy hearth
#

skellington :)

#

very cool

thick karma
#

@heady crystal FYI, I just reported a pretty significant bug on your page and told you exactly what needs to be done to fix it. Sorry to ping, but I suspected you may want to address it quickly, since it's a very easy problem to fix but a game-breaking error for gamepad users.

#

Out of curiosity, regarding common lingo around here, is there a technical difference between a Steam collection and a "modpack"? Does this community use modpack for an individual workshop item that contains a ton of mods, or does this community use modpack and collection interchangeably?

#

I know a lot of people don't like being included in "modpacks" from seeing people say this often, but I am wondering if the feeling about collections is the same.

#

I'm guessing inclusion in a collection would be okay with most modders?

#

(Since users do ultimately add to their subscription count?)

jovial harness
#

Personally I'm ok with modpacks as long as they're private

thick karma
#

That's fair. I think people want to get some traffic to their page that reflects the effort they invested, which is understandable.

#

I am interested in making a collection for my favorite set of mods, but I want to respect the wishes of the modders who make the collection possible.

nova socket
#

How does one properly spawn a vehicle from server? I see client sending /addvehicle string commands to server but not a single example for server execution.

hot patrol
thick karma
#

Thanks. I think I understand but I want to explicitly make sure I'm not misunderstanding.

#

Hopefully this is how most modders feel. If no one responds with an intense hatred of being included in collections, I'll probably go for it.

jovial harness
#

People have asked me for modpacks, but never collections even though there's a lot of them out there. I can't picture someone getting upset with steam collections either

hot patrol
#

Collections still link to the workshop page and even include the modders name in the tags. It basically just adds that mod to a list as it says. So there is really no reason for them to be upset. But then again I don't see much harm in unlisted mod packs but I have been told other feel otherwise

#

When in doubt ask I suppose

jovial harness
#

If you have to ask you should create a discussion for it on the workshop page. That way people know the stance of the author and don't need to ask in the comments ; because apparently people dislike that.

ancient grail
silk owl
#

With a vampire mod out (amongst other things), are there any plans to create a superhero themed one? Something to add a little more variety, that is! I'm thinking flight, laser eyes, and other neat stuff.

ancient grail
#

Mod packs steals subs

#

Unlisted or not

jovial harness
thick karma
#

@ancient grail @jovial harness @hot patrol Thanks for the feedback.

ancient grail
#

But basically i just use sendcommand that does the admin chat power

#

If you wantnto use the other code that need server client pingpong

thick karma
#

Lol @jovial harness accidentally removed your reaction checking who reacted

#

My fingers are unfit for this role

#

I am undeserving of blue

#

I apologize for my existence

nova socket
nova socket
#

I seen there is a BaseVehicle class but it does require a descriptor to be built for it from what I got.

#

Just was wondering if there is a proper server-side function pre-existing to create vehicles without clients.

ancient grail
#

@nova socket
just modify the code

  • addvehicle : Spawn a vehicle. Use: /addvehicle "script" "user or x,y,z", ex /addvehicle "Base.VanAmbulance" "rj"

function spawnv()
    local scripts = getScriptManager():getAllVehicleScripts()        
    local allV = scripts:size()+1    
    local randV = ZombRand(1, allV)
    local randM = scripts:get(randV):getModule():getName()
    local randN = scripts:get(randV):getName()
    local spawnV = randM..'.'..randN
    local command = "/addvehicle ".. spawnV .. ' '.. getPlayer():getUsername() 
    SendCommandToServer(command)
end
#

this is a random vehicle spawner code

nova socket
#

oh god.. getScriptManager():getAllVehicleScripts()

#

Gotta look into that now.

#

ty

red tiger
#

Hmmmmmmm

#

Good morning.

#

I'm probably going to need to regroup and start on pseudo-class implementation for my transpiler. =/

ancient grail
#

@mellow frigate i have sent you a dm

#

๐Ÿ™

ancient grail
#

Replace the username with xyz

nova socket
ancient grail
#

Idk what you meab

nova socket
#

I mean there should be a way to construct vehicle from class or have some related function to do it.

#

Unless there is none.

drifting stump
red tiger
#

I'm trying to map class-logic from PZ to proper JS / TS.

#

It's a way bigger headache.

drifting stump
#

werent you also writing the portion from ts to lua?

red tiger
nova socket
#

@ancient grail But thanks ill use command way for now.

drifting stump
#

ah youre still using that

red tiger
#

I'm working on a projact called LTTS.

#

(Other way)

#

Lua is not as straight-forward about pseudo-class solutions as ES5 JavaScript prototypes.

#

I could implement ES6 however this would possibly erase function-overrides.

drifting stump
#

im about halfway documenting the base ui

#

dealing with those 8713467127881 overloaded functions is pain

red tiger
#

This is a critical point in the development of the transpiler.

red tiger
drifting stump
#

especially figuring out the quirks of each

shy hearth
#

never used it myself

red tiger
#

Hey.. you might actually learn enough about the UI codebase on the Lua side to rival me. xD

drifting stump
#

yeah the overloads might not be used but there are still a crap ton of render functions

red tiger
#

I know both Java and Lua UI engine.

drifting stump
#

i mean i already know the lua side really well

red tiger
#

Make sure that you make it out alive.

#

Yeah.. I do need to release the shaders API for UI...

drifting stump
#

its the drawTexture and drawTextureUniformScaledColorWithFlowersUpsideDown that gets me while documenting

red tiger
#

I straight-up call self.javaObject haha.

drifting stump
#

im doing r g b a in every function

red tiger
#

argb is a common order for DirectX devs.

#

Makes me think that uhh some of the older devs worked with DirectX.

drifting stump
#

cool theory however TIS

red tiger
#

Hence "old devs"

nova socket
#

So far from what I discovered sending command to server from.. server is the way to do it.

drifting stump
#

example of the docs ive done

red tiger
#

Having it stored in the JSON format I made would allow me to inject docs at some point in the Lua code lol.

#

It's literally for your situation.

#

๐Ÿ’ข

#

I wish I had time to finish it up.

drifting stump
#

well but that wouldnt have integration with the lua addon in vscode

#

or emmylua in intellij

red tiger
#

I'd like to extract your docs at some point so hold on tight to them.

drifting stump
#

well it does follow a standard so would be simple to extract and convert

red tiger
#

More like I'd use luaparse.

#

I can scrape your docs as long as I have the files.

drifting stump
#

eventually will be in the community framework

red tiger
#

What I want to do is inject the JavaDocs for PZ to var names and docs in decompiled Java code.

drifting stump
#

this one hurts

#

difference?

red tiger
#

Basically, it's to get around Lua function signatures not behaving like Java's method signatures.

#

It makes sense. The solution is meh.

#

You can mix params.

#

It'd confuse modders if not documented.

#

This is why you see PipeWrench's typings have interesting mixed types for params.

#
      /**
       * @noSelf
       *
       * Method Parameters: 
       *  - (String arg0, String arg1, KahluaTable arg2): void
       *  - (IsoPlayer arg0, String arg1, String arg2, KahluaTable arg3): void
       */
      static sendClientCommand(arg0: string | zombie.characters.IsoPlayer, arg1: string, arg2: se.krka.kahlua.vm.KahluaTable | string, arg3?: se.krka.kahlua.vm.KahluaTable): void;
#

(Example)

#

Same param thing, but with types showing what's happening from how Lua interprets a CallExpression.

brazen fossil
#

Finaly posted my volvo

wintry dune
#

does anyone know what this error means? im having a real hard time with it and it's affecting both the visibility of my clothing item as well as its tootip (which doesnt show up at all + does not register bite protection)

#

its difficult to resolve since i do not know where to look. for example i went to line 215 in the clothing.class file and nothing seems really out of place

#

not sure what my mod is breaking or why. although it maybe could be a compatibility issue? i'd like to still resolve the issue somehow since some mods are integral to my gameplay

faint jewel
#

what line sets up part 14 in your clothng?

wintry dune
#

in my files?

faint jewel
#

yes

wintry dune
#

squints i dont think i have a line that sets up clothing in my folder. which file should i be looking at? the item's .xml or .txt?

fast galleon
#

did you... fix capitalisation?

naive fox
#

Hi guys, quick question. If one is interested in getting into modding, where could they find the existing library/code to read & learn the structure & internal conventions etc?

Also, is the modding done purely done in Java, Lua or C++, and/or which ones can a modder utilize for the mods they create?

thick karma
#

That said, the type of mod you are making will affect what you need and the structure of your code.

#

E.g., you will need special folders for animations or sounds if you add them.

naive fox
thick karma
#

You can view the code of any mod to which you have subscribed on the Workshop in Steam/steamapps/workshop/content/108600

#

(obviously Idk where your Steam is installed)

naive fox
thick karma
#

Super subjective imo

#

But there are objectively useful tools associated with specific editors

#

I personally prefer VS Code but I do not rely heavily on code completion when I program, so I'm not necessarily as picky as some about my editor.

#

A lot of people strongly recommend IntelliJ for a couple reasons

#

One, you can easily follow Konijima's guide to decompile the game's Java and use its files in your code completion

#

And two I believe there are add-ons for Lua code completion based on the media folder as well

#

Although I don't use them so Idk what they are

naive fox
#

I'm a game programmer by career (haven't graduated yet) focused on C++, so I expect the mods I make to be heavily code-oriented

#

But thank you, I'll take a look into those now ^^

thick karma
#

Good luck!

dark wedge
#

Is there a way that I can get a zombie by its OnlineID, or something similar? I'm currently trying to send a command from the client to the server, and need a way to tell the server which zombie to actually do something on. The only thing I could find is GameClient's getZombie() static method, but that's not exposed (or at least not from getGameClient()).

jovial harness
#
for playerIndex=0,getNumActivePlayers()-1 do
     local playerObj = getSpecificPlayer(playerIndex)
     if playerObj and playerObj:getInventory() then
         -- do stuff in the player's inventory
     end
end

This is in a function called on the EveryOneMinute event on the server. Anyone knows if this is fine to get all online players on a server?

sour island
#

It seems accurate for the most part

#

I'd have to retest but I recall there being instances of not finding the zombie

#

This was also server to client

worldly olive
#

It also works for split screen

jovial harness
dark wedge
humble oriole
#

with the script manager is it possible to remove a recipe requirement and add in another?

sour island
#

If they moved around that is

dark wedge
#

Yea, i could see that being inaccurate if the connection between client and server isn't the best or there is just any sort of delay/desync

sour island
#

Perhaps using tile first then falling back to cell could be the way to go

#

But whatever information you need to send could probably be cut down

lost spear
#

No place to really discuss mods. Im curious are there any big mods like hydrocraft was back in the day?
I know its quantity over quality but it had some cool parts to it.

ancient grail
#

whats the max for engineForce

#

anyone know

dark wedge
# sour island Tried that too and that also had some issues - but more so - the returns for get...

This is for a weapon attack, so it needs to be fast. Iterating over the zombies like this would not be good for performance, and it needs to be consistent. If I can't get by the zombie id, then i'm not sure this is possible without either building my own cache, or letting the server calculate the weapon arc and stuff too. Problem with that is then I don't have a way to ensure that the same zeds are hit on client/server as i can't get by any zombie id.... stressed

fast galleon
#

hm, chuck knows better than me, but I thought it was said that zeds should be hit client side? Not sure how that conversation ended.

dark wedge
#

They do get hit client side, and i can see the events be fired when doing damage. My problem currently are the hit reactions/staggers...

fast galleon
humble oriole
#

Trying to edit a vanilla recipe

fast galleon
#

I think so, don't have an example atm.

rustic garnet
#

Is it more worth to do PZ mods in lua or java?

fast galleon
#

java is worth more, lua is simpler. For peace of mind, none.

tepid dawn
#

Hello, i think its a quick question but it may not be too

rustic garnet
tepid dawn
#

i have a mod, and when i wear only my pants, its model is properly set

#

however when i also wear my jacket, then some faces disappear from my pants

fast galleon
#

never used that, I keep it simple

tepid dawn
dark wedge
tepid dawn
#

oh that makes sense, sorry didn't see that channel lol

faint jewel
tepid dawn
faint jewel
#

.... those are what cause that to happen.

tepid dawn
#

and what numbers mean, couldnt find documentation online too

#

so i should remove all of them ?

#

masks of my jacket and pants interact with eachother, i dont know if this is on purpose but when i remove all of them, i can see the the skin from the elbows of my character...

drifting ore
#

Me and 9 other Project Zomboid YouTubers are looking for mod makers on our server. We need just a few simple mods
If you are interested - DM me. And I also will send you the full list of YouTubers participating, if you want.

faint jewel
#

what kind of mods?

#

they may already exist

tepid dawn
#

@faint jewel do you know any documentation about how masks work ?

#

its driving me crazy

faint jewel
tepid dawn
faint jewel
#

๐Ÿ™‚

cosmic condor
true vault
drifting ore
#

every time I almost finish up. I find one more thing that would be awesome and then spend the entire next day figuring out. adding battery connector to lightswitches by sandbox level requirement, or completely disabled.

#

as i do more things i start to understand why modders mod ๐Ÿ˜„

true vault
#

Oh hey Nippynip

#

So I figured out a potential workaround to that project

drifting ore
#

this is how many options i've finally added

#

oh really?

ancient grail
#

Keeep it uuuuupp

true vault
#

Yeah, potentially. If I were to detect the worldage, that might be a hacky way of detecting when the map is newly generated, maybe. Like, there's gotta be some combination of other functions that would allow me to detect the world being "created", first player joins, etc, etc.

Then if I can somehow force tiles getting placed on squares that haven't been loaded..

true vault
drifting ore
#

that's actually a pretty decent approach I think . I do wonder if it's possible to generate additions to veg layer on the fly

#

without killing pc

#

if there was then it could just appear like a tree would but only dynamically

#

i do wonder what event it's tied to or what kind of custom event would be ideal for that

true vault
#

Well, I realized something important that'll help with this lolz... what I'm working on is for a very specific map, with an already-known size, so, I can manually loop through the cells, randomly select a set of coords within that cell, grab the square based on those coords, and place the item, then wash rinse and repeat through all cells.

#

So, that part at least is covered.

drifting ore
#

ohhhhhhh

#

i didn't realize this was going to be on your map. even better

true vault
#

It's just the part where I need to limit this to only happening once, pretty much as soon as the world exists, that's the tricky part

drifting ore
#

my original idea is teh way IMO

#

it's not dynamic but the performance cost is not even compareable

true vault
#

In theory, if I can later figure out how to detect total number of cells in a world, such a script could be adapted to any size map too.

drifting ore
#

actually thats right

#

we want new and inventive ways to do things ๐Ÿ˜„

true vault
#

Yeah, I want the spread of them to be dynamic, so that players can't simply memorize where they are, and plan where to build communities based around those known locations.

drifting ore
#

your way would work for any map though if you get it to work, while my way would require you setting up a rules.txt and custom defining a color to the tile and where map makers place that color on map will spawn them

true vault
#

Like that way players can't be like "Hey, I know item X will spawn to the far right of the cell if I spawn at the Camp Rosewood point, so we should all spawn there, move that way, and start the first village there" type of thing.

drifting ore
#

my way is the boring way and more work for everyone

#

yea i'm really interested

#

you gotta keep me update on your progress ๐Ÿ˜„ i'm not at a level where i'd even know where to begin implementing something like that

true vault
#

Heck, if I can even get it to work off of a manual trigger, that would be a start, and then figure out automatically triggering it later lolz

red tiger
#

sus

true vault
#

actually, that said, I already did get that partly working. I already have a function that spawns it where you're standing when you run the function in the in-game console. I can probably expand upon that to generate it randomly with the same function... hmm...

drifting ore
#

could have it attach to certain other tiles/sprites and spawn within a random distance from them

red tiger
#

Huh did someone else besides me call Lua classes pseudo-classes?

drifting ore
#

not sure if there is any sprites that would fit the criteria for you

true vault
#

I mean, psuedo-classes are def common enough of a term that I've heard the term used before >.>

fast galleon
#

table inheritance drunk

true vault
red tiger
#

TIL you can use prototype API on ES6 classes.

#

My goal is to spit out something like:

// ES6 Class syntax
export class ISUIElement extends ISBaseObject {
 // ...
  update() {
    // ...
  }
}

// ES5 Prototype syntax
// Example Override method in another Lua file.
UIElement.prototype.update = function() {
  // ...
}
weak sierra
#

anyone know if the "ZombieMap" in the lotheaders for maps is exposed to lua in any fashion whatsoever?

ancient grail
#

You and your mods.. i never understood anything that you do

#

Not once

red tiger
ancient grail
red tiger
#

I'm at work.

#

I write JS at work.

ancient grail
#

Ahh cool man

edgy shadow
#

I just made my first mod with an outfit. It's a military outfit, how can I say that I only want the outfit to spawn in areas that other military outfits spawn in?

true vault
#

(I would pull up and post the relevant code for ya directly, if I weren't on mobile at the moment, sowwy ;-;)

#

I believe there's even a list somewhere in this channel of the entire list of room zones/types/definitions, and the containers they support.

#

You can also specify it as viable options for military zeds themselves, using the outfit defs for the military zeds

edgy shadow
#

I've added the new clothing piece to container distributions, but I mean as an outfit on a zed

true vault
#

Aye, that'll be the last point above then; you would want to add the clothing pieces as an outfit, and add that new outfit to the male and female zed outfits, for the military zed type.

edgy shadow
#

I've already made the male and female outfits, and can spawn them manually the way I want them to look using the debugger

true vault
#

(plus any variations as well, as new outfits, like if you want some to spawn with the vanilla army tshirt, your pants, no jacket, that would be a variation that needs to be a new outfit)

edgy shadow
#

I copied a vanilla military zed outfit as a base, but didn't see anything in that to say where they spawn

true vault
#

Yes, you specify that using the zed inventory dist tables

#

Basically, you would need to add it to three things;

military zed outfits - male
military zed outfits - female
world containers appropriate for military equipment spawns

#

Sound like you're saying you already have the last one covered, so only the first two left.

#

HOWEVER, and maybe this is just me not explaining it thoroughly enough.. to add them as outfits to the zeds, you bave to create the actual outfit definitions. Then add those definitions, to the tables that control what the zeds spawn with as what they're wearing, specifically for the military zed types.

#

Can't just spawn the items in their inventory and expect the game to make them wear the items, if that's what you were expecting.

edgy shadow
#

I've got the outfits defined. Just need to do the zed spawns

true vault
#

So yeah, you just need to add it to the military zeds outfits tables

edgy shadow
#

I think I found the file in vanilla for this
ZombiesZoneDefinition.lua

naive fox
#

Anyone know if one can use Visual Studio Enterprise to mod zomboid, or does it have to be visual studio code?

true vault
#

But yes, you can use any editor that'll allow you to open, edit, and save .lua and .txt files

red tiger
#

VSCode is a great medium.

#

Some use IDEA.

#

I'm in the VSCode camp.

true vault
#

Heck, you can even use Notepad for it (like regular notepad, not notepad++ even haha)

naive fox
#

Well, I use visual studio enterprise for my coding, and I'm used to VS, but would prefer not to install Code when I have enterprise :/

Just don't know which modules I'd need for zomboid.

red tiger
#

vim

true vault
#

None actually @naive fox

#

The .lua files open as basic text files really

red tiger
#

I also manage a TypeScript environment as an alternative.

naive fox
#

Hmm, I see. Thank you~

true vault
#

As far as Lua goes, there's not really any 'environment' to set up.. they're just basic text files with a non-standard file extension haha

#

So simply opening the folder will do (in VS)

#

I also use VS (not enterprise, but the difference between community edition and enterprise, in this case, in nothing), and tried using it as my IDE for PZ mods, but TBH, I find a basic text editor to be alot less cumbersome to edit these things in, comparatively.
(plus Sublime happens to have Lua highlighting built right in anyways, so, win-win lolz)

red tiger
#

VSCode is what I use for everything except what I need to code in VSCommunity.

#

Java -> IntelliJ IDEA because I mainly reverse engineer.

true vault
#

I've never understood the appeal of VS Code.. Less features, and no native port for Linux/Ubuntu..
It otherwise looks decent enough, and is still more than a basic editor like sublime or notepad++, but still, I just never understood it lolz

edgy shadow
true vault
#

table.insert(ZombiesZoneDefinition.Army["ArmyCamoUrban"], ArmyUrbanCamo) I think

edgy shadow
#

I put that in lua/shared/NPCs folder

#

I copied the code I have from AuthenticZ... there are some inserts at the bottom, but I thought that was just for rooms

#

Or general population? I also looked at the vanilla file, and just copied based on the desert camo entries I found

ancient grail
#

Copying from other mods isnt exactly a good practice. But on your case i think we can agree its cool cuz its just definitions

true vault
#

You're assigning instead of appending, basically

#

Essentially overwriting all other outfits in that table

edgy shadow
#

I think it's appending, adding a new item to an array. I'm no lua expert but that is the syntax in many other languages

true vault
#

I mean, I actually program in many other languages, and that's false... single = is assignment, not append.

red tiger
#

I mean is this nuance that important? =P

edgy shadow
#

Well then AuthenticZ has a lot wrong in there code

pulsar heath
#

hey everyone, i have a dumb question... is there a way to make an item in the players inventory invisible?

#

i think there was a way but cant quite recall how

true vault
true vault
true vault
#

Nit sure how to make invisible inventory unfortunately lolz

edgy shadow
#

SecretBase is defined in vanilla. No SQL inserts for SecretBase in AZ

true vault
#

Yeah, that's adding a new outfit called Ghillie

pulsar heath
#

but i do recall someone saying something about making an item not listed in the players inventory

#

or i might be mistaken and it was on another game

true vault
#

ArmyCamoUrban is a vanilla outfit though isn't it? Your code overwrites it. That's all I'm sayin..

edgy shadow
#

ArmyCamoUrban isn't a vanilla outfit, that's the point of my mod. Vanilla lacks Urban Camo Jacket, so I made that and an outfit with it

true vault
#

Oh, well fair enough then, I thought that was a vanilla outfit, because I've seen it ingame before lolz... guess it was another mod we had installed.
What you wrote should be fine then. Carry on lolz

naive fox
#

Is there an "OnCreateZombie" event just like there's one for player & survivor? o.O

Can't seem to find it in the wiki

edgy shadow
#

hmmm, well I must still be missing something. I went to the military road block by LV. Spawning zeds with the debug horde manager and my outfit does not appear...

#

regular military spawns, but not my addition, so I didn't overwrite the vanilla...

drifting ore
#

you are adding to a non defined table or something

#

authz uses custom defs

#

so you can add to their def but your stuff has to be defined within the other parts of your code that determine which zombies wear it or something along those lines

#

there is a post earlier showing a semi reasonable example but for weapons spawning attached to zombies based from clothing, which is same concept minus adding the extra weapon attachment stuff based on clothing

#

pretty sure the reason for this not working is the usage of weapon attachment so you should be fine seeing what's used prior to it

drifting ore
modern dirge
#

is it possible to get the world Coords of the camera?

tame mulch
weak sierra
#

no damn clue

edgy shadow
#

D'oh! So my code worked. But I had made a version that I uploaded to the workshop, and then I was still working on my original dev version. But PZ was running the unmodified workshop code.

drifting ore
#

any chance you think it could be another mod causing it?

weak sierra
#

it adds its own code and things for everything

#

a mod i run does override some of the animations

#

but that's the only thing that should collide

drifting ore
#

maybe something runs that breaks it before or something

#

i mean i got nothign but im throwing stuff out there

modern dirge
#

im working on a shader related to fog that but there is a world offset based on the player i think

weak sierra
#

i put it pretty long in the load order to avoid stuff too.

true vault
tame mulch
modern dirge
#

ah i see cameraInfo that may be it

drifting ore
#

trying to add a feature to control light strength through a couple of context options for the lightswitch mod and finish this pickup level thing and i should good to go lol... i swear im not going to think of another thing to add

true vault
#

"i swear im not going to think of another thing to add"
-cough- BS -cough-

drifting ore
#

said that 3 features ago lol

true vault
#

It's okay, if I had stopped when I originally planned with what has turned into my current mod, I woulda been done weeeeks ago lolz

drifting ore
rustic garnet
#

Does anybody know where is the code that renders the health tab in the character?

edgy shadow
#

Anyone know if it's possible to specify a texture for an item in an outfit? This particular item has 3 texture options.

true vault
#

Gonna need to make it 3 seperate items with a model def for each, I think.

edgy shadow
#

I know that can work, but this is for an item that I didn't create. No big deal

modern dirge
#

Thanks Aiteron, i found the camera offset

humble oriole
#

What's the best way to send a command from the server to the client without using the object system? I'm trying to have the chracter "say" something after doing an onCreate which is server side.

#

do I still do the ServerCommand?

drifting ore
#

woo @fast galleon lol I will credit you for sure... but seriously link your workshop or ANYTHING you want. so good

#

you made something i didn't even think was possible, possible, and also open the door for many other possibilities i havent even figured out yet ๐Ÿ˜„

thick karma
#

@jagged fulcrum Yo alree FYI I just posted a bugfix on your workshop page for IGM

rustic garnet
#

Is there anything specific I need to do so I can reload lua scripts in the debugger? It seems when I hit reload it doesn't often reload the script I need to quit and start again the game

drifting ore
#

box on the left side to open lua file explorer, can click + to favorite and then click to reload

drifting stump
#

there are a lot of quirks with reloading files in most cases backing out to the main menu is recommended

ancient grail
red tiger
#

Back to the drawing board.

#

Working on UML class diagrams again for my transpiler class stuff.

quaint zephyr
#

Hi. Is there a tutorial on how to get started in modding?

tepid dawn
#

they're easy to find with a google search really

quaint zephyr
#
thick karma
#

Staying in for too long before reloading a file would cause a server timeout and boots you.

red tiger
#

Not planning is planning to fail!

true vault
#

Is there a set number of chunks per cell?

#

Or more accurately, is there any possible way at all to fetch a specific square and interact with it?

thick karma
#

10x10

#

Wait

#

30x30

#

A chunk is 10x10

#

A cell is 300x300

drifting ore
#

i swear a chunk was 175 tiles in and x and y from the player at all times

thick karma
#

It's not

drifting ore
#

ahh so it starts right in the first pixel?

#

or coord of that cell?

thick karma
#

Yes

#

Square = 1x1, chunk = 10x10, cell = 300x300

drifting ore
#

i always wondered also but never had a reason to ask i guess that makes sense also. thanks!

thick karma
#

@true vault

ZGal88 = {}
ZGal88.onClick = function(object, x, y)
    if not badSitch() then return end
    if not object.getSquare then return end

    local square = object:getSquare()
    -- Boom
end
Events.OnObjectLeftMouseButtonUp.Add(ZGal88.onClick)
#

(either way)

thick karma
#

There's also getGridSquare(x, y, z) iirc.

#

Or maybe just getSquare

autumn sierra
#

i made some random remakes of some of the t shirt decals in better quality on canva, all of them are replacements except the circular mccoy one, what do yall think so far

#

never messed with modding before so im giving it a go

#

i figure simple retextures are gonna be easy enough, maybe even adding some new decals that can spawn

drifting ore
#

thats sick

#

nice

thick karma
#

@true vault Okay it's getSquare(x, y, z)

#

Global

ancient grail
#

how do i bend the players knee via xml? like the animation i did

#

and how do make this animation be able to move

#

its just stuck on 1 square

red tiger
#

Still going haha

cosmic condor
#

I just discovered that the PNG preview image of a mod can cause this error. I'm sharing this information for anyone who may encounter the same issue.

    at zombie.core.textures.TexturePackPage.getTexture(TexturePackPage.java:179)
    at zombie.core.textures.Texture.getSharedTextureInternal(Texture.java:630)
    at zombie.core.textures.Texture.getSharedTexture(Texture.java:528)
    at zombie.core.textures.Texture.getSharedTexture(Texture.java:515)
    at zombie.core.textures.TexturePackPage.getTexture(TexturePackPage.java:179)
    at zombie.core.textures.Texture.getSharedTextureInternal(Texture.java:630)
    at zombie.core.textures.Texture.getSharedTexture(Texture.java:528)
    at zombie.core.textures.Texture.getSharedTexture(Texture.java:515)
red tiger
#

PNG encoding probably.

true vault
tepid dawn
#

there is a comprehensive video tutorial that covers many aspects which is 1.5 hour long

#

and a simpler one belonging to a channel named Blackbeard i think

red tiger
#

Spent nearly 100% today coding. sledge

#

\o/

tepid dawn
#

i'm trying to get an icon from the base game to work on

#

but cannot find the icons

#

i looked at the xml files of clothings, Hat_ArmyHelmet has Icon = GreenArmyHelmet

but when i search for GreenArmyHelmet in PZ directory, it returns nothing

true vault
#

Wouldn't happen to be this one perchance @tepid dawn?

tepid dawn
#

Ohhh

#

That makes a lot of sense

#

Thanks

true vault
#

aha, yerp. They're in the files too, but as a pack of icons, for lack of a better word.

tepid dawn
#

And one more small question if you dont mind

true vault
#

mmm, sure

tepid dawn
#

Do I have to relaunch the game everytime i edit an icon or a texture ?

#

I dont need to for models but

true vault
#

Usually works fine for me just exiting to main menu then reloading save

tepid dawn
#

Oh thanks again

#

Im sick of disabling and enabling mods over and over again

true vault
#

Your mileage may vary on that though; I wouldn't take that as written in stone lolz

tepid dawn
#

Oh yeah If i dont see any changes in a long while ill probably just relaunch the game

#

Still thanks for the help though

drifting ore
#

Looking for a moder to hire. Me and 9 other PZ YouTubers are currently making a server, and we need to remove this stupid knockback when you get shot. If it will affect zombies as well, that's totally fine for us. DM me

true vault
#

Can you really call it hiring though, when you're not actually offering payment? aha

drifting ore
true vault
#

aniThonk cool cool, best of luck then :3

tepid dawn
#

its actually interesting there are so many ways to make some money, like i'd never imagine somebody would ever get paid for modding on zomboid but here we are

tepid dawn
#

i'd like to if i had enough knowledge but im just a newbie

true vault
#

I also would take a look at it, but I feel like it'll be taking up more time than I have, while I'm in the middle of something else rather huge currently.

autumn sierra
robust briar
drifting ore
#

that sure is interesting

#

does this wipe the current as well? does it ignore safehouses? or is that the goal?

#

sorry for questions, just pretty awesome

robust briar
#

It wipes if there are less than the number of items configured in the container (in the gui). Yes, it ignores safehouses, and only refills original containers. It uses the same lootspawn table as well, so it follows the sandbox settings.

drifting ore
#

sure hope that sees the public lol

#

goodbye soft resets

robust briar
#

Was not too hard really, I just hi-jacked the "right-click -> refill" admin thing

#

then I remove items based on the settings

drifting ore
#

yea it's still a straightforward way and you make it easy haha. that's really the part

robust briar
#

the worst part is delays to wait for network shit, like chunk loading, and container item sync

drifting ore
#

nice job though

robust briar
#

I need to a way to export the log to a file (so it can be reviewed by QA team and such)

drifting ore
#

pretty sure you can write to a file"?

robust briar
#

Yeah, just need to think about it.. like CSV maybe?

#

a list of X,Y,Z and items spawned

#

maybe container name

drifting ore
#

sure, i think it's really based on how you'd utilize the data i suppose

#

csv is easy to whip into a spreadsheet quick lol

#

just depends on how the data ends up being formatted i suppose

robust briar
#

and its plaintext searchable too

#

I โค๏ธ CSV's

#

You can pipe a CSV into grep like ๐ŸŽ‚

drifting ore
#

lol

robust briar
#

Future respawn ideas is car cleanups and burned out cars

#

like, delete any car that has been stripped and randomly spawn in another one in somewhere else

drifting ore
#

oh nice thats very doable. pretty sweet also. lol essentially a live chunk cleaner instead of wiper ๐Ÿ˜„

robust briar
#

Yeah, at least on our server we have random lore all over the map

drifting ore
#

all you need is something to handle zpop and good to go

#

lolol jkjk

robust briar
#

we have respawn on lol

#

its a grind

ancient grail
#

Ill add this to the tool list when its done

ancient grail
ancient grail
#

His respawning container loot

weak sierra
#

would just need to change the parameters from "unseen for X time" to "condition < X"

weak sierra
ancient grail
#

Ahh sorry lol

#

Just woke up

#

That vehicle respawn is useful but the print tho ๐Ÿ˜ญ

weak sierra
#

anyway @robust briar if you need that feature it would not be too hard to add it as an option

weak sierra
#

:p

#

look

#

literally on the list

#

lol

ancient grail
#

Thnk you

weak sierra
#

that's the short list too

#

i had big depression times through most of december/early jan

#

so i wasn't super productive in that time

#

fell behind on a lot of stuff, and then found out sandbox options are bork and other nonsense

ancient grail
#

I understand. Please take care of yourself and try to avoid getting stressed out cuz of pz

drifting ore
#

sorry for your troubles lately and i also apologize for changing topic as well but i must ask. if there a way to just generally speaking add a timed action with no parameters except the time itself? i don't fully understand when i am reading it

ancient grail
#

I guess but what for

#

Just to stop the player?

drifting ore
#

i want to control craft speed by sandbox option but i can just use OnCreate maybe to add a timed action before completing craft

#

?

#

i tried using getTimeToMake() for recipe but it seems it only returns a value and can't be set or i dont know how to use it properly

#

then i saw ISCraftAction:new(self.character, items:get(0), recipe:getTimeToMake(), recipe, container, containers)

ancient grail
#

No setter ? Thats a shame

drifting ore
#

see that second one though

ancient grail
#

Just put the sandboxvar as time

#

Yep you're right

drifting ore
#

actually i mean this one
ISCraftAction:new(playerObj, selectedItem, recipe:getTimeToMake() + additionalTime, recipe, container, containers)

ancient grail
#

Your workaround sounds spot on . Well atleast for me it is

#

Yes whereas additional time = sandbox var

drifting ore
#

i'm trying to see if i can alter it without having to call player or selectedItem though

#

exactly is my thought. but setting player and selectedItem to nil doesn't work and i don't know how to skip them without calling them nil

#

lol i dont want to write moreee

#

at this rate though i have literally almost everything thought of

true vault
drifting ore
#

haha already in

#

unless you mean it working a different way

#

you can use battery connectors by sandbox option level, also a setting to disable players from installing them.

#

this is my potential workaround for not being able to control craft speed by sandbox option. using OnCreate lua

local switchSpeed = SandboxVars.Nipswitch.Craftspeed
function Recipe.OnCreate.Switch(items, result, player)
    ISCraftAction:new(player, items,  switchSpeed-1)
        player:getAnimNode("Disassemble")
        player:setProp1("Screwdriver")
        player:setProp2("lighting_indoor_01_0")
        player:getInventory():AddItem(result)
    player:getEmitter():playSound("VehicleHotwireStart")
end
``` here's hoping it works lol
#

hoping the sound doesn't play forever ๐Ÿ˜„

#

fail, well tweak this a little. someday i won't be incredibly slow at this

ancient grail
#

@red tiger i had this idea that we should start a thread about other programming related stuff . Idk

ancient grail
#

Nvm

#

Im gona dm u why

drifting ore
#

that would actually be pretty cool to see all the updates and stuff in one place to reference. i like seeing them here or anywhere, but having them all together would be pretty sweet

#

also good way for people to know the extra tools available for modders that aren't the standard tools you'd use

#

jeez... goodluck with that

golden sparrow
#

Ooof Just contact authorithies and let them do the tracing thing i'd say

queen sail
#

This is an odd question- I remember an ammunition foraging focus, but cannot seem to find any reference to one. I am playing on a server with alot of mods, is there a mods that adds this?

ancient grail
#

I ment to keep this private but i guess i hope someone here reads this msg and decide to help.

thick karma
#

Hey deleting the file will not delete it on servers that already run your file. You may instead want to leave the file in your mod but empty it of code for compatibility.

#

I know right haha

#

Just wanted to warn you

#

Unfortunately deleting a file can cause probs

rustic garnet
#

Any good mod tutorials and resources out there?

ancient grail
#

Check the threads @rustic garnet
Its literally almost every resource out there

rustic garnet
#

Also for the client scripts if you want it to work multiplayer can you still use getPlayer or do I need to loop still through the connected players and getSpecificPlayer?

rustic garnet
ancient grail
#

If you want local then getPlayer()

thick karma
#

0, 0 may have no definition

#

Idk for sure

ancient grail
drifting ore
#

anyone know of a way to set a timed action with only using time, player, and item as my arguments? or another way to add a timed action to OnCreate D:

rustic garnet
rustic garnet
rustic garnet
ancient grail
#

Yes
I suggest looking at vanilla and other mods(use as reference ONLY dont copy unless prrmitted to)

thick karma
#

Why wouldn't you be able to?

ancient grail
#

Hes just asking if its a good idea i think

drifting ore
#

lol no idea i can't figure it out inside the recipe function yet

fast galleon
drifting ore
#

not saying much ๐Ÿ˜„

thick karma
#

You have to call it NippinAround or it won't work though he lied, laughing

drifting ore
#

was trying to use ISCraftAction:new(player, nil, switchSpeed-1)

thick karma
#

I mean is crafting your goal?

drifting ore
#

yes

#

it's for controlling craft time of recipe

thick karma
#

I see then you could dulicate ISCraftAction and edit that instead

drifting ore
#

but i can't figure how to change that with sandbox only by manually setting in script

thick karma
#

To make your own similar action with new requirements

#

Uhh TimedAction must be written in Lua

ancient grail
#

My suggestion didnt work?

drifting ore
#

yes i'm using OnCreate

ancient grail
#

Put the sandbox var as param

#

On the time action

drifting ore
#
function Recipe.OnCreate.Switch(items, result, player)
    local switchSpeed = SandboxVars.Nipswitch.Craftspeed
        ISCraftAction:new(player, nil, switchSpeed-1)
    player:getAnimNode("Disassemble")
    player:setProp1("Screwdriver")
    player:setProp2("lighting_indoor_01_0")
    player:getEmitter():playSound("VehicleHotwireStart")
end
ancient grail
#

That is triggered by the onceeate

drifting ore
#

getting error atm

ancient grail
#

o.time=defaultTime+sandboxvar

#

Have you tried this?

#

I believe ive done something like this before but not sandbox

#

Someother variable based on the trait and its tested by the oncreate or context menu cant remember

drifting ore
#

no idea. ill try it

ancient grail
#

๐Ÿ‘Œ

drifting ore
#

it doesn't need to be ISCraftAction though

ancient grail
#

๐Ÿ˜ฎโ€๐Ÿ’จ back to work

drifting ore
#

i just thought it lined up and would have easily worked but i'll try something more straightforward maybe

fast galleon
#

you can intercept craft action new and edit the returned obj maxTime

#

just an idea if you have trouble with other options

thick karma
#

@drifting ore What exactly is your modding goal here?

#

Just a craft action with a modded duration?

drifting ore
#

with a duration set by server owner via sandbox. totally not needed whatsoever but also realized it's the last piece to making it pretty much fully compatible with anyone's setup also

#

someone mentioned issues with me using a book, so i made page length an option. and it kinda spiraled from there

#

this is literally the most unimportant option of them all but if i can figure it out, that would be cool also ๐Ÿ˜„

#

i still have to figure out how to change the light strength on the fly as well so i can create a sub context menu that lets you change the strength of the lights radius as well... 0 idea if that's even possible but i'm sure half of my day tomorrow will be messing around with it

#

I've gotten 90% done thanks to many great minds and a ton of my time researching and learning ๐Ÿ™‚ . still extremely noob when it comes to all this

drifting ore
#

lightswitch

thick karma
#

Ah. Depends on where lightswitch code declares its light in vanilla

drifting ore
#

i think i can use spritemanager

#

and properties

#

ignore the above*

#

not 100% but i'm going to mess around with it here next if i figure out the craft speed thing or give up on it ๐Ÿ˜„

#

thanks to poltergeist writing that overwrite to PickUpLevel array thing. i was able to actually use it also

#

somehow it only has 1-5 in vanilla...

#

setLightPower() is what i actually meant

#

not sure where i thought i saw it before lol... but yea that's what i figured i'd be using to do it

thick karma
drifting ore
#

in this case it's going to be limted to 2 recipes

#

OnCreate:Recipe.OnCreate.Switch, inside each recipe

#

will contain my timed action and all the other fun stuff

thick karma
#

Mmm. I see. So you're already firing that event successfully? What does that function look like?

#

And is Recipe.OnCreate.Switch a vanilla override or what?

drifting ore
#

it's not firing correctly but will when i get the timed action setup correctly haha. this is what i'm going to try next. using global function and just calling it inside the other function in the oncreate

#

it's not technically an override

#

it's just a new function instead of using a limited one inside or recipe script

#

this is my new function im going to try

thick karma
drifting ore
#
function SwitchCraftAction:new(character, item, time, recipe, container, containers)
  local craftSpeed = SandboxVars.Nipswitch.Craftspeed
  local originalTime = time
  local modifiedTime = originalTime -- add 30 seconds to the original time
  local o = {}
  setmetatable(o, self)
  self.__index = self
  o.character = character
  o.item = item
  o.recipe = recipe
  o.container = container
  o.containers = recipe:isCanBeDoneFromFloor() and containers or nil
  o.stopOnWalk = recipe:isStopOnWalk()
  o.stopOnRun = recipe:isStopOnRun()
  o.maxTime = modifiedTime
  if character:isTimedActionInstant() then
    o.maxTime = craftSpeed
  end
  o.jobType = recipe:getName()
  o.forceProgressBar = true
  return o
end
#

yes

#

getting error atm

#

because im not using the vanilla one the way it wants

#

so im just making a new one

thick karma
#

Your action should really be PascalCase not camelCase

#

It's an object class

#

It's pseudo OOP

drifting ore
#

so cap first letter?

thick karma
#

yes

#

just standard

drifting ore
#

appreciate that

thick karma
#

You'll see every single object class in the game works that way

drifting ore
#

prefer to learn it right way from start

thick karma
#

Every TimedAction

#

(Including TimedAction which is itself also an object class)

#

(hence not timedAction)

drifting ore
#

i'm assuming if i use my sandbox option for max time. all this convolution ends up turning it into time

thick karma
#
  local originalTime = time
  local modifiedTime = originalTime -- add 30 seconds to the original time
  local o = {}
  setmetatable(o, self)
  self.__index = self
  o.character = character
  o.item = item
  o.recipe = recipe
  o.container = container
  o.containers = recipe:isCanBeDoneFromFloor() and containers or nil
  o.stopOnWalk = recipe:isStopOnWalk()
  o.stopOnRun = recipe:isStopOnRun()
  o.maxTime = modifiedTime

This snippet sets maxTime to the original time.

#

Ohhh I see you redo it

drifting ore
#

yes. vanilla added 3 secs

thick karma
#

Weird

drifting ore
#

30

#

i could probably simplfy that a little but w/e haha

#

removed that comment also

thick karma
#

o.forceProgressBar is likely pointless, all Timed Actions show progress bars unless someone makes them stop doing that with code that will likely ignore your flag.

drifting ore
#

as long as it ignores lol.. about to test it now here

thick karma
#

What error do you get?

drifting ore
#
function Recipe.OnCreate.Switch(items, result, player)
    local switchSpeed = SandboxVars.Nipswitch.Craftspeed
        ISCraftAction:new(player, nil, switchSpeed-1)
    player:getAnimNode("Disassemble")
    player:setProp1("Screwdriver")
    player:setProp2("lighting_indoor_01_0")
    player:getEmitter():playSound("VehicleHotwireStart")
end
``` error was with this in vanilla and it was getting caught up somewhere int he vanill function
#

testing for craftfromground = true

#

so i'll try this for now and see if it works lol. going to cut all this stuff out except item and time

thick karma
#

Can you screenshot the error?

#

Also that is not how you use a timed action

#

but setting that aside

drifting ore
#

hahaha

thick karma
#

I need to see your TimedAction code in its entirety

fast galleon
#

yeah ๐Ÿคฃ

thick karma
#

To see if it's even constructed correctly

drifting ore
#

lol

thick karma
#

And seeing the error would help

#
-- or Module.action =
local action = DualWieldAttackAction:new(player, WDW.lefthandWeapon[player])
ISTimedActionQueue.add(action)

@drifting ore

#

The Queue fires your timed actions

fast galleon
#

I think what you try to do would be smoother if you remove the recipe part and use context and your time action?

drifting ore
#

ahhh. alright. and yea it would but i'd like to kee3p it in line with how vanilla works for the most part

#

adding a perk level requirement to reading the book and other things ended up working out and was a great learning experience but i'm hoping to really try to figure this out all using the recipe and OnCreate if i can.

#

or OnCanPerform, but this seemed to fit better under OnCreate

thick karma
#

If your code is calling Recipe.OnCreate.Switch(items, result, player) and providing you with that input, you can do virtually anything with it

thick karma
drifting ore
#

i gotta test this quick

#

ill share then

thick karma
#

Cool

drifting ore
#

well i rewrote the vanilla and shared it

#

just above

#

ill report back ina few

thick karma
#

That's all you have?

#

One :new function?

#

You need other functions...

drifting ore
#

do i need all 5?

thick karma
#

At least perform, start, stop

#

isValid might be a useful one to define

fast galleon
#

derive from craft action maybe

thick karma
#

Yeah

#

Good call

#

Agreed

drifting ore
#

thank the gods lol

thick karma
#

So what is the OG craft action called again?

drifting ore
#

not 100% sure what you mean

thick karma
#

SwitchCraftAction = ISCraftAction:derive("SwitchCraftAction")

#

It's called ISCraftAction, looked it up

drifting ore
#

ahh

#

yea thats what i got it from you right

thick karma
#

That would give you all of ISCraftAction's functions

#

And THEN you redefine :new and you're golden

#

However

#

Your action requests a recipe, a container, and containers, and presumably needs them

drifting ore
#

can player be the container? lol

#

what is also the diff between each? i dont get that

#

that part confused me

thick karma
#

Probably not. I am not sure of the precise nature of the recipe object or where to get it... you may be able to get your container from the items object. I would look up an example of vanilla calling ISCraftAction:new and see where vanilla grabs its data / what kind of data it grabs.

fast galleon
#

hm, derive from craft could cause issues, maybe you need base action instead.

thick karma
#

e.g., in ISInventoryPaneContextMenu.lua:

local action = ISCraftAction:new(playerObj, selectedItem, recipe:getTimeToMake() + additionalTime, recipe, container, containers)
drifting ore
#

yea thats what i got my first iteration from

#

i left out all the args after time

thick karma
#

Where

    local containers = ISInventoryPaneContextMenu.getContainers(playerObj)
    local container = selectedItem:getContainer()
drifting ore
#

recipe:getTimeToMake is time Arg

thick karma
#

and selectedItem very well may be your items variable at a glance.

ancient grail
#

its not bad tabbing its intentional the player isnt on the Z1. his just on the Z0.. i nead to make it move on the Z1 any ideas??? pls help

thick karma
#

or something related

#

And recipe may be result in your code, but idk for sure

#

You would need to do some printing

drifting ore
#

i assumed result was my item

#

ill check it

thick karma
#

I have no idea what kind of object recipe and result are without printing them

ancient grail
#

i might check if thers a floor on the z1 if there is then move like that animation on the ground

drifting ore
#

yea i'll run prints

thick karma
#

Vanilla naming standards are problematic at best and not well-enforced.

drifting ore
thick karma
#

Is it player or playerObj? playerIndex or player? Which kind of player is it? Questions like these . . . should not exist. ๐Ÿ™‚

drifting ore
#

it prints 0

thick karma
#

Result is 0?

#

What is 0

drifting ore
#

lol... the player

thick karma
#

I already could have told you that

#

In this case player means playerIndex

#

(and I would rename it accordingly in anything I do)

drifting ore
#

sorry i am getting tired also so i'm not as quick to the draw ๐Ÿ˜„

thick karma
#

(because calling player objects "player" in some contexts and calling the player index "player" in other contexts is whatever the opposite of smart is.)

thick karma
#

I knew player was 0 because of this:
local playerObj = getSpecificPlayer(player)

#

This is how the game received a 0 for player and turns it into an object sometimes

#

When they don't use
local player = getSpecificPlayer(playerIndex)

#

(the latter of which I greatly prefer)

#

Using "player" as a name for an index just looks bad to me and seems counterintuitive.

#

Come to think of it

#

Your CraftAction probably requires a player object.

#

yes it does

#

ISCraftAction uses character which more consistently expects an object in vanilla

#

Not an index

#

Therefore you need getSpecificPlayer(player) as part of your call, or you need to rename player as playerIndex and use local player = getSpecificPlayer(playerIndex) and use player from then on.

drifting ore
#

okay restarting again now and trying to see if it prints other stuff

fast galleon
thick karma
#

So I'm thinking this:

function Recipe.OnCreate.Switch(items, result, playerIndex)
    local switchSpeed = SandboxVars.Nipswitch.Craftspeed
    local player = getSpecificPlayer(playerIndex)
    local action = SwitchCraftAction:new(player, items [[???]], switchSpeed - 1, result [[???]], container, containers)
    
    ISTimedActionQueue.add(action)

    player:getAnimNode("Disassemble")
    player:setProp1("Screwdriver")
    player:setProp2("lighting_indoor_01_0")
    player:getEmitter():playSound("VehicleHotwireStart")
end
#

Something like that

#

but you need to figure out some deets there

#

Obv

#

What is container, what is containers, if they are even necessary

#

Is result the recipe

#

etc.

drifting ore
#

no error

#

no stack trace at least

thick karma
#

Oops fixed player above

#

Meant to do that

thick karma
#

The function never gets called

#

Idk how to properly link a recipe to an onCreate function

#

Someone else may know that step

#

Never done that.

drifting ore
#

hmmm

thick karma
#

I would imagine you would just type the proper name of the function if it's global

ancient grail
#

Huh? Just copy the vanila oncreate code

thick karma
#

@drifting ore Is your Recipe module local?

#

That might be the problem

drifting ore
#

this is all within my mod

#

im using base module

#

no import just calling Base

thick karma
#

Yes and how is Recipe declared in your Lua?

#

You created this function, right?

function Recipe.OnCreate.Switch(items, result, playerIndex)
#

This function is inside a module named Recipe

#

How is that module defined?

#

Are you using a vanilla module?

drifting ore
#

here

#
function Recipe.OnCreate.Switch(items, result, player_num)
    local switchSpeed = SandboxVars.Nipswitch.Craftspeed
    local player = getSpecificPlayer(player_num)
    SwitchCraftAction = ISCraftAction:derive("SwitchCraftAction")
    --SwitchCraftAction:new(player, result, switchSpeed, Recipe.Switch, nil, nil)



local switchCraftAction = SwitchCraftAction:new(player, result, switchSpeed, items, nil, nil)
    player:getAnimNode("Disassemble")
    player:setProp1("Screwdriver")
    player:setProp2("lighting_indoor_01_0")
    player:getEmitter():playSound("VehicleHotwireStart")
    local player = ...
    local result = ...
    local switchSpeed = ...
    local Recipe = ...
    print("Player:", player)
print("Result:", result)
print("Switch Speed:", switchSpeed)
print("Recipe:", Recipe.Switch)
print("Switch Craft Action:", switchCraftAction)
end
#

i can also just delete the nil completely in theory? iu understand if it comes before i may need it to call nil, but after?

#

this is called here btw

#
module Base
{

    recipe Right Light Switch {
        keep Screwdriver,
        keep Wrench,
        keep Scissors,
        Wire=10,
        ElectronicsScrap=25,
        DuctTape=4,
        Screws=10,
        Prop1:Screwdriver,
        Prop2:lighting_indoor_01_0,
        NoBrokenItems:true,
        AllowOnlyOne:true,
        OnGiveXP:Recipe.OnGiveXP.DismantleElectronics,
        AnimNode:Disassemble,
        Sound:VehicleHotwireStart,
        OnCreate:Recipe.OnCreate.Switch,
        Result:lighting_indoor_01_0,
        CanBeDoneFromFloor:TRUE,
        NeedToBeLearn:true,
        Time:1.0,
        Category:Electrical,
    }
        recipe Left Light Switch {
        keep Screwdriver,
        keep Wrench,
        keep Scissors,
        Wire=10,
        ElectronicsScrap=25,
        DuctTape=4,
        Screws=10,
        Prop1:Screwdriver,
        Prop2:lighting_indoor_01_0,
        NoBrokenItems:true,
        AllowOnlyOne:true,
        OnGiveXP:Recipe.OnGiveXP.DismantleElectronics,
        AnimNode:Disassemble,
        Sound:VehicleHotwireStart,
        OnCreate:Recipe.OnCreate.Switch,
        Result:lighting_indoor_01_4,
        CanBeDoneFromFloor:TRUE,
        NeedToBeLearn:true,
        Time:1.0,
        Category:Electrical,
    }
}
thick karma
drifting ore
drifting ore
thick karma
#

But if they are assumed to exist, they may call functions on themselves

#

And if they are assumed to exist in the action code and do call functions on themselves

#

But you didn't provide them

#

Your computer will actually burst into flames

#

That's what really happens, it's science.

drifting ore
#

okay going to try this then

function Recipe.OnCreate.Switch(items, result, player_num)
    local switchSpeed = SandboxVars.Nipswitch.Craftspeed
    local player = getSpecificPlayer(player_num)
    SwitchCraftAction = ISCraftAction:derive("SwitchCraftAction")
    --SwitchCraftAction:new(player, result, switchSpeed, Recipe.Switch, nil, nil)



local SwitchCraftAction = SwitchCraftAction:new(player, result, switchSpeed)
    player:getAnimNode("Disassemble")
    player:setProp1("Screwdriver")
    player:setProp2("lighting_indoor_01_0")
    player:getEmitter():playSound("VehicleHotwireStart")
    local playerr = ...
    local resultt = ...
    local switchSpeedd = ...
print("Player:", playerr)
print("Result:", resultt)
print("Switch Speed:", switchSpeedd)
end
#

i had capital letter issue

#

think that might be why it didnt call the function...

thick karma
#

Hahahaha no no no

#

Oh dear

#

Give me a second to help clarify something

drifting ore
#

i fixed those prints also since i fixed them on my end also

#

so not keep calling same loca

thick karma
#

THIS line is used to create an object class, which is a class that gets used to create instances of objects.

#

When you have an object class, you use it to create instances of objects that inherit the features of that defined class.

drifting ore
#

i thought i was deriving so it would use it's own

thick karma
#

So if you have Dog = Animal:derive("Dog"), then Dog acquires the characteristics of an animal, but neither Dog nor Animal refers to a SPECIFIC dog or animal

#

They refer to the TYPE of thing and the characteristics that such a thing would need to define

#

So SwitchCraftAction = ISCraftAction:derive("SwitchCraftAction") creates a TYPE of a thing called a SwitchCraftAction

#

It does NOT create the thing itself.

#

It does NOT create the action you need in the Queue.

rancid panther
#

is there a particular reason why mods have trouble with audio falloff range? it seems like the audio is at full volume no matter how far you are from the action

thick karma
#

When you WANT such a thing (an action for the Queue), you need to do something like:

local switchCraftActionThatINeedToQueue = SwitchCraftAction:new(player, result, switchSpeed)
drifting ore
#

i dont think audio falloff is implemented in all or many things

#

omg

#

i see what you mean

rancid panther
thick karma
#

This creates the action of the appropriate type.

drifting ore
#

so i have to use it how it's designed no matter how it's being used/called

#

argh lol okay well i guess there are a couple concepts i'm sturggling on picking up

#

and these are the things i've spent the most time researching

thick karma
#

It is not trivial. People are given months or a year to digest these fundamentals in school.

#

But you do need to internalize it to use TimedActions correctly.

#

As they are heavily OOP

#

(In fact this game's Lua is heavily object-oriented)

#

So knowing your classes from your instances is crucial

thick karma
# drifting ore i dont think audio falloff is implemented in all or many things

Generally speaking the game does respect the standard of using camelCase for instances. This is reflected e.g. in ISTradingUI.instance, ISSafehouseUI.instance, ISFactionUI.instance, etc. The classes containing the instance objects above (which are sometimes called object classes because they're used to make objects, as opposed to a static class which is just accessed directly as a library of functions) is PascalCase, but the instance itself is camelCase.

drifting ore
#

so the object is the instance of class and the class is like what tells it how it's going to work?

thick karma
#

Yes

#

And "object class" really just means "class", but the kind used for making objects.

#

Hopefully one of these ways I've said it is clear... Haha

drifting ore
#

yes. i may not grasp every single thing you are stating here. but i assure you while im doing more research and learning, i will reference back to this stuff and lightbulbs will happen

#

i do get a majority though

thick karma
#

Putting the instance of an object class IN an object class is pretty unusual practice in OOP though, just FYI... the game sort of has a hybrid approach here, where the classes used to make objects also provide static references to the last object they made sometimes.

drifting ore
#

been struggling finding a good source of knowledge that isn't the lua handbook since it still feels like the subtle difference in just standard apis and usage. i just dove right in

thick karma
#

Also, I think Zomboid Lua is pretty heavily influenced by Java practices, soooo there's that to consider.

#

It's a unique context so I wouldn't really expect it to 100% generalize.

drifting ore
#

yea i noticed i can call java functions and variables straight from lua

#

still wrapping my mind around how this works exactly also. keep in mind.. (hate to be that guy also) but i hadn't typed a string of code until around a month ago. so even little things that help me understand are appreciated

thick karma
#

Yes. You will also notice that the java functions (that are written by people who knew what they were doing) are all camelCase because Java has very clear, publicly declared standards on that.

#

Unlike Lua, which is a bit of a cluster because it hasn't even told people whether to write simple variables in snake_case or camelCase.

#

Let alone all the other standards it would be wise to declare.

jaunty marten
#

snake_case moon_kittylove

thick karma
#

You will see a lot of Lua floating around the internet that DOES favor snake_case @drifting ore, however, I would strongly discourage it in this context, because you're literally fighting the standards of the game and sowing confusion and inconsistency in new people who follow your code by doing so.

drifting ore
#

I try my best to be consistent

thick karma
#

Being a Java-based game, Java standards are the most logical standard on which to base your decisions, since, again, Lua has no standards for this.

#

And reflecting that obvious conclusion, most game files work that way