#mod_development

1 messages · Page 242 of 1

warm plover
#

okay, cool

agile lily
#

Huh, how come?

warm plover
#

this

#

{true} =/= true

bright fog
#

No that's not the problem

warm plover
#

it isn't?

bright fog
#

He fixed that a while ago, he no longer sends the table but the boolean

livid badger
#

yo guys what about talking?)

agile lily
#

Am I not simply passing a boolean to the function?

#

Yeah, I got rid of the table

#

What more is causing it to not work? :O

warm plover
bright fog
#

Let me write you something that fixes your entire thing bcs shit's stressing me out lmao

agile lily
#

Oooooh, I didn't catch that, but that's true

agile lily
#

But it's very fun once whatever you're making actual works

bright fog
#

yeah np, got to start somewhere

livid badger
#

and it’s even more fun when after updating the mod the game stops starting and the error in the debug clearly does not indicate the line))

bright fog
#

You want to have the rain toggle on and off ?

agile lily
#

Eventually once I wise up I'd like the server to be able to schedule different rain events, my reasoning behind doing it this way is that once my custom rain event starts it will toggle the damage the player takes from rain on/off. Without the toggle the player gets damaged by all rain

bright fog
#

You can do something cleaner with a cleaner base like this

#

There's most likely a few things here and there to clean

#

But this should teach you on or two things

split pagoda
#

ello, does anyone know where to find definitions or stats for containers? Not bags but like furniture such as fridges?

agile lily
agile lily
#

Or am I mistunderstanding how it works

bright fog
#

if not isServer() then return end

#

Here

agile lily
#

I was just going to ask what the "not" operator was haha

bright fog
#

Something to know:
Servers load:

  1. /shared
  2. /server

Clients load:

  1. /shared
  2. /server
  3. /client
agile lily
#

On an unrelated note, what are your opinions regarding easter eggs in other people's mods?
Does it tick you off if you see something in the mod that's not clearly stated to be included?

bright fog
#

It's okay, depends what the easter egg is

agile lily
#

I want to add picture frames with picturess of my cats in them

bright fog
#

If it's like "Ahah you went to coordinate x y z so now you are infected", uh no

agile lily
#

"portrait of a strange beast"

#

Or something

bright fog
#

I don't think that has ever been done but it would be very funny

#

The best example is Trellai which has easter eggs everywhere on its map

agile lily
#

I love it when you find things like that in games, going out of bounds just to see a picture of one of the developer's pets

bright fog
#

Yea

agile lily
#

I remember a map for counter strike: source (i think?) that spawned a .png of a cat which then starts shooting lasers from it's eyes and destroying the map

bright fog
#

👀

livid badger
#

Guys, maybe you know a command on how I can create a tree in a square?

bright fog
#

@robust briar

livid badger
#

Then I should watch the video on YouTube)) thx

#

It seemed to me that there was a Lua method for creating a tree.(

robust briar
#

You can add a tree with lua, but it wont' follow the normal seasons or grow anymore

#

to add a tree which will lose its leaves and keep growing, you have to use a java-mod

bright fog
#

Good to know, I didn't remember the specifics

livid badger
robust briar
#

Then just place the tiles

#

no need for lua or anything

#

you can just do that with the brush tool

livid badger
#

? how XD

#

I probably wrote it incorrectly) it’s clear how to add this in the map editor, I was talking about the spawning of a tree after the harvest has died.

vestal gyro
gleaming sorrel
#

I get

bright fog
#

Wdym you get ?

gleaming sorrel
#

As the link code

bright fog
#

imgur doesn't make the diff between images and videos

#

Use what I wrote

#
[video mp4=https://i.imgur.com/bwmq1nd.mp4[/img][/video]
#

With your link

#

You get this

gleaming sorrel
#

I have no idea what that even is

bright fog
#

Just paste this shit in your Steam page

#

-Official link formatting guide
https://steamcommunity.com/comment/Recommendation/formattinghelp

-A very neat guide that shows available BBCode tags and with some detail behind them
https://steamcommunity.com/sharedfiles/filedetails/?id=2807121939

-Guide demonstrating some of the BBCode elsewhere than the Workshop
https://steamcommunity.com/sharedfiles/filedetails/?id=812684948

-A website to do Steam markdown in real time, useful to test your modpage presentation
https://bijx.github.io/Steam-Markup-Generator/

List of all markup (BBCode) tags on Steam, where they can be used, their parameters and issues surrounding them....

A quick guide showing you how to embed images in the description of an artwork, screenshot, or workshop.

https://i.imgur.com/9fPcS0L.png ...

#

Go check out my tutorial on Steam pages and what you can do

gleaming sorrel
#

I'll do that

bright fog
#

Example in my steam page

#

just to verify it works

gleaming sorrel
bright fog
#

Yea basically

gleaming sorrel
#

I'll read the tutorial so I can figure out how to get a link like that, for future stuff

bright fog
#

👌

#

I haven't detailed in the guide how the link I believe

#

For Github like I explained it's a bit tricky

#

But once you know how it's easy

#

I need to get the raw link

#

But if you click "View raw" it downloads the mod depending on your browser

#

So what you do is

right click "View raw"
inspect element
you should see the raw link in the source code of the webpage

hearty gulch
#

how do you properly delete an item? I have a condition if it spawns a ranged weapon I remove it.

bright fog
bright fog
hearty gulch
#

So how would I approach this if its a world placed Item?

bright fog
#

Access the ItemContainer then use Remove(InventoryItem)

bright fog
#

There's a way to access it I believe but can't remember how

neon bronze
#

You get the square and then iter through all the objects on it then find the object that has the item in its container and then remove it

#

I believe thats how it works

#

If its an item in the world poaced

bright fog
hearty gulch
#

Something akin to t his?

neon bronze
bright fog
neon bronze
#

But i thibk thats how i used to remove stuff ik the world

bright fog
#

Wait stop all of this shit

#

You have the item ?

#

_item is your item ?

neon bronze
#

Oh yea just get kts parent container

bright fog
#

Then you don't need to do any of that

hearty gulch
#

Ah yes my bad yes :Remove(itemSpawned) but otherwise its fine?

neon bronze
#

And then remove from it

bright fog
#

I'm not sure which method you need to use, getContainer() maybe ?

hearty gulch
neon bronze
#

:getParentContainer() i believe exists

bright fog
#

In InventoryItem

neon bronze
#

Man im off with my references today

bright fog
#

lol

#

Happens

#

I'm not too familiar with items either so eh

hearty gulch
#

or could I do item:getOuterMostContainer:Remove(item)?

bright fog
#

Something like that

#

But I'm not sure what you need to use to access the container the item is in

hearty gulch
#

getRightClickContainer()?

#

They are both of type ItemContainer

wet sandal
#

Yea, item:getContainer() returns the container the item is currently inside of

#

getOuterMostContainer() is for getting the root container in a situation where you have a bag in a bag in a bag in a...

hearty gulch
#

Hmm getting a attempted index: Remove of non-table: null error

#

Oh pff wait, I need to remove the setcondition method haha.

wet sandal
#

An item doesn't necessarily have to be in a container

#

So container could be nil

hearty gulch
#

Well this is the StoryItemSpawner mod so it only spawns in the world so it should always have a world square to be in right?

#

Since I use brita's mod and it handles its own distro, StoryItemSpawner it spawns way to many guns even with extremely rare 0.05x loot. So I just check if its a gun when it spawns an item and remove it. That's the idea.

neon bronze
#

Does tbe item spawn in the world and not in containers?

wet sandal
#

I gotta double check some code, but when an item is on the floor, instead of being in a container it has a IsoWorldInventoryObject

#

You can get that with item:getWorldItem()

hearty gulch
#

and then call :removeFromSquare() or :removeFromWorld()? Weird thing is that It did seem to work, no guns no errors. but I'll check again.

wet sandal
#

Here's a snippet from the InventoryTransferActions

#

Its a bit overcomplicated it seems

#
    elseif self.srcContainer:getType()=="floor" and self.item:getWorldItem() ~= nil then
        if instanceof(self.item, "Radio") then
            local square = self.item:getWorldItem():getSquare()
            local _obj = nil
            for i=0, square:getObjects():size()-1 do
                local tObj = square:getObjects():get(i)
                if instanceof(tObj, "IsoRadio") then
                    if tObj:getModData().RadioItemID == self.item:getID() then
                        _obj = tObj
                        break
                    end
                end
            end
            if _obj ~= nil then
                local deviceData = _obj:getDeviceData();
                if deviceData then
                    self.item:setDeviceData(deviceData);
                end
                square:transmitRemoveItemFromSquare(_obj)
                square:RecalcProperties();
                square:RecalcAllWithNeighbours(true);
            end
        end
    
        self.item:getWorldItem():getSquare():transmitRemoveItemFromSquare(self.item:getWorldItem());
        self.item:getWorldItem():getSquare():removeWorldObject(self.item:getWorldItem());
        --        self.item:getWorldItem():getSquare():getObjects():remove(self.item:getWorldItem());
        self.item:setWorldItem(nil);
        self.destContainer:AddItem(self.item);
    else
#

We can assume we're not dealing with a radio, so I guess you just need:

#
self.item:getWorldItem():getSquare():transmitRemoveItemFromSquare(self.item:getWorldItem());
self.item:getWorldItem():getSquare():removeWorldObject(self.item:getWorldItem());
self.item:setWorldItem(nil);
self.destContainer:AddItem(self.item);
neon bronze
#

He doesnt need the self.destContainer bit since i believe he just wants to remove them from the world

hearty gulch
#

true yeah no destination

#
    if _item:IsWeapon() then
        if _item:isRanged() then
            _item:getWorldItem():getSquare():transmitRemoveItemFromSquare(self.item:getWorldItem());
            _item:getWorldItem():getSquare():removeWorldObject(self.item:getWorldItem());
            _item:setWorldItem(nil);
        else
            if ZombRand(10) >= SandboxVars.WeaponLoot then
                _item:setCondition(ZombRand(1, ZombRand(SandboxVars.WeaponLoot+1,  math.max(_item:getConditionMax(), SandboxVars.WeaponLoot+1))));
            end
        end
    end
#

So this then?

wet sandal
#

You need to change the self.items to _item

hearty gulch
#

Ah true, how do I display code in discord like you btw?

wet sandal
#

'''LANGAUGENAME
code
'''

#

Yea, you got it

hearty gulch
#

Ah yes, forgot i had to make a new line.

#

Does loading a save with a new mod reload the lua for the whole game, or do I have to restart it to see the effect?

wet sandal
#

Probably wouldn't hurt to nil check the worldItem before trying to remove it

#

Quitting to the main menu then loading a saves tends to work for 99% of stuff in my experience

hearty gulch
#

if _item:getWorldItem() != nil;

#

like this?

wet sandal
#

yea

hearty gulch
#

Alright, most of my errors with the syntax comes from me using C# out of habit.

wet sandal
#

~= nil

#

lua is special like that

#

lua will also cast to bools automatically when you check objects, so you can shorthand it to
if _item:getWorldItem() then

hearty gulch
#

Gotcha, I personally like having everything typed out. I don't like soft typed languages for that reason

#

is then needed?

wet sandal
#

ye

hearty gulch
#

Gotcha, and do ; make any issues at the end of the line? I just realised I added them everywhere out of habit

#
    if _item:IsWeapon() then
        if _item:isRanged() then
            if _item:getWorldItem() ~= nil then
                _item:getWorldItem():getSquare():transmitRemoveItemFromSquare(_item:getWorldItem());
                _item:getWorldItem():getSquare():removeWorldObject(_item:getWorldItem());
                _item:setWorldItem(nil);
            end -- I guess end is mandatory?
        else
            if ZombRand(10) >= SandboxVars.WeaponLoot then
                _item:setCondition(ZombRand(1, ZombRand(SandboxVars.WeaponLoot+1,  math.max(_item:getConditionMax(), SandboxVars.WeaponLoot+1))));
            end
        end
    end

wet sandal
#

My mods are riddled with ; lines ends

#

So, I'd say they're safe to add

vestal gyro
#

why cant I change the mod ID

#

there is no "is this an existing or new item" popup

bright fog
vestal gyro
#

thanks

hearty gulch
red tiger
#

Alright. This is wild. I'm surprised that joypad and joypad-data are packaged on the Lua-side.

#

IMO seems like a needless "re-invent the wheel" solution.

#

shared/joypad/JoypadSetup.lua#JoypadControllerData

#

Initially this code looks like it should be raised to Java. The engine looks like it already had constructs for this solution which confuses me as to why it's managed on the Lua-end.

#

Thanks again for pointing out the nuance of those method-definitions in sub-classes to ISUIElement @wet sandal

#

Looks like the next definitions / documentation I'll need to write are Joypad.

thick karma
#

@wet sandal Alright I got a few more minutes and decided to jump in and check stuff out. I have a few immediate observations. First, this bug, which seems to have fairly obvious origins:

#

Second I am not sure how I am supposed to open the context menu but you have rebound our context menu button, which is among the most important buttons that we are used to using. I'm not sure about that decision, personally.

#

Rebinding the context menu button to some unknown button led me to try Circle and immediately fire that bug

#

Your right-bumper loop reliably fires this error when I hit bottom of inventory and it tries looping back to the top; could be an interaction with Proximity Inventory.

#

Opening context with Circle feels pretty subjectively bad to me since that's normally the button for closing it, and it no longer works for that.

#

Once I push past errors I do see you rebound X to Circle. I really wouldn't unless it's optional. Feels bad from perspective of longtime gamepad player.

#

There is no way to close context menu once it's open. I can move items around while context menu is open.

#

Also none of our QoL shortcuts work anymore. Gamepad players cannot sort, cannot use Start for double-click functionality (which used to let us quick equip / eat / drink / use)... also bumper functionality feels very wrong to me subjectively because you're overriding the bumper accessibility settings that I explicitly chose from the vanilla menu.

#

I use R1/L1 to move up and down containers on one side of my panels; I use left and right to switch between panels

#

It's a vanilla option and it's broken badly with this mod on.

#

Yeah, my key takeaways here are:

  1. Don't change major bindings in a way that will be counterintuitive by e.g. making standard cancel buttons into activate buttons. I would only offer such drastic changes optionally.
  2. Don't break any useful vanilla accessibility functions like swapping between containers using bumpers.
  3. Familiarize yourself with many inventory management advantages of Wookiee Gamepad Support so you know when useful features break and why. A lot of the breakage could surely be prevented.
    @wet sandal ❤️
spring ivy
#

Hello, not sure this is the place to ask, but I was hoping to commission the Jin Roh Armor for a PZ mod.

Deleted OG message so not to break up the previous message

past radish
#

Health Overhaul mod WIP

bright fog
patent holly
#

Does anyone know where I might find the code behind Hemophobic's bloody clothes/body check? Just tryin to find some actual numbers on it.

spring ivy
bright fog
#

👌

wet sandal
#

I get what you mean about the button mappings, but at the same time with Tetris, pickup, drop, and rotate become important controls that need to be really natural to access.

I'll probably just add full control rebinding options.

thick karma
#

Changing button there was just not necessary.

#

Rotate is going to most likely need to be a hold press situation.

#

Alternatively it could be a toggle on any given item to minimize need for bindings.

#

I think letting people rotate WHILE moving after activation with Circle would make more sense

wet sandal
#

That's how it is right now,

#

Left face button, only while held

thick karma
#

No, activation of movement is with X

#

Or A

#

I'm saying activate movement with Circle since circle became unbound when stacking and unstacking shortcut stopped making sense.

wet sandal
#

Swapping pickup over to right face button is the main thing I suppose.

Otherwise, I think the errors you're getting are messing up my intended controls

thick karma
#

Unless that was hiding somewhere?

#

Fair. Don't forget the R/L thing. Kind of a big deal. Anybody who has found that setting isn't going to want to go back to the old way lightly.

#

It'll be a sure source of disappointment to anyone who knows

#

Looping through 5 or 10 bags instead of being able to go up and down is just bad

#

I guess you may not try to accommodate mods like ExtraSauce Sac but again those are a huge deal for us. Saves a ton of time on nonsense clicking.

wet sandal
#

Ignoring Tetris, do you Equipment UI is good to go?

thick karma
#

I'll check it out more. I was kind of analyzing them together.

#

hadn't even run them separately

wet sandal
#

Ah fair

thick karma
#

I will try Equipment UI alone

wet sandal
#

I was running equipment UI alone mostly since the ControllerNode class lives there when fixing the errors you shared earlier

thick karma
#

And see how it plays with everything else

wet sandal
#

Maybe I messed up Tetris then

thick karma
#

It seems less nuclear at a glance so I'm optimistic.

#

Switching focus off the UI with a single button is much less complicated an overhaul obv

#

That shouldn't need to break anything really

wet sandal
#

Anyways, just wanna say. I really appreciate the feedback and testing. I want this controller support to go smooth and this is a huge help!

thick karma
#

Breaking some things in IT is likely inevitable

#

That's to be understood

#

But I think important ones like tabbing both directions through containers and shortcuts like Sort and Double-Click on gamepad should be preserved

#

In fact all context-menu based functions should be preserved... not sure why item context menu related functionality should ever need to break... You got the item and the player object, all should go fine.

#

I am resubbing to mods so give me a few to get back to you about EUI

#

I cleared out 1777 mods today and am dropping back down to what i actually use

#

lol mod support really adds up

#

I'll update you further ASAP

red tiger
#

@wet sandal I spent this afternoon working on fleshing out documentation for the JoyPad folders.

agile lily
vestal gyro
#

Looks great as a WIP tho!

sonic ibex
#

How realistic would a Zipline mod be? I feel like it's not too unlikely that survivors might make a system for travelling without going to the streets

frank elbow
#

Rule of cool trumps all

thick karma
#

If it's cool and you can make it happen, you must do it.

#

And zips would be cool

frank elbow
#

I didn't realize until after I sent that that “realistic” probably meant “feasible” 😅

sonic ibex
#

I guess it would share mechanics with sheet ropes but going horizontal instead

#

No it meant realistic 😂 like would that be a thing in an apocalypse. I think yes.

frank elbow
#

Oh, then yeah I could see it

thick karma
#

Maybe. Might need to be pretty entirely new. I don't know if the rope climbing mechanic could be repurposed for sliding animations. I think it involves calling a Java function or two iirc

thick karma
#

Also changed some tile flags to allow things to be rope-climbed

#

I'm unsure how you would be able to prevent gravity effects otherwise. Game would presumably be strongly inclined to see you as falling

#

But then again there is a flying mod

#

So just do that and land under a rope I guess

sonic ibex
#

Hmm yeah if there is a flying one, could be a good place to start

thick karma
#

I looked around but I'm not sure if they ever published it

#

But it was 100% proof of concept

#

For your goal

#

@drifting ore

#

Had to type mentions and colon and click the word to start entering your username fyi

drifting ore
#

Ooo

#

Just seen this

#

Okay thanks

#

I hate how my name looks on your phone haha

#

It’s not as perfect lol

thick karma
#

Even profile text is that way

ancient grail
thick karma
#

Guessing she's on an iPhone

#

Usually explains basic miscommunication of simple things like fonts and emojis and such

ancient grail
#

most likely

drifting ore
#

Yes I’m on iPhone.

drifting ore
thick karma
small topaz
#

Hi! When updating a mod, is it possible to only change the
require=
field in the mod.info file? Or is this not possible for an already existing mod on the workshop?

bronze yoke
#

it's possible but it's a bad idea if you can avoid it

#

removing a dependency is fine but adding one is going to cause problems for current users who don't have the new dependency

small topaz
bronze yoke
#

should be fine to my knowledge

small topaz
#

hmmm... then the new modder is doing smth wrong which I don't know about. for me, just updating the mod info file always works too

#

or any experiences that an update might take very long until it is registered in the steam workshop?

small topaz
#

ok... update worked now.

Problem is that the steam workshop page does not correctly show the required mod in the side panel. Is there any thing more beside setting the require= field in the mod.info file you have to do for making this work?

coral lava
#

Really big shot in the dark here, but is there a way to automate a ban based on certain conditions in MP servers? (Through programming)

I'm Trying to make it so if players reach 0 in either strength or fitness, they will be banned and required to make a new character.

mellow frigate
coral lava
mellow frigate
coral lava
coral lava
#
Events.OnNewGame.Add(KickPlayerFnS)

function KickPlayerFnS(player)
    local fitness = self.char:getXp():getLevel(Fitness) >= 1
    local strength = self.char:getXp():getLevel(Strength) >= 1
    
    if fitness == 0 or strength == 0 then
        self.char:ban("Your Character is too weak to survive, please make a ticket for a new character or to appeal a character revive.")
    end
end
bright fog
#

You need to add the function to the event after creating such function

coral lava
#

Okay thank you! That's definitely the place i fucked up lmao

thick karma
#

There's a separate button on Steam page

minor arch
#

hey i'm very new to project zomboid and am not really sure if this is the place to ask for beginner modding help but i've been struggling to understand the documentations

i wanted to make a mod that adds a craftable poster from a game a friend of mine made as sort of a random surprise to her

i already have a ".pack" file with the asset but i'm not really sure where to go from there 😅

frank elbow
#

I don't think there's a way to specify dependencies in workshop.txt. There very well may be & I'm just not aware of it. But the user who uploaded it can add requirements of other workshop items from the workshop page

frank elbow
small topaz
sonic ibex
#

Are there any mods that let you scan for radio frequencies? Like move a dial until you hear something?

thick karma
#

@wet sandal New info and questions. First info:

#

This error suggests that even though it went through a branch that should have defined menu as something, menu had no definition on line 1399. Perhaps createMenu did not return its normal result?

#

Question: How do I see the Equipment UI on gamepad? I can't actually figure out how to make it show up. I've only thrown this error lol. But most of the UI still works normally with EQUI on (bumper container switching works, sorting shortcut works, quick item actions work).

#

And this happened when I went to quit game:

#

(could not recommend debug more strongly... and WGS almost as strongly [though these don't seem to involve any conflict, it's still better to spot them early if they do arise])

#

Final trace:

#

Let me know how to actually use the UI as intended when you get this

wet sandal
#

You've got one heck of a mod conflict going on because I get none of the errors you're showing

wet sandal
drifting ore
#

@thick karma may I message you?

thick karma
#

I can probably find a way to make it work together, I'll look at your code to figure out where you fire the select press

thick karma
viral spire
#

I'll just post this in one post so I'm not making multiple comments:

Either looking for or suggesting four mods/ideas:

  • Submod of Expanded Helicopter Events that add Zombrex drops. Some added customizable options include specific amount of days between drops, how much Zombrex is dropped, and whether or not these drops eventually stop coming like other heli-events (this would make surviving bites impossible long-term). Other options would be to make them incredibly rare, practically a miracle, following the collapse. Mod idea like this is based off supply drops in Dying Light where they drop Antizin.

  • Mod where zombies totally ignore you. Think Ghost Mode from debug menu, except you can still make noise such as shoot guns, shout, step on class, among other things. You can still do everything normally, just that the zombies ignore you completely. A customizable option in the sandbox menu would allow them to essentially be "drawn" to your general area. Similar to One of Us by BitBraven, the zombies would chase you up to a certain point and then stop, so they'll always be around you. Even if you get up close to them, they'll never attack you because they don't care about you. On its own, a mod like this is pretty pointless though funny, but it would be designed to be coupled with mods such as Susceptible, adding a lingering threat. While the zombies don't acknowledge you and therefore won't directly attack you, they can still infect you through the air.

  • Mod that adds UV lights that repel zombies, similar to UV lights in Dying Light. There are already mods that alter zombie behavior depending on the time of day. When UV lights are added, zombies will not enter a specific radius around them. However, there is a 5% chance that a zombie may be/become resistant to the UV light's effets and directly attack the lights/generators to shut them off. In spite of that, these lights would help provide open safe-zones, or just safer zones.

viral spire
#
  • Mod utilizing mods like Hazardous Zones or Radiated Zones that add Radiation Storms, similar to those in Fallout 4. These are their own weather systems that are either powerful windstorms or powerful rainstorms with a greenish hue. There are three levels of radstorms depending on if rain or simply windy fog:
#
  • Level 1 storms are low in threat; light rain, decent radiation dosage. If rain, hazmat keeps you 100% safe. If fog, gas mask only needed. Lasts around 24-48 hours. Brightness is light.
#
  • Level 2 storms are moderate-to-severe; medium-to-heavy rain, moderate-to-severe radiation dosage. If rain, hazmat keeps you 100% safe, but may take periodic minimal damage when outside. If fog, gas mask only needed, but your mask may take periodic damage when outside. Lasts around 24-72 hours. Brightness is dim, cloudy skies.
#
  • Level 3 storms are severe; heavy rain, akin to peak tropical rainstorms/blizzards in winter, heavy radiation dosage. If rain, hazmat will take further periodic damage. If fog, hazmat suit is needed, will still take periodic damage. Lasts around 24-96 hours. Brightness is dim, akin to heavy storms.

All durations customizable.

#

BLACK STORMS are "hell-on-earth", no level tier needed. Heaviest rain, hurricane force winds, can break windows. Deadly radiation dosage within minutes, maybe even less. Gas mask will not protect you. Hazmat suit only, will take heavy periodic damage when outside, halved when inside. They are the shortest-lasting storms, anywhere between 12-24 hours; also customizable duration. Brightness is almost pitch-black, as dark as pitch-black nights.

#

To protect yourself while indoors without proper clothing, you'll need to cover windows and doors with either plastic sheeting and duct tape or metal sheeting. Metal sheeting is more effective. Only metal sheeting will protect you during Black Storms.

If using Basements mod, basements and other structures will protect you 100%. Just be stocked up!

  • Storms will be announced via EBS similar to normal weather systems. You'll have anywhere between 2-5 days to prepare. However, BLACK STORMS will appear anywhere between 2-7 days after announcement:

"WARNING: DEADLY RADIOLOGICAL EVENT DETECTED. ETA, 3 DAYS. TAKE SHELTER."

viral spire
#

😄

thick karma
#

@wet sandal Did you actually test Quit to Desktop after opening and closing player inventory with debug mode on?

#

Because I just did it with none of my own mods that remotely touch inventory in any way (even disabled Proximity Inventory and other highly popular stuff that isn't mine which personally is not how I would test or recommend testing), and this error still fires for me, and the error strongly implies that your mod is the only relevant mod:

#

I would say there is a 99.9% chance your mod causes this. I have not looked deeply at the others yet.

#

That said, the select functionality DID work with everything else disabled and I WAS able to navigate and activate context menu on items in the Equipment UI, so good job on that front

#

That said, I do have some recommendations on that front.

bright fog
#

Poor Not getting absolutely bullied lmao

thick karma
#

Awwww ❤️

bright fog
#

Have you even received a single answer from him ?

thick karma
#

Not meant to sound that way

#

Yes Not is responsive!

#

Notloc has been very responsive

#

He's just busy right now

bright fog
#

Bcs I keep seeing you message him but never his answers hahalol

thick karma
#

Well I have more to say about it than he does lol

bright fog
#

(also why do you not dm him about these ?)

thick karma
#

He is currently developing and he is not aware yet of the things I'm bringing to his attention

thick karma
#

I generally discuss modding in the open for lurkers who are learning if nobody has a preference.

#

But I will happily take this to DM's if anyone wants me to do so.

bright fog
#

ngl probably no one understands shit of your reports but Not himself BrainlessBriar

thick karma
#

Lmao probably not.

#

But

#

Someone might

#

There are some people who do, definitely.

#

But yeah a lot of people are just scratching heads or tuning out I'm sure.

thick karma
# thick karma That *said*, I do have some recommendations on that front.

@wet sandal If I were you, I would strongly reconsider the binding, as I mentioned, is overwriting something many of us (gamepad users) have found useful for a long time, so destroying that without replacing it is undesirable.

~~On that train of thought, D-Out (Left from Inventory or Right from Loot) is a much more available shortcut, and sort of makes intuitive sense for opening a panel outside of inventory... currently it is just a secondary way to get to the other panel (when in inventory, right goes to the loot panel [which is right of inventory by default], but left loops to the loot panel as well). ~~ On second thought, I don't love this idea either because some weirdos might like moving inventory and loot in such a way that they are used to a different right-left relationship between those tabs. L3 (Left Stick Click) is available, and that seems like a way better choice.

Alternatively you could design a trigger-activated shortcut.

thick karma
#

@wet sandal Another thing to consider:

#

Gamepad players like moving their UIs too and have been doing so via mods like WGS for years.

#

By forcing panel rearrangement to show their UI, you are complicating showing your UI without a conflict.

#

In this case, Loot begins left-aligned and your trigger moves it.

#

Then it becomes like this when it's gone:

#

If you're going to move those panels, you should save both of their initial positions and sizes and revert to their original states when you're done

#

On the bright side, EQUI has not yet done anything to prevent panel positions from saving correctly; the save-UI-position functionality added by WGS for gamepad players still works, but opening EQUI messes it up.

#

Alternatively, to make life much easier for yourself, you could not move those panels and just draw panel centered on top of them.

#

I would say going halfway on this endeavor (moving them but without doing anything to ensure those moves will be compatible with other mods) is worse than not doing it at all.

#

Seeing the panel on top of the UIs would not bother anyone... having UI's relocate and messed up by the panel stands to bother many.

#

@wet sandal (Sorry for double-ping, dropped messages in #mod_support like a scrub.) Also, fwiw, I have confirmed that L3 is fully unbound and available with my mods running for opening the EQUI.

#

I tested this and it worked fine alongside my mod:

og_ISInventoryPage_onJoypadDown = ISInventoryPage.onJoypadDown
function ISInventoryPage:onJoypadDown(button)
    og_ISInventoryPage_onJoypadDown(self, button)
 
    if button == Joypad.LStickButton then
        self:toggleEquipmentUIForController()
    end
end
wet sandal
thick karma
#

No rush, I know we all become available at different times

#

I hope I don't sound bullying 😭 my concern is the gamepad player experience, nothing is personal and ❤️

thick karma
# thick karma Because I just did it with none of my own mods that remotely touch inventory in ...

@wet sandal I cannot 10000% guarantee that this error is yours because I ran it alongside a bunch of mods that should in theory have nothing to do with it, but I can guarantee that if you change your code from:

Events.OnGameBoot.Add(function()
    local og_removeInventoryUI = removeInventoryUI
    function removeInventoryUI(id)
        local data = getPlayerData(id);
        if data then
            data.playerInventory:destroyEquipmentUi()
        end
        og_removeInventoryUI(id)
    end
end)

to

Events.OnGameBoot.Add(function()
    local og_removeInventoryUI = removeInventoryUI
    function removeInventoryUI(id)
        local data = getPlayerData(id);
        if data and data.playerInventory then
            data.playerInventory:destroyEquipmentUi()
        end
        og_removeInventoryUI(id)
    end
end)

Your mod will no longer throw errors when Quit to Desktop is selected in multiplayer.

Try not to miss this one. Nobody can patch it out for you if you forget without overwriting your whole file due to your use of in-line function declarations.

thick karma
untold radish
#

finished a bunch of hats today, including a variant of the riot helmet

#

i used the in game icons for bass, and the icon for the mounted deer trophy to make the bass and deer ballcaps

thick karma
#

@wet sandal You are not crazy. This is a rare vanilla gamepad input error that I can reliably trigger by squeezing L2, D-Pad Down, and Cross (X) at approximately the same time due to rare edge case situations that the vanilla code assumes will not happen, in which the call to vanilla's createMenu will not return anything at all. I may patch this out in my next update to Wookiee Gamepad Support after the weekend.

#

Ignore this bug.

#

(I'll handle it.)

#

It's unlikely anyone would ever discover it without squeezing all the buttons at once trying to guess a shortcut.

All things considered, from what I know so far, I'd say Equipment UI will be a 10/10 instant sub for me if it uses an unused binding (e.g. L3), it either doesn't move or properly restores the UI positions when it opens slash closes, and it doesn't throw an error on Quit to Desktop. I don't see any other obvious issues with it, and the good parts look and feel nice to me.

END OF MY MESSAGES TO YOU FOR NOW, NOTLOC. ❤️

chrome veldt
#

Hey guys do you know any event or method I could listen to/override to detect player crashing against something (other than player / zombie) while driving? I've been searching and tried a few thing for a while now and can't find anything

#

Also, is there any way to know if the player has a specific mod installed?

thick karma
thick karma
#

How did you search out of curiosity?

#

I think this is the only situation in Lua you can hook

chrome veldt
chrome veldt
# thick karma

Tried looking for anything related to crash or car damage in BaseVehicle, media/scripts/vehicle and media/lua/vehicle, and also took a look at the events listed in the pzwiki.
I think I'm missing the Commands object, where can I find it? I'm relatively new to PZ modding and modding in general, done a few things but I have a lot to learn still
I'll try that, thank you!

thick karma
chrome veldt
thick karma
#

Sucks less if you learn how to use it. Today, you do. 😉

chrome veldt
#

You're right, I always assumed it was just not great and limited but never bothered to even think it could be better than I though

thick karma
#

@chrome veldt

#

When you're done adding the locations, go through the list of types and make some adjustments.. find ".lua" and ".java" extensions, and check the radio option that says to search file contents.

#

Also, I believe you'll need to add .info as an extension, then set that to also index file contents

#

That'll let you search mod.info files in Windows search for matching mod IDs, which can be useful for finding obscure hidden copies of mods quicker.

chrome veldt
thick karma
#

Yeah after those locations are indexed and you tell the indexer to also index file contents, you can Windows search in file browser those various folders and subfolders for stuff in the files

#

If you had searched for "crash" like that, you would've seen VehicleCommands.lua in the list, and I bet you'd have realized it might be important

#

And then you search for crash in that file and voila.

chrome veldt
#

Yeah, you're absolutely right, I believe I can also use the VSCode indexed search within the media folder, right?

thick karma
#

Yes

#

Either path is faster to what you need.

#

Manual exploration is not the way

#

Usually

#

Unless desperate and things have weird names

chrome veldt
#

Ok, thanks for your help!

chrome veldt
# thick karma

the crash command doesn't seems to be called ever. Added a print to log the received events and I get some, like setDoorOpen, but never crash, maybe it's called under specific conditions (car flipping?)

thick karma
thick karma
#

That looked like the only reference to crashing in Lua so maybe currently unused

#

Maybe they just track damage somehow not involving the word crash

chrome veldt
#

Yeah, I think that's my best bet at this point. I also though about monitoring the velocity changes to detect a crash (which I can see being logged in the console.txt) but that seems less optimal than damage monitoring

civic tree
untold radish
#

but it is listed on my workshop

#

or used to

#

i just folded it into another pack with the rest of my mods to use on my server

civic tree
#

its not in the workshop anymore? bro i was using that shit cold

#

noticed it instantly, its a pretty needed nerf imo

civic tree
untold radish
civic tree
#

liked it enough to come bitch to you about it lol

untold radish
#

I'll send you a link to the collection it no resides in. Theres other helpful things in there you can enabled/disable like realistic healing times, zombie speed modifiers, and other stuff. If you like it and want to reupload yourself you can do that as well

civic tree
untold radish
thick karma
#

@hallow knoll Second, you probably need to share a zip of mod for someone to look at

#

It could be lots of things

#

Idk unless someone knows workshop upload error 16 off the top

#

I think 8 is a long workshop.txt

#

No clue what 16 is

drifting ore
#

I want to make an item turn into something else/replace if its been in a x container for x amount of time. Which lua files handle these things?

hallow knoll
#

Ok, as I tested and checked, I can UPDATE mods but can't UPLOAD them any way, cause I tried upload the same item I just updated and whoosh and err 16

ancient grail
steep vault
#

So I am working on a mod and reloading lua is going on in the top right corner. At some point it goes to just the background of the main menu. Does anyone have suggestions?

thick karma
civic tree
#

this mod thing im trying to do doesnt seem to work, is the location ok?

thick karma
#

E.g.

local spammo = function(player)
  player:Say("I'm a banana!")
end

Events.OnPlayerMove.Add(spammo)
#

Also debug menu can be used to check if file is loaded

civic tree
thick karma
#

So 1:1:1 is just a third of each

#

Maybe getting rid of them requires something else...

civic tree
#

brb

thick karma
#

Idk if those zones even get used anywhere... having trouble finding the usage tbh.

civic tree
#

thanks a lot for the guide btw, couldnt have done shit without help

thick karma
#

Abandoned Trailer Parks on Steam next week?

civic tree
thick karma
#

Ghost Parks?

#

Nahhhh someone wants to go live in peace in a trailer park

#

There are enough players I'm sure that niche exists

civic tree
#

theyre not even deserted, they just dont spawn a survivor zed every 5 zeds, just normal zeds

thick karma
#

Ohhhh

#

Word

#

Well

civic tree
#

told u it was some niche shit

#

lol

thick karma
#

Elite Trailer Parks

#

lol

#

idk

#

That ruined the name game

#

💀

civic tree
#

hehhe ill think of something and post it if i see someone bitching about finding too much survivor backpacks and shit lol

hearty junco
#

Just started modding this game, so bear with me.

In scripts is there some way to extend Base definitions rather than overriding them? I'm trying to implement some custom attachment models and from what I can gather I need to:

  1. Add a ModelWeaponPart property to the base item(s)
  2. Add attachment data to the base model(s)

It'd be nice if I could do both of those things without needing to copy over entire definitions... Maybe it's not possible, but I imagine extending would make more sense for the sake of interop between mods.

tranquil kindle
red tiger
#

Good morning.

#

Listening to some Bleach OST before heading into work.

hearty junco
# tranquil kindle I'm not entirely sure what you mean. You want to create your own attachments and...

Correct, I've already created my own item and model definitions and pointed them to the right assets, eg.

module Stealth {
  imports { Base }

  item Suppressor {
    DisplayCategory = WeaponPart,
    Type = WeaponPart,
    DisplayName = Suppressor,
    ...
  }

  model Suppressor {
    mesh = Suppressor,
  }
}

But they don't actually show in game, because the base items eg. Handgun, Handgun02, etc... must specify what models to use for what attachments and the relative offsets and rotations in game.

I can just rip the original definitions out of the game directory and paste them in my mod files but... That would not only be annoying and redundant, it would also clobber any other mods that happened to override the same base definitions, which seems like a bad idea.

red tiger
hearty junco
bright fog
#

Everyone uses VS Code for PZ modding bcs we have the Umbrella extension for PZ code formatting

hearty junco
#

Yeah. I used VSCode for a while, the ecosystem is great. But you'll have to pry nvim out of my cold dead hands lmao.

thick karma
#

murders the Outsider for the bit

#

actually pries nvim from the Outsider's cold dead hands, lights his copy of nvim on fire, and finally performs a Satanic ritual to resurrect him from the ashes of his mistakes

compact tinsel
#

Hi! I have made a function in lua but for some reason it doesn't load in at all
I have followed the following folder structure:
No Gun Face\media\lua\server


function JustABadDream(player)
    local body = player:getBodyDamage();
    if body:isInfected() then
        body:setInfected(false);
        body:setInfectionLevel(0);
    end
end ```
and this is the error message the console gave me
#

wanted to ask if anyone else (with more lua experience) had a similar issue at some point

thick karma
#

How did you try using it

#

Context is probably the issue.... E.g. folder structure or code order

compact tinsel
#

in a crafting recipe, one second I will copy the code over

#
    {
        keep RPAlmanach,
        Result: RPAlmanach,
        RemoveResultItem:true,
        Time: 1600.0,
        Category:Survivalist,
        Tooltip: OOC use only - game mechanical cure,
        OnCreate:JustABadDream, 
        AnimNode: TestingSome, 
        CanBeDoneFromFloor:true,
        Prop2: BookYellowBrown_Ground,
    } ```
#

I have tried to make very small steps, first making the item work, then adding the other things little by little

upbeat idol
#

Can anyone help me for making a trait mod

#

ı cannot figure out how can ı make

#

I looked for examples or other mods but what ı do never camed in game

thick karma
#

Make sure you follow all instructions

#

Remove what isn't needed, change names of files and IDs and variables appropriately, etc.

upbeat idol
#

thx

thick karma
#

One thing I immediately notice is your signature is wrong for OnCreate but that doesn't explain the error you're seeing

#

It would cause others

compact tinsel
#

of course! one second, zipping it up

thick karma
#

Should be

end
compact tinsel
thick karma
#

that's an empty zip lol

compact tinsel
#

damn it, one second

civic tree
#

im trying to add guns to the list of this file, how should i do it so i do it as a mod and not by modifying the original file?

civic tree
neon bronze
#

also the wrong prefix for for comments might screw up pz reading the file

compact tinsel
#

will give that a try! thanks for the input!

bronze yoke
#

it doesn't need that prefix

#

the recipe should be able to find any globally accessible function

#

the comment at the start of your file is invalid syntax and causing the file to fail to compile

#

in lua, use -- comment for single line comments and --[[ comment ]] for block comments

thick karma
neon bronze
#

ok its not needed

#

BUT

#

i personally prefer it that way lol

thick karma
#

There are vanilla functions that do not use the prefix e.g.

#

Totally valid

#

Just clarifying for science

neon bronze
#

i love when even vanilla doesnt follow its own standard

thick karma
compact tinsel
#

on it!

neon bronze
#

also dont they need to expand their function to house the 3 args that are getting passed to?

thick karma
steep vault
#

So I check console for error:

'ERROR: General , 1717948231599> ExceptionLogger.logException> Exception thrown java.lang.reflect.InvocationTargetException at NativeMethodAccessorImpl.invoke0 (Native Method).
ERROR: General , 1717948231600> DebugLogStream.printException> Stack trace:
java.lang.reflect.InvocationTargetException'

upbeat idol
compact tinsel
#

thank you all, the function is at least working in the sense of getting recognized
(the infection keeps coming back, need to find out how to fix that, buuut I'm sure I'll find out somehow)

willow vigil
#

Hi, im new to modding and in this server but anyone knows how the Bump code works? like how can i mitigate the damage from a fall when a player push me to the ground

willow vigil
willow vigil
compact tinsel
muted cliff
#

hello!

#

does anybody know a way, to look up, from a lua script, current armor values of Armor on the player character?

#

I want to do some math on that for an RPG system i'm workign on. But i can't get it to work, for the life of me.

#

I tried to do it through local wornItems = player:getWornItems()

#

but i'm too dumb to actually get it to work.

compact tinsel
drifting ore
small topaz
#

Hi! Is it possible to change a 3d model of clothing item via lua code? Smth like clothingItem:setModel("something") ?

small topaz
muted cliff
#

that's what i did!

#

Works like a charm

#

thank you razab.

#

@small topaz Do you know how to add a custom comand, as well?

austere sequoia
#

Is it possible to turn a savegame into a mapmod? (As in I save the chunk all my stuff and my base is in, make a private mod of it, and therefore am able to teleport it into a new map)

willow vigil
#

btw is there any way to make the log walls go diagonal on a square? (even if takes all the square hitbox to move and makes weird invisible hitbox) so "circulars" walls design can be a reality, i did not find any mod so thats why i ask

austere sequoia
willow vigil
austere sequoia
willow vigil
#

ill try then ye, and for add it into the game do i need to make another tab in the context menu or can i just add it to the existing carpintery tab?

austere sequoia
#

I am not 100% certain about this since I have not tried it, and I usually try to keep my fingers off vanilla stuff as much as possible, but it should be doable to add it there

willow vigil
#

okey, thanks man

austere sequoia
mellow bone
#

Im attempting to create a mod to store stats in a database for display on a website or discord bot etc any pointers on where would be a good place to start would be appreciated I would also like to make a web/discord admin tool as well as I havent been able to findy anything along these lines. Im an experienced web developer but new to project zomboid modding.

thick karma
#

Idk about the Discord bot reading it

#

But FW can write the file to Zomboid/Lua for reading later

mellow bone
#

Okay thanks ill look into it

thick karma
#

See True Music Jukebox or Jumper for correct working examples

fleet bridge
#

I'll take a closer look thanks for the pointer

thick karma
#

Good luck!

fleet bridge
#

The submenus appear correctly, if I didn't spawn it off the correct parent wouldn't it pop up incorrectly as well?

thick karma
#

I'd have to review the code to remember why exactly it happens but for some reason it is counterintuitively possible to attach submenu to correct submenu in such a way that grandsubmenu doesn't properly identify its parent and the chain of closing out context submenus breaks

#

Or perhaps it's that the parent doesn't know its own child idr for sure

#

All I know with certainty is what works and doesn't from experience with getting and fixing that error

fleet bridge
#

You're probably right and I just assumed I got it right when it snapped in place the first time. I'll review more thoroughly

slow hound
#

yep it looks like you aren't associating those specific submenus with the context menu itself for that option. once you do that it will work correctly

thick karma
#

@fleet bridge When those menus close they depend on the variables in these functions to be set right to follow parent-child connections from the origin menu thrrough all submenus. I can't say exactly what you did wrong except that how you did it is not ensuring variables are set right for these guys:

function ISContextMenu:closeAll()
    self:hideAndChildren()
    local isJoypad = JoypadState.players[self.player+1]
    local parent = self.parent
    if isJoypad and (parent == nil) then
        setJoypadFocus(self.player, self.origin)
    end
    while parent do
        parent:setVisible(false)
        if isJoypad and (parent.parent == nil) then
            setJoypadFocus(self.player, parent.origin)
        end
        parent = parent.parent
    end
end
-- . . . . .
function ISContextMenu:hideAndChildren()
    self:hideSelf()
    for _,option in ipairs(self.options) do
        if option.subOption and self:getSubMenu(option.subOption) then
            self:getSubMenu(option.subOption):hideAndChildren()
        end
    end
    -- FIXME: this only works for the global context menu for each player
    if self.instanceMap == nil or #self.instanceMap == 0 then return;end
    for k, v in ipairs(self.instanceMap) do
        v:hideAndChildren();
    end
end
fleet bridge
#

Thank you both 👍

thick karma
#

Good luck!

dawn acorn
#

are there any built in animations for lever action guns?

vital nacelle
#

Hello guys,

I am struggling to add an ISBaseTimeAction for my mod, I don't understand what's happening...

Here is the file I wrote for it (It's just a simple test I wanted to do to understand how these actions works, nothing extraordirary^^)


CrossWordMod = CrossWordMod or {}

CrossWordMod.CrossWordAction = ISBaseTimedAction:derive("CrossWordMod_CrossWordAction")

function CrossWordMod.CrossWordAction:isValid()
    return true
end

function CrossWordMod.CrossWordAction:update()
    -- 
end

function CrossWordMod.CrossWordAction:start()
    self:setActionAnim("Loot")
    self.character:SetVariable("LootPosition", "Mid")
end

function CrossWordMod.CrossWordAction:stop()
    ISBaseTimedAction.stop(self)
end

function CrossWordMod.CrossWordAction:perform()
    -- Reduce stress when the action is completed
    local player = self.character
    local stressReduction = 0.2  
    player:getStats():setStress(player:getStats():getStress() - stressReduction)
    -- Ensure stress does not go below 0
    if player:getStats():getStress() < 0 then
        player:getStats():setStress(0)
    end
    ISBaseTimedAction.perform(self)
end

function CrossWordMod.CrossWordAction:new(character, duration)
    local o = ISBaseTimedAction.new(self, character)
    setmetatable(o, self)
    self.__index = self
    o.character = character
    o.maxTime = duration * 60  
    return o
end

-- Add the action to the context menu
local function createCrossWordMenu(player, context, worldObjects, test)
    local option = context:addOption("Do crosswords", nil, function()
        local action = CrossWordMod.CrossWordAction:new(player, 2)  -- 2 minutes
        if action and player then
            ISTimedActionQueue.add(action)
        else
            print("Error: Action or player is nil")
        end
    end)
    option.toolTip = ISWorldObjectContextMenu.addToolTip()
    option.toolTip.description = "Reduce stress by crosswording."
end

Events.OnFillWorldObjectContextMenu.Add(createCrossWordMenu)


The error is popping as soon as I right click my menu option on my character. Error is popping every second of the 2 minutes the action should use.

vital nacelle
#

And the game is breakpointing here :

bright fog
vital nacelle
#

here is what I have in console

bright fog
#

Starting from here

bright fog
round sinew
#

hi, does anyone know how to add extra pain/damage effects to the health panel? and how to indiciate its being treated with a custom item? eg. if i want to add a stick on poultice to treat a leg ulcer (and show that the leg has an ulcer) or use a sticky heatpack, how would i indiciate that in the health panel? I know how to manipulate exisiting vanilla conditions like bleeding, deep wound etc but not sure how to add new conditions. any pointers to mods I can reference would be helpful too. thanks!

wanton cosmos
#

Made a trait, works well, except that it does nothing right now.
I want to make it something that seems simple. Eating raw cockroaches doesn't change unhappiness, and eating cooked roaches increases it instead,

#

but I have no idea how to make this work without overriding the vanilla roaches.

#

what can i do? i want it to be compatible with everything

minor arch
#

i am trying to make a mod that adds a custom craftable poster

i have made a ".pack" file and a ".tiles" file and managed to create the item and the recipe in a way that it shows up in game

i am however incapable of placing it somewhere (i don't even know if it can find the proper tile)

help would be greatly appreciated ^^

austere sequoia
vestal gyro
#

But like I said only if the player has it

#

Idk how else you are supposed to make it work

fleet bridge
willow vigil
#

this code does that every item can be stored in every hotbar thing?

#

like a pistol on a normal belt, a katana in a pistol holster or something?

#

cause if it does that i dont want it, its to delete it

wet sandal
#

I've noticed NPC mods run code they shouldn't sometimes as if the NPC is a full player. Just the only reasonable guess I can come up with for why code that destorys the player's UI has no UI to destroy.

thick karma
small topaz
#

Hi! Is it possible to assign a new texture to a clothing item via lua coding during game although the texture is not specified in the item's xml file?

thick karma
#

I've asked a few times but I think that got missed

wet sandal
#

I do

thick karma
#

Did you Quit to Desktop?

#

Or just Quit to Menu?

#

Quit to menu doesn't do it

wet sandal
#

Ah!

#

I see

thick karma
#

Yeah Idk why those processes are different but that was the only context for that bug

wet sandal
#

Well, I added the nil check, so it should be handled now.

thick karma
#

I explicitly tested both

#

Cool

wet sandal
#

Auto layout now avoids moving your panels

thick karma
#

Probably by faaar the easiest / best way to handle that

#

I'll try it again soon

#

I am excited

#

That one's for sure going on the server when you finish

#

IT might just not let me carry enough stuff lol I dunno about that one but I still wanna help make sure it's good for the people and also for myself if I ever visit an IT server

#

Dropping 50-60 of my vinyls on the ground when I spawn because there aren't slots for that many items anymore made me a little sadface lol

wet sandal
#

lol

thick karma
#

But obviously in the context of the mod it makes sense

#

I use weight reduction mods I am the opposite of target market for IT lmfao I just want to carry stuff like I'm Link and keep it moving

wet sandal
#

Completely fair, IT is a mood

thick karma
#

I just have to celebrate this somewhere... got some motivation today and solved the key zombie animation porting steps I needed to solve to make a Shaun of the Dead stealth mod

#

So that's on the way soon lol

#

That's my vibe... make fake zombie noises, act like zombie, all is well now

civic tree
#

stealth mod sounds pretty cool, ill be waiting to try it

#

🔥

bright fog
steep vault
#

Not sure the right place, but could I potentially have someone read through my mod I made and why it isn't working. 🫠

zinc flame
#

question since i have seen java and lua now here

#

in what language is zomboid programmed?

wet sandal
#

The game itself uses both, but modding generally only uses lua

zinc flame
#

any specific reason why modding is mainly lua?

wet sandal
#

Ease of use

#

Java modding is a lot more involved
Lua, you just make a file in the right spot and your on your way

zinc flame
#

ah alr, cuz im a pretty solid bit into java (im delulu) and it would be interesting to see how they handle generics etc

#

tbh i dont even have the game yet, but in order to learn some stuff about games and how they are made or generally what you do, id like to look at modding communities of interesting games

#

im very sorry if i broke a conversation in here tho

#

but thanks very much for the quick awnser

thick karma
#

There are many idle animations and finding the right one took some trial and error.

#

Eventually got it sorted.

thick karma
#

That may be and that's all well and good but the key ingredient for me was to have a script that said this:

<?xml version="1.0" encoding="utf-8"?>
<animNode>
    <m_Name>defaultIdle</m_Name>
    <m_AnimName>Zombie_Idle</m_AnimName>
    <m_deferredBoneAxis>Y</m_deferredBoneAxis>
    <m_SpeedScale>0.23</m_SpeedScale>
    <m_SpeedScaleRandomMultiplierMin>0.2</m_SpeedScaleRandomMultiplierMin>
    <m_SpeedScaleRandomMultiplierMax>1.25</m_SpeedScaleRandomMultiplierMax>
    <m_BlendTime>0.35</m_BlendTime>
    <m_randomAdvanceFraction>0.50</m_randomAdvanceFraction>
    <m_Conditions>
        <m_Name>zombieImpersonator</m_Name>
        <m_Type>BOOL</m_Type>
        <m_BoolValue>true</m_BoolValue>
    </m_Conditions>
    <m_Transitions>
        <m_Target>lunge1</m_Target>
        <m_blendInTime>0.5</m_blendInTime>
        <m_blendOutTime>0.5</m_blendOutTime>
    </m_Transitions>
    <m_Transitions>
        <m_Target>lunge2</m_Target>
        <m_blendInTime>0.5</m_blendInTime>
        <m_blendOutTime>0.5</m_blendOutTime>
    </m_Transitions>
</animNode>

in player/idle

#

I was trying to to use just the necessary xml and not go overboard copying in a bunch of stuff I didn't need.

#

This works perfectly so far for idling like a zed

#

@bright fog I do have one question left since you're offering lmao but it's not animation related, just Zombie related...

bright fog
#

Yeah ?

thick karma
#

People tell me that ghost mode makes you invisible to other players in addition to zombies... First, is that accurate? Not talkin admin, just setGhostMode(true)

bright fog
#

The debug menu cheat ghost mode ?

#

I don't think so

thick karma
#

Yes

#

Okay see this is why I need more testing friends lol because now I'm not sure

#

Getting mixed info

#

I wonder if I can just use ghost mode only to avoid zeds

bright fog
#

Hmm

thick karma
#

And remain visible to others

bright fog
#

Did you check the camouflage zombie mod ?

thick karma
#

Nah

fleet bridge
#

public boolean isGhostMode() {
return this.isInvisible();
}

public boolean isInvisible() {
return this.invisible;
}

bright fog
#

This sets useless the zombies

#

So zombies can't target you ever

#

This has the slight problem of modifying zombie speed

thick karma
#

Sets them useless?

#

Wdym?

bright fog
#

zombie:setUseless(true)

#

I'm currently playing a lot with it and trying to figure out the best way to remove zombie targeting but I'm not 100% satisfied with what it does

thick karma
#

Is that unsynced?

bright fog
thick karma
#

Because I don't want zeds to stop attacking other nearby players

#

Just because I'm acting like a zed

bright fog
#

I mean

#

If you don't force sync it you will probably get massive desync issues

slow hound
#

snakes camoflage mod works fine for this also

#

and doesn't set them useless if i recall

thick karma
#

In multiplayer? @slow hound

slow hound
#

yes

#

i only test in mp

thick karma
#

So like one person can be camo and another can be visible? @slow hound

slow hound
#

yes

bright fog
#

I need to check it out then

slow hound
#

it only stops the aggro on the person themselves

#

i'd played with my lady using this before and it works as you would expect

#

it also is janky as well but overall should give an idea if i remember

bright fog
#

It does, it sets useless zombies

bright fog
thick karma
#

Damn

slow hound
#

ahhh lol weird. myb braven prolly borrowed the concept apologies

bright fog
#

small part of it that shows it

    if Vdist >= 1.3 and Vdist <= (10 * levelDetection) then
        if Moodle.getValue() > 0.0 and Functions.allowDetection(source) then
            if zombie:getModData().playerDetected == nil or zombie:getModData().playerDetected == true then
                if not zombie:isUseless() then
                    zombie:setUseless(true);

                    zombie:getModData().playerDetected = false;
                end
            end
        else
            if zombie:isUseless() then
                zombie:setUseless(false);

                zombie:getModData().playerDetected = false;
            end
        end
    else
        if Vdist < 1.3 then
            if zombie:isUseless() then
                zombie:setUseless(false);

                zombie:getModData().playerDetected = false;
            end
        end

        if Vdist > 10 then
            if zombie:getModData().playerDetected == false then
                if zombie:isUseless() then
                    zombie:setUseless(false);
                end

                zombie:getModData().playerDetected = true;
            end
        end
    end
end
#

The last method I heard of is from Poltergeist

#

But it's very janky

#

And it would still cause the problem of the zombie never targeting any players

thick karma
#

My instinct is to just give everyone ability to see ghost mode.

bright fog
#

It sets the properties of the tiles the zombie is on to smoke which makes the zombie incapable of targeting

bright fog
bright fog
#

Don't think you can do that ?

thick karma
#

Idc about large servers with admin needs for this particular mod

slow hound
#

i know glytcher and some others at one point in time were developing a mod where you play as the zombie, i remember seeing they handled the aggro. but no idea how. just shooting things out there

thick karma
#

It's a goof mod for playing among friends

fleet bridge
#

does clearAggroList() do anything?

thick karma
#

What large server is going to let people hide from zombies by acting like one AND cares about having secret admin police?

slow hound
#

haha

thick karma
#

Or secret admin maintenance as the case may be

bright fog
#

What does aggroList even do

#

What is it used for

slow hound
#

can't you just remove zombies directly from the java list? or exclude them from being added if you have certain conditions? i have looked so little at those classes

bright fog
slow hound
#

actually you know what. that's not located in media

#

yea you are right

#

it's zombiepopman

#

bleh

bright fog
#

And even if you end up removing the zombie it will most likely be readded then run the code that uses the list and then lua code runs

#

It's exactly like what I tested, to setTarget(nil) to remove a zombie agro

#

You can't do that

#

Bcs it doesn't care, it will readd the target anyway

#

The moment it runs the java

#

And like I'm having a problem too where I need a way to get specific zombies to not target you but end up having to rely on setUseless and smoke tile properties

#

And none of those satisfy my needs bcs at the end I still need to have zombies to move at specific points

#

And I found a way to make zombies move where I want but if it's using the pathing system it's glitchy and doesn't properly react

#

And if it's the actual manual movement of zombies I need to create a pathing system to have the zombie not run into walls and shit like that

#

And like I could maybe do that but uh it's really not great

#

Would need to recreate an entire pathing system, would have to go study various available methods to do such a thing or maybe recreate the java pathing system and reimplement it in lua then modify it

thick karma
#

@wet sandal You about to drop EQUI update?!?!?!?!?!?!!?!?

#

I just noticed I can't launch my server with your beta lmfao

#

Assuming hidden or deleted.

sonic ibex
#

Would it be possible to hide the contents of containers if the player has no light source?

wet sandal
#

Ready for the trial by fire

thick karma
wet sandal
#

If I can keep pace I'll update Tetris next week and do a patch for Equipment UI for anything I missed at the same time

thick karma
#

Sounds good, I'll let you know today if I see any glaring issues

thick karma
#

@bright fog I just tested in HOST mode and I am a ghost and other player can see me just fine

#

So I'm gonna do it this way

#

Will update you if I find weird situations later but I am optimistic

thick karma
#

Yeah sorry

slow hound
# bright fog And even if you end up removing the zombie it will most likely be readded then r...

i been looking into this and it seems you have to modify a damage value to decrease aggro and then when the aggro = 0 then you can remove the zombie from the aggro list and use something like spotted to prevent more aggro being added from that specific player since the only way aggro seems to be added is by being spotted or by damage. by being spotted it adds some kind of fake damage to the zombie to raise the aggro of that player

#

i think i read through that correctly. havent went over the whole thing yet but it's looking doable

slow hound
#

LOL... yeah.... i'm trying to figure out the aggro value part but i'm confusing myself also. it does seem like there is some way to handle aggro though

#

when im off work i'll try to look more and see if i can give a better example. this is why i normally wait til after work to make comments haha

#
private static class Aggro {
      IsoMovingObject obj;
      float damage;
      long lastDamage;

      public Aggro(IsoMovingObject var1, float var2) {
         this.obj = var1;
         this.damage = var2;
         this.lastDamage = System.currentTimeMillis();
      }

      public void addDamage(float var1) {
         this.damage += var1;
         this.lastDamage = System.currentTimeMillis();
      }

      public float getAggro() {
         float var1 = (float)(System.currentTimeMillis() - this.lastDamage);
         float var2 = Math.min(1.0F, Math.max(0.0F, (10000.0F - var1) / 5000.0F));
         var2 = Math.min(1.0F, Math.max(0.0F, var2 * this.damage * 0.5F));
         return var2;
      }
   }
#

ill leave that for now and come back later maybe my brain won't be too jello for it

bright fog
#

Well, if you find out I'm interested

tiny stirrup
#

If LuaManager.java lists a class as exposed, does that mean I could edit that class purely in Lua? And if so, how would I do that?

I see this.setExposed(IsoPlayer.class); and what I want to change is in that class.

thick karma
tiny stirrup
#

Ah. So I could modify the return, but not the formulas inside the called function?

thick karma
#

Can only decorate how that function gets called when Lua calls it

thick karma
#

Java will call original Java

tiny stirrup
#

I'm not sure I understand the distinction...

thick karma
#

Well a Lua script can call getPlayer():getPlayerNum() or a Java class can call getPlayer():getPlayerNum(). You can hook and decorate only the first situation's result

tiny stirrup
#

How can I tell if a given method can be called from Lua? Would it have to be in LuaManager or similar?

thick karma
#

If the function is in the exposed classes in that long list of exposed stuff then it's functions should be exposed

#

Cat on me

#

Linking you difficult

tiny stirrup
#

Basically what I'd love to do is change this...

            if (var4 != null && var4.getSprite() != null && var4.getSprite().getName() != null) {
               String var5 = var4.getSprite().getName();
               if (var5.contains("blends_natural_01") && var8) {
                  var7 = 2;
               } else if (!var5.contains("blends_natural_01") && this.getCurrentSquare().getBuilding() == null) {
                  var7 = 1;
               }
            }```

...and shift var7 = 2 to 1, and var7 = 1 to 0.
#

It's within updateFootInjuries()

#

Which... as far as I can tell seems to be the only injury type not called by Lua, but I'm not sure.

thick karma
#

Rewriting that in Lua would be a headache and it wouldn't stop game from getting wrong result if a Java function calls that

tiny stirrup
#

Which it definitely would...

thick karma
tiny stirrup
#

Hrm... is there any way to use Lua to lie to it about the return of, like, this.isWalking vs this.isRunning?

#

Or... to periodically reset footInjuryTimer, with the period dependent on movement speed type?

thick karma
#

Not sure. What is your goal broadly?

tiny stirrup
#

Alternatively, could I just change it on my machine and not publish it? I'd like to publish the mod, but...

#

Well, basically I find the frequency of foot injuries on most terrain types to be absurd. Orders of magnitude too high, like needing several bandages to walk across a well-manicured suburban lawn, or along a sidewalk. So I want to tone that down significantly but I'd rather not just completely disable it, especially for walking through trees.

tiny stirrup
#

I am indeed. xD

#

Haven't worn a thing on my feet in well over a decade, and I promise, you don't slash your feet to bits walking on soft grass, or smooth pavement, heh.

#

The mod "Callused Feet" attempted to disable it entirely by intervening in the injury call and set "scratch resistance" to 100, but it's broken and abandoned (if it ever worked at all, which I'm somewhat dubious about given comments on the Workshop page), and... there's got to be a more elegant way.

#

So where would I look to see what I can do in Lua? Event.java inside the Lua folder?

#

Ah, that's tiny.

#

There are a bunch of TriggerHook methods in LuaHookManager, for different numbers of internal variables... is that useful to me? Only seems to go up to 6, and this method has at least 7...

#

Really I wish they'd just expose those parameters to sandbox settings... but is probably pretty low priority. There's definitely interest in the playerbase, but probably not a ton. On the other hand, it's a pretty easy change, I'd think.

#

I wonder why it's only in java? Maybe because it gets called a whole lot, the whole time the player is moving, so it needs to be pretty fast?

thick karma
#

@tiny stirrup I have a workaround for you

tiny stirrup
#

Really?

ancient grail
# tiny stirrup Basically what I'd love to do is change this... ```java IsoObject var4 = this.ge...
local pl = getPlayer()
local sq = pl:getSquare();
for i=0, sq:getObjects():size()-1 do
    local obj = sq:getObjects():get(i)
    local spr = obj:getSprite()
    if spr then 
        if  spr:getName() and spr:getName() == "yourspritename" then        
            print(spr:getName());
        end
    end
    if obj:getOverlaySprite() ==  "yourspritename" and obj:getOverlaySprite():getName()  then
        print(obj:getOverlaySprite():getName())
    end
    local attachedSprites = obj:getAttachedAnimSprite()
    if attachedSprites ~= nil then
        for i = 0, attachedSprites:size()-1 do
            local spr = attachedSprites:get(i):getParentSprite()
            if spr and spr:getName() ==  "yourspritename" then
                spr:getName()
            end
        end
    end
end
        
#

double check syntax and format. i did not test this

tiny stirrup
#

Interesting... the idea being to to interfere with checking what kind of square the player is on?

ancient grail
#

wherever you're standing on

#

you can change the square thats just what i do to quickly check for stuff

#

you can break down this code into 3 functions btw.

#

sprite, overlaysprite, attachedsprite

tiny stirrup
#

I'm not super clear on how that helps... I'm not super experienced in java. Most of my coding experience is ancient, and C++

ancient grail
#

i think attached sprites are for stuff like tv? not really quite sure tho

ancient grail
tiny stirrup
#

But what is it intended to do?

ancient grail
thick karma
#

Hmm

#

Well

tiny stirrup
#

Yeah I'm... a little confused. Would the idea be to always return null? That'd make heavy wilderness tiles look like normal outdoor tiles, wouldn't it? But that's the opposite of what I want to do. My problem is with normal outdoor tiles. I'd considered maybe making it think "not blends_natural_01" tiles are always building tiles, but I'm not sure how to do that.

thick karma
#

Here's a thing:

local BarefootWarrior = {}

BarefootWarrior.movedEnoughToHurt = function(player)
    if whateverConditionsYouWant then
        return true
    end

    return false -- Until you decide it's true
end

BarefootWarrior.toughenFeet = function(player)
    if BarefootWarrior.movedEnoughToHurt(player) then return end

    local leftFoot = player():getBodyDamage():getBodyPart(BodyPartType.Foot_L)

    local rightFoot = player():getBodyDamage():getBodyPart(BodyPartType.Foot_R)

    if leftFoot:HasInjury() then
        leftFoot:RestoreToFullHealth() 
    end

    if rightFoot:HasInjury() then
        rightFoot:RestoreToFullHealth() 
    end    
end

Events.OnPlayerMove.Add(BarefootWarrior.toughenFeet)

BarefootWarrior.recoverFeet = function(player)
    if player:isMoving() then return end

    whateverConditionsYouWant = resetThemOverTimeSpentResting
end

Events.OnPlayerUpdate.Add(BarefootWarrior.recoverFeet)

return BarefootWarrior
#

And link me when you're done because I'd fully run this

#

But fair warning people are going to want you to convert it into a skill 100%

tiny stirrup
#

That effectively monitors foot health and if you haven't moved enough to get a foot injury, it heals it immediately?

thick karma
#

Yep

#

And you decide how long it takes before the player can actually injure their feet

#

You could also set other conditions

tiny stirrup
#

So that could be packaged into a trait or skill?

thick karma
#

like check whether they're on glass

tiny stirrup
#

A skill could be really interesting...

thick karma
#

You could in theory have a skill that determines how long they can go without resting

tiny stirrup
#

Get better at going barefoot over time, which is pretty realistic.

thick karma
#

And even give glass resistance and stuff at high levels

#

People would very much be into it

#

Refer to other mods that add skills if interested, beyond what I can show you without doin the research

tiny stirrup
#

It... would seriously push my capabilities... would you be willing to co-author it, maybe? Or I could just worship you forever if you do it? 🙃

#

I do have a mod that adds a trait that adds unhappiness over time if you're not barefoot, and adds happiness if you are.

ancient grail
tiny stirrup
#

Which I totally didn't rip off of a nudist trait mod at all.

#

But, y'know, that's coding. xD

tiny stirrup
#

footwave That's me.

#

I do like your workaround @thick karma. The more I think about it I think it's a better solution than anything else I've considered. Maybe make it specific to scratches so it doesn't magically heal deep wounds/glass shards? 🤔

thick karma
#

Yeah just check the player's position for anything you think SHOULD hurt right away

#

And include it in the raw time check

#

etc

thick karma
tiny stirrup
#

There's shockingly little differentiation between tiles. Pretty much just default, indoors, and rough terrain denoted by blends_natural_01, but... maybe shrubs or the like.

thick karma
#

There is a getBrokenGlass() on squares

tiny stirrup
thick karma
#

so you can just check player:getSquare():getBrokenGlass()

thick karma
tiny stirrup
#

Yeah, I'm fine with how it handles that. In real life, glass isn't nearly so scary, especially flat glass from things like windows, which generally lay flat on hard surfaces. But then I thought about it on grass or dirt, where the surface could easily prop it up, plus most people think glass is pretty problematic.

#

Heh, you'd be surprised how many times over how long I've asked about this...

civic tree
#

can someone help me with this? i added guns to the table of superb survivors and they all spawn correctly, some of them work correctly but the ones that use modded bullets dont spawn them. im trying to add them too but im not sure how to

opaque ocean
#

Anyone know if we've gotten the devs to cough up any formatting changes for b42 recipes yet? Especially how they're doing workbench reqs.

#

I am dying to get back to the grind

civic tree
opaque ocean
#

because by default it could be assuming that's all base. items

#

wait im dumb im thinking recipe scripts

civic tree
civic tree
opaque ocean
civic tree
#

i dont have the mod, does that mean all the elseif lines are like not taken into account?

opaque ocean
#

uh... just looking at that, that shouldn't be the case? looks more like it's just running that check and then ending that section before moving on to... what looks like brita's ammo?

#

prob just an orgm compatibility thing they shoved into the same function

civic tree
civic tree
opaque ocean
#

been a hot minute since I messed around with Brita's stuff, but those look like mostly what Brita's ammos are named

#

cant really think of another mod that'd be using 4 gauge

#

or 30-06

#

what gun mods are you using?

civic tree
civic tree
#

but today i added all the guns of the mod to the pool in the weapons list file

opaque ocean
#

give me like 5 mins to go dig into that rq

civic tree
#

sure, thanks btw

opaque ocean
civic tree
opaque ocean
#

there's the mod's ammo item script

#

those are what you want to get added into that section of the lua script

#

item NAME - NAME is the itemid.

civic tree
#

yeah, for the modified thing i did i copied them straight of the items scripts too

#

lemme show u rq

#

this is what mine looks like, that doesnt work

#

theres more to it tho, this is i guess what tells the npcs how much ammo they get from each box, i edited them too

#

adding the right names and such

#

could be whats making everything fail

opaque ocean
#

honestly, that shouldn't cause them not to spawn in a container/inventory

#

that's just telling the mod how many bullets each box is intended to turn into, but turning boxes into bullets is handled solely through recipes, it's not an actual stat on the box... as cool as it would be to have ammo boxes act like fluid items.

civic tree
opaque ocean
#

I think that first section of the script might not be what you're looking for

civic tree
drifting ore
opaque ocean
# civic tree interesting, im inclined to believe it is what controls the thing im trying to c...

aight. not seeing a ton of people having the same issues, but based on the singular existing standalone compatibility mod to make britas guns work with it, it doesn't seem like you should need to mess with the ammos in that file? I'm not sure. Superb Survivors for the most part looks like it's automatically grabbing the ammotype and ammobox variables from the gun they hold so just adding the weapons to their usable guns list should work? as far as them spawning in with the ammo, I can't find the part of the code actually governing that and it's getting pretty late here for me.

Worst case, could always try asking nolanritchie on steam to see if they can give some insight on the issue.

#

but I can say that the whole box to bullet/bullet to box lines in there don't seem to actually control what ammo they spawn with in their inventories. that seems to be more for like... if they loot a box of ammo and need to turn it into reloadable bullets.

civic tree
split pagoda
#

ello! i was wondering how to have it so you spawn with a box that has items in it. I know how to get the box to spawn where I want it, but I dont know if dictating what's in the box is possible

ancient grail
#

if getActivatedMods:contains('ORGM') then

steep vault
#

So now I'm to the point of not getting textures to show or the recipe functions to work but hey the game at least loads lol

steep vault
#

module UwuChildhoodSnacks
{
imports
{
Base
}
model GreenCrayon_Ground
{
mesh = WorldItems/Candle,
texture = WorldItems/GreenCrayon_Ground,
scale = 0.5,
}
model BlueCrayon_Ground
{
mesh = WorldItems/Candle,
texture = WorldItems/BlueCrayon_Ground,
scale = 0.5,
}
model RedCrayon_Ground
{
mesh = WorldItems/Candle,
texture = WorldItems/RedCrayon_Ground,
scale = 0.5,
}
model BrownCrayon_Ground
{
mesh = WorldItems/Candle,
texture = WorldItems/BrownCrayon_Ground,
scale = 0.5,
}
model PurpleCrayon_Ground
{
mesh = WorldItems/Candle,
texture = WorldItems/PurpleCrayon_Ground,
scale = 0.5,
}
model YellowCrayon_Ground
{
mesh = WorldItems/Candle,
texture = WorldItems/YellowCrayon_Ground,
scale = 0.5,
}
model BlackCrayon_Ground
{
mesh = WorldItems/Candle,
texture = WorldItems/BlackCrayon_Ground_Ground,
scale = 0.5,
}
model OrangeCrayon_Ground
{
mesh = WorldItems/Candle,
texture = WorldItems/OrangeCrayon_Ground,
scale = 0.5,
}
model CrayonBox_Ground
{
mesh = WorldItems/JuiceBox,
texture = WorldItems/CrayonBox_Ground,
scale = 0.5,
}
model EmptyCrayonBox_Ground
{
mesh = WorldItems/JuiceBox,
texture = WorldItems/EmptyCrayonBox_Ground,
scale = 0.5,
}
model GlitterGlue_Ground
{
mesh = WorldItems/Glue,
texture = WorldItems/GlitterGlue_Ground,
scale = 0.5,
}
}

ancient grail
#

your textures in the wrong folder

#

based on what you wrote on the model
you either transfer the textures or change the script by removing the worlditems

#

the screenshot you sent has prefix items. it means they are for icons right? however k dont see the worlditems folder so ...

steep vault
#

Okay. So then I would get the 3d model mesh image to recolor to what I want them to look like for the worlditems folder?

ancient grail
#

if you have the right textures for it then yes.

steep vault
#

Okay. That helps.

bleak echo
#

Is mod development a good way to learn more about programming? I've made interfaces for world of warcraft before using lua, should I give it a try?

steep vault
#

The last part that I don't have an idea as to why it isn't working is this.

indigo pasture
bright fog
bright fog
#

Let me show you how

#
local crayon = {
    [1] == "Red",
    [2] == "Blue",
    [3] == "Green",
    [4] == "Black",
......
}

function ....
    local item = crayon[crayonChance]
    -- maybe add a check for item not nil if needed
    getPlayer():getInventory():AddItem("Base."..item.."Crayon")
end

Made it small bcs writting from phone but you could simply give the entire item name in the list considering you have some options that are formated differently like the Box

#

Also your ZombRand goes from 1 to 7

#

So these 2 last options will never appear

ancient grail
# steep vault The last part that I don't have an idea as to why it isn't working is this.

ZombRand(1,8)
it actually starts with 0 but since 1 is defined then it will start with 1 . and it will end on 7 not 8. so basically it will generate a random number from 1 to 7. and if it hits 1. since the condition is ==1 . then the code will execute. . which is give player bunch of crayons.
this can be done using table and suggest that you do it using tables.

what doggy wrote is a similar code using table but instead of spawning all crayons when you hit 1 . it will spawn 1 crayon which is whatever assigned to the key .. so if you hit 1 then yiu recieve "(Red" as a string . and will be placed inside the "Base."..
HERE
.."Crayon")

result should then be
"Base.RedCrayon"
if you hit 1

small topaz
drifting ore
#

into a container

small topaz
# drifting ore an item which is crafted and then placed

You could try to add mod data to the item when it is placed in the container and use it to check how long the item stays in there.

I can think of 2 ways how to transform the item into the new one if time is over:

  1. Whenever player opens the container's inventory, check whether an item of your type is present, whether it is old enough and if so, delete the item and replace it with the new one

  2. Store the container somewhere in the global mod data (best thing is here to store container's coordinates on the map I guess since mod data can easily store numerical values). Then use an event like Event.EveryDays and check each for each of the containers whether the respective items are old enough. If so, delete them and replace with the new ones.

In both cases, it might be necessary to make sure the items are properly removed and replaced on server side. In the second variant, you may also need to make sure that the container is removed from global mod data in case it doesn't contain the item anymore (if player has removed it or if it has been removed).

All this is just a brainstorm but I guess both versions might work somehow.

EDIT: Btw first version can have the disadvantage that the item only changes if player looks into the container (this could lead to undesirable behavior in case the item is lying on the ground and it's 3D model is rendered). So I guess the 2. version might be even better. Or should it just change if it is in a specific container for a long time?

drifting ore
#

Thank you so much!

one more thing
what does the number thats at the end of this do
table.insert(ProceduralDistributions["list"]["CafeteriaSnacks"].items, 5);

bright fog
#

It's the value inserted in the table

small topaz
bright fog
#

It's inserting in a table that is in a table in a table

drifting ore
#

so is it like 5% chance or?

bright fog
#

The tables

  1. ProceduralDistributions
  2. list
  3. CafeteriaSnacks
  4. item
bright fog
drifting ore
#

im trying to get my items to have 20% chance to spawn but cant figure out what value to use

small topaz
#

But there are definitely people here who know this. Asked this same question some time ago and got a precise answer here. But I already forgot XD

drifting ore
#

do you remember how you asked? i might be able to search your question

small topaz
#

unfortunately not

drifting ore
#

hmm was it this

small topaz
#

yes!!! that was the related discussion! at least I am quite sure it was the same question you have

bright fog
drifting ore
#

hmm idk i am probably doing something wrong with distribution

#
table.insert(ProceduralDistributions["list"]["BakeryMisc"].items, "Steak");
table.insert(ProceduralDistributions["list"]["BakeryMisc"].items, 10);

this is what I do for a item, is this correct way to do it?

bright fog
#

Should be yes

small topaz
#

what is BakeryMisc? an item?

drifting ore
#

location

#

i guess everything in bakery thats not specified as an location

small topaz
#

as Sir Doggy Jvla then ... looks good to me too

empty flame
#

Hi guys, i created a tiles mod with all the correct .tiles and .pack files but cant seem to find those tiles on the debug menu (brush tool) with the mod installed. What i can try to fix the issue? Already placed the mod.info pack and tiledef with the numbers and idk what to do

compact tinsel
#

hi, I have a small question regarding crafting recipes
I want the character to hold something in their hands as they perform the recipe, this is what I tried (the ??? I am unsure about what to write there):

    {
        keep RPBeer/RPBourbon,
        Result: RPAlmanach,
        RemoveResultItem:true,
        Time: 1600.0,
        Category:Survivalist,
        Tooltip: OOC use only - game mechanical cure,
        OnCreate:Recipe.OnCreate.JustABadDream, 
        AnimNode: DrinkBottle, 
        CanBeDoneFromFloor:true,
        Prop2: ????,
        Sound: sound/PZ_DrinkingFromBottle,
    }```

I'm sure there are a few issues with the sounds and animations, but I can figure those out on my own. 
My question would be, could I force the recipe to use the prop the player right clicked / uses for the crafting recipe?
#

Or do I need to really make as many instances as I want the character items to hold? e.g. if I have a recipe with 6 items, do I need to have 6 recipes?

ancient grail
# drifting ore im trying to get my items to have 20% chance to spawn but cant figure out what v...

its not possible to assign percent the number of items to spawn is unknown (due to mods)

imagine if 5 mods assign their item 20% then it wont actually be 20%

unless one mode overwrites everything and force a function to do the math and ultimately assigns everything an average then force your item to become 20% tho thats so unlikely . so yeah the weight just represent chances. cuz the game rolls for each item and im not sure but that might be the number of times it will attempt to spawn your item. higher value, higher chance

steep vault
# bright fog Let me show you how

Thank you. So this would go first and then I'd have lines that do oncreate? Just so I understand. The function and definition of what local crayon is regards defining so that when crayonchance is added what to pull from?

bright fog
#

Uh

#

I'm not sure I understood your question

fleet bridge
#

or Prop2: Source=1, i forget which hand is which

steep vault
#

Does the red bracket being there provide a 'definition' for the coding that is pointed at by the blue coding?
Like when it says "local item=" it is connecting the information at the beginning to the function code so it knows what is supposed to be connected to what? I'm not home ATM otherwise I would share what I put in the document.

#

More trying to break it down so I understand lol

compact tinsel
bright fog
#

So function can access locals in the same level

#

While local item can only be accessed by things in the same level as it is

#

Doing crayon[crayonChance] will access the key within the table crayon and give out the corresponding value

steep vault
#

OnCreate:Recipe.OnCreate.GiveCrayons,

function Recipe.OnCreate.GiveCrauons(items, result, player)
player:getInventory():AddItem("Base.RedCrayon");
player:getInventory():AddItem("Base.BlueCrayon");
player:getInventory():AddItem("Base.BrownCrayon");
player:getInventory():AddItem("Base.BlackCrayon");
player:getInventory():AddItem("Base.OrangeCrayon");
player:getInventory():AddItem("Base.PurpleCrayon");

end

Would the rest then look like this?

steep vault
steep vault
#

I apologize if I'm getting it wrong still lol I've only ever messed with some css coding when I was much younger on neopets. 😅

bright fog
#
local crayon = {
    [1] == "Base.RedCrayon",
    [2] == "Base.BlueCrayon",
    [3] == "Base.GreenCrayon",
    [4] == "Base.BlackCrayon",
    [5] == "Base.BrownCrayon",
    [6] == "Base.YellowCrayon",
    [7] == "Base.OrangeCrayon",
    [8] == "Base.PurpleCrayon",
    [9] == "Base.EmptyCrayonBox", -- you made a typo in your original code writing Cragon ?
}

function Recipe.OnCreate.GiveCrayon(items,results,player)
    local crayonChance = ZombRand(1,10)
    local item = crayon[crayonChance]
    if not item then return end
    getPlayer():getInventory():AddItem(item)
end
steep vault
#

Ah. Okay. Would mine I posted be more if I did randomization from a packaged item? With the zombrand part?

compact tinsel
steep vault
bright fog
#

With the table, you don't have to fail N if before accessing N+1 condition

#

You just directly go to the value

steep vault
#

Okay. That makes sense.

bright fog
#

It's also way easier to organize

#

So whenever you can use that, it's most likely better to use it

#

The cases where you can't use that is if you use < > conditions

#

(and probably more example cases where you can't use it but these are the main ones that came to my mind)

compact tinsel
fleet bridge
hard coral
#

does anyone know if there's some sort of function in lua to define a radius from an origin (like player spawn) and have an event occur if the player leaves that radius? I'm working on a modded start where the player has a house arrest ankle monitor.

#

(trying to use this as a vehicle to re-learn lua, haven't really touched it since some extremely basic garrys mod scripts over a decade ago)

bright fog
hard coral
#

I assume the best way to start would be to investigate how modded spawn points work as that will be dealing with the same coordinate code

bright fog
#

That's really not needed