#mod_development
1 messages ยท Page 71 of 1
i assumed- yeah, that's what I was about to say
that's why not isServer() is used a lot more frequently than isClient(), even though they might sound like they should do the same thing
when they could just make singleplayer an offline server
I assumed by now PZ had merged the singleplayer stuff into an offline server, but I guess that's not the case. damn
also the reason for weird bug fixes in the changelogs
that's wild
like a while back sledgehammers having a fucked up spawn rate in multiplayer
iirc was due to zombie density not having the proper effect on loot in multiplayer
yeah that was it
okay so in that case, this code makes a lot more sense
turns out the noise maps used to generate soil quality and snow density are actually entirely static (i.e. not randomized) unless you're in singleplayer
kinda wild. didn't realize that
also rain
its a static map
puddles are always in the same place
dont remember if its ever regenerated
iirc rain actually uses a different noise method, the former uses Perlin but i believe the puddle maps are different
still digging in though
i'm gonna try to rasterize these just to see what they look like, maybe overlay it on the map just for shits and giggles
local carModData = car:getModData();
carModData.job = args.job;
carModData.fuck = "me";
car:transmitModData();
did not add mod data to said trailer.
because you still aren't doing anything with carModData
you're just assigning the variable and its properties, then it remains unused
they're using it later in the code
what do you want me to with it when i'm creating the trailer?
but it seems to vanish before then
it will be pulled when the trailer is turned in.
if it's being used later in the code, then it needs to be transmitted after you use it
but it's not getting added when i trell the server to spawn the car.
that code is ran server side.
right, but if the car's mod data is what's being transferred, then you need to attach carModData to the car itself (or change it directly on the object)
because when you assign local carModData to car:getModData() that's a copy, not a reference, unless I'm misunderstanding something
so you'd have to set the data to your new version of the data (after you make the modifications) in order for it to update on the car object
that's EXACTLY how i set the data on a player.
moddata is a reference
tables are always passed by reference
in the function, yeah, but wouldn't it be a copy if you're assigning a local variable?
I'm in C#/Java mode at the moment, so excuse me if I'm getting that wrong
but OOP tends to suggest that wouldn't be the case (especially with a get function)
they are passed by reference
local player = getPlayer();
local myModData = player:getModData();
myModData.city = CityCode;
myModData.completeText = completeText;
myModData.ttype = completeType;
myModData.job = LoadGenCode;
that's just how tables work in lua
so if I wanted to assign a new variable to the value of car:getModData() what would that look like?
Is there a mod which expands the variety of diseases?
i don't think you can?
oh i misread this
it's still sort of the same answer though
you can loop through the table and copy all of its keys and values into a new table
that's wild
but there's no way to directly copy the value that i know of
copyTable()
is that a global?
yes
lol
i saw it in projectrp and they defined it themselves higher up in the file
and there didn't seem to be anything special about their implementation?
so that's kind of odd
I wrote my own and someone said 'ah copyTable had some issue?'

chances are they didn't know it exsisted
public static KahluaTable copyTable(KahluaTable var0) {
return copyTable((KahluaTable)null, var0);
}
public static KahluaTable copyTable(KahluaTable var0, KahluaTable var1) {
if (var0 == null) {
var0 = platform.newTable();
} else {
var0.wipe();
}
if (var1 != null && !var1.isEmpty()) {
KahluaTableIterator var2 = var1.iterator();
while(var2.advance()) {
Object var3 = var2.getKey();
Object var4 = var2.getValue();
if (var4 instanceof KahluaTable) {
var0.rawset(var3, copyTable((KahluaTable)null, (KahluaTable)var4));
} else {
var0.rawset(var3, var4);
}
}
return var0;
} else {
return var0;
}
}
i'll have to make use of that
I use it whenever I make pseudo classes
I assume derive() does something else - but for what I need copyTable works
Is there a 57' Chevy Bel air mod if anyone knows?
well i am open to ideas on how the hell i am gonna get his moddata stapled to these trailers.
i think so wanderer
copyTable just copies a table, I just started using it recently
derive is for inheritance of objects, setting metatables, etc.
@marsh cloak fhqwhgads' Vehicle Pack - The Motorious Zone
thanks
http://lua-users.org/wiki/CopyTable found this, kinda interesting
I pronounce fhqwhgads as fuh-hwook-huh-gagds and I will not be convinced it is anything else
Does PZ only load textures on launch? There's got to be a better way to work on clothing retextures without editing in PS > export as PNG > restart PZ > view in char creator > repeat
gobbless
pz has a copyTable
you mentioned this is being used later via that variable, are those the changes that aren't showing up? or does the initial assignment not even show up? I'm thinking you may need to transmit again after you do whatever you're doing, or just do whatever you're doing on the client/server where it needs to happen in the first place (then transmit the result)
that's the only thing in that fnction messing with the mod data.
sure, but that goes into detail as to how it can vary by use case and goal
the other stuff is client side.
I'm planning to expand the scope of my mod, can I create for example a "shared assets" modid that's required by another mod?
This doesn't seem to work for me, is there a particular setting that needs to be enabled or does the mod need to be in a directory other than the standard mods folder?
Yep, walking around with it no problem.
And it's definitely pulling from the right folder, since on restart the texture does change.
hmmm...
are you in debug mode?
also, as for the moddata thing, what if we sent the mod data on the isoobject of the car instead of the adddebugvehicle?
Anyone worked with particles?

why?
nah i had to mess with blood for the mower
getting it to fling out would NOT happen.
i had to manually place the splats,
honestly i'd use mower if it'd look like 5pixels shit, the functionality is just way too good
what?
Yep, no difference in debug
5pixels?
idc, anything. I'm saying with or without blood, mod functionality is way too good to pass on
the mower and the cutting grass functonality took like 2 days to do. then someone asked me what happens when i hit a zombie or a dead body, mod took 3 months longer to make LOL.


anyone knows if you stay around big piile of dead Z do you get foodSickness or some other kind of sickness?
you get foodsickness but it's really negligible
dang
Im die 
fun fact: the pre-generated static values for the erosion/soil/snow/etc. data is taken from a single, manually defined array
and the array has around 7900 values in it
this is my current function to spawn a trailer.
it's called with
sendClientCommand("KYRPT", "spawnTrailer", {type = "Base.TrailerTSMeg", condition = 100, clear = true, x = 0, y = 0, z = 0, dir = 45, code = "generatedcodehere"});
probably generated once and left
how can one get perk name from Perk ?
perk:getName()
cheers
elseif serverFixAnglesA == IsoDirections.SE then serverFixAngles**A **
am I missing something? It doesn't print a single line
local totalPerkLevel = 0
local totalMaxPerkLevel = 0;
for i, perkCheck in ipairs(Perks) do
local perkLevel = player:getPerkLevel(perkCheck)
print("Perk "..player:getPerkLevel(perkCheck):getName().." lvl"..perkLevel);
totalPerkLevel = totalPerkLevel + perkLevel;
totalMaxPerkLevel = totalMaxPerkLevel + 10;
end
oh wait

you may have to use perkfactory.getperk() cause perks. may not inherit the other methods
Would you like a cleanup pass?
also kind of wild isodrections don't have a toAngle - seems like the toAngle returns 1-9 I wonder if it's used on a list
for i=0,Perks.getMaxIndex()-1 do
local perk = Perks.fromIndex(i)
end
```i can't remember if i actually tested it but i have something like this
iirc there's a toAngle that can take isodirections as an arg? i forget though
or maybe something that takes in an IsoDirection and then has a toAngle extension
im trying to count amount of perk levels player has but this returns nan
local totalPerkLevel = 0
local totalMaxPerkLevel = 0;
for i, perkCheck in ipairs(Perks) do
local perkLevel = player:getPerkLevel(perkCheck)
totalPerkLevel = totalPerkLevel + perkLevel;
totalMaxPerkLevel = totalMaxPerkLevel + 10;
end

there is but it returns 1-9 - not sure how that's going to work lol -- I guess he could make his own list on angles and compare it
lol feel free.
also: yeah definitely, but the one-line initialization is causing some of my refactoring tools and extensions and stuff to shit the bed 
but at that point he could make a list of key/value dir/angles and refer to it himself
IsoDirections is an enum, not sure how that works in Lua but that'd be why it returns an int
isoDir.toAngle should logically return angles though?
public float toAngle() {
float var1 = 0.7853982F;
switch (this) {
case NE:
return var1 * 7.0F;
case N:
return var1 * 0.0F;
case NW:
return var1 * 1.0F;
case W:
return var1 * 2.0F;
case SW:
return var1 * 3.0F;
case S:
return var1 * 4.0F;
case SE:
return var1 * 5.0F;
case E:
return var1 * 6.0F;
default:
return 0.0F;
}
}
but yeah local car = addVehicleDebug(args.type, args.dir, nil, sq) that addas a RANDOM ANGLE TO THE DFIRECTION.
int multiplied against 0.785~
stupid ass thing.
so it can be -22.5 to 22.5 degrees OFF from the direction provided.
what are the values for each?
i.e. var1 in this case
oh wait
it's just static
I'm blind
that's incredibly silly
why not just return the premultiplied value 
do we learn at long last that TIS doesn't have access to calculators
local IsoDirectionsToAngles = {
[IsoDirections.N]=0.0,
[IsoDirections.NE]=45.0,
[IsoDirections.NW]=-45.0,
[IsoDirections.E]=90.0,
[IsoDirections.W]=-90.0,
[IsoDirections.S]=135.0,
[IsoDirections.SE]=-135.0,
[IsoDirections.SW]=180.0,
}
local pX, pY, pZ = args.x, args.y, args.z
local serverFixAngle = args.dir
local sq = getCell():getGridSquare(pX, pY, pZ)
local car = addVehicleDebug(args.type, args.dir, nil, sq)
local FixAngle = IsoDirectionsToAngles[serverFixAngle] or 0
car:setAngles(180.0, FixAngle, 180.0)
You can keep the top one as a local outside of the function
assuming args.dir is always present
you can also add a 'serverFixAngle and' after FixAngle =
@faint jewel
also personal preference
local pX, pY, pZ = args.x, args.y, args.z
this works, thanks. By any chance you'd know how to grab only perks that can be leveled?
local totalPerkLevel = 0
local totalMaxPerkLevel = 0;
for i = 0, Perks.getMaxIndex()-1 do
local selectedPerk = Perks.fromIndex(i)
print("Perk: "..selectedPerk:getName());
local perkLevel = player:getPerkLevel(selectedPerk)
totalPerkLevel = totalPerkLevel + perkLevel;
totalMaxPerkLevel = totalMaxPerkLevel + 10;
end```
returns stuff like category dividers and Skills that were cut out from the game
to avoid none you can probably just start i at 1
smort
you can also grab only skills with parents, and with parents other than none (maybe)
getParent()
yeah, iirc the hidden perks are just parented to none
getParent(0
that's a smart solution
it's kind of wild but the skill categories are their own skills
they're orphans 
well Chuck is smart so expected
could be used to feed into some sort of parallel level up system
but its odd it's just already there and only used for UI display
for clarification - raising any skill in the combat category could unlock bonuses or feed XP into the sibling skills
that is so much nicer to look at lol
well now the fun part. getting that damned mod data to stickl.
it's all tables and references all the way down
Am I going crazy here or should S = 180 and SE/SW be the 135 and -135 values? (respectively).
if this weren't isometric, you'd be right
๐
My head just can't wrap around why N and S are not 180 degrees apart ๐
oh wait ๐ค
works 
for i = 1, Perks.getMaxIndex() - 1 do
local selectedPerk = Perks.fromIndex(i)
if selectedPerk:getParent():getName() ~= "None" then
print("Perk: "..selectedPerk:getName()..", parent: "..selectedPerk:getParent():getName());
local perkLevel = player:getPerkLevel(selectedPerk)
totalPerkLevel = totalPerkLevel + perkLevel;
totalMaxPerkLevel = totalMaxPerkLevel + 10;
end
end```
N = 0 so i think you're right
aww my literacy skill is in there ๐
imagine being literate. could not be me
I need to take a look at that literacy mod. ๐
ye was grabbing trait names to overwrite em 
My POV looking at @finite radish

actual footage of me rn
you know whats fuuny, i test my stuff in bulk, aka write few perks -> test them
and i was about to test something very specific but something else wasnt working so i went on fixing it which i just did and now i dont remember what i was doing initially

its like that vid
I think this is pretty familiar for most of us.
To everyone who watches this: please check out this youtube creator called nartharie . He has created some of the must absurd and funniest videos I've ever seen, but he's still at 280 subs at the time of writing. So please discover this before all your friends or acquaintances or whatever do and be...
I think I just transposed what he had originally - I may have grabbed the wrong angles
huh?
This concept but in musical form https://www.youtube.com/watch?v=vRTT1ulHOB0
Hey is there a way to permanently get a player in both sp and mp? When i use getPlayer on exit the moddata with it get erased
depends on your use case, but imo you shouldn't be storing entire player objects in moddata
you'd want to instead use <player>:getUsername() and then you can fetch the player object later when you need it using getPlayerFromUsername(<username from moddata>)
i don't know how that'll work (if at all) in singleplayer though, but there's less need for moddata transmission there anyways so you should be able to figure it out
Can the username be altered by a player in vanilla? If yes then i just use the steamID
I doubt anyone can alter that
it can't
I for sure misordered the angles lol
nooooo.
Do you know a lot about moddata by chance?
local NEangle = 45.0
local NWangle = -45.0
local Eangle = 90.0
local Wangle = -90.0
local SEangle = 135.0
local SWangle = -135.0
local Sangle = 180.0```
Just SW, SE, S
no... those are mine and they are right.
Im trying to figure out when to call transmitModData
on my code snippet
while I don't know that much about moddata specifically, you'd want to transmit it any time a modification of the data on one side (serverside/clientside) needs to have an effect on the other side
otherwise the changes won't propagate between the two
that said, you want to limit the amount of transfers - otherwise you'll lag the server to hell
Hmm, a serverlag modโฆ
But yeah i figured that much that when i alter the moddata of my worldobject i should transmit that aswell
The other clients get the moddata when i tranmsit it right?
yes
transmitModData calls on server send to clients
basevehicles dont have a transmitmoddata.
all IsoObjects have it
but there are caveats to it not working as expected
zombies afaik don't save their modData
Luckily i dont interact with them
vehicles I'm told have issues with transmitting certain changes -- idk if that also applies to modData
I'm still trying to figure out how to prevent TV abuse with skill recovery journals
I can track the file and function the addXP call comes from
and I refactored the system to work with that as it's overall alot less work
isn't raw skill XP gain the point of VHS tapes? so if you have another source of raw skill XP gain (i.e. recovery journals) I can't imagine there's a way to remedy that. you're introducing more XP into the environment without any work, more or less
the rework is logging XP gained from flagged files/functions
going to see If I can compare the two
the previous version tracked listnedToMedia - which worked if they watched the tapes after reading
but not before unfortunately
also I don't have to calculate extra levels from professions/traits anymore
which was a bonus
also the TV xp isn't flat
but if you implement something like that, where VHS tape XP is ignored if it's "regained" through a journal, doesn't that imply that the dead person who wrote the journal... wrote down what happens on the VHS tape? idk how I feel about that 
in the impacted by multipliers sense
Dear diary, today I watched that builder man that my grandma loved so much... I didn't get it before, but now in the darkness that is this world, I get it, grandma. RIP.
Note to self: all constructions require, more or less, two planks and two nails. And then you just hammer away, and the shelf builds itself.
The journal is meant to offer a means of not starting over - if they can just suicide and rewatch the VHS is kind of breaks things quickly
but that's already the point of VHS tapes, in function
I guess I could makes things very simple for myself and just lock out that XP entirely
game design
I guess I just don't see the point unless the goal is for the journal to be a stronger, less balanced version of the VHS tapes
the issue is that it could stack
because if you're in MP and returning to your old base, the VHS tapes already serve as a sort of "regain your skills without grinding for hours" platform
so that gap seems to be filled, so I'm missing the point of the journal unless it's just a direct upgrade
(but yes, you definitely wouldn't want them to stack, either way)
philosophically I just thought it was a neat idea to help cushion newer players - some factors with having to craft it constantly update it make it balanced
I never really looked at the VHS as a means for that tbh - but that is an interesting idea
I'll definitely include a sandbox option to lock out VHS XP entirely
Hey, can anyone help me trying to set Mod Manager up?
Is there supposed to be a UI or something?
also, I think I wrote the mod before skill VHS were a thing - not sure
if it's the one I'm thinking of you definitely did - I remember using one way back for that exact reason. then VHS tapes came out and i was like "ah, that's how the devs are going to solve that problem. neat." (but I'm not married to one or the other conceptually, just struggling to see the need for both other than for flavor reasons or if you think VHS tapes are too strong/not strong enough)
ty
from a game design standpoint - if you consider the player's time/effort I prefer to place it on maintaining their journal rather than after the fact in making them sit around watching VHS
not knocking VHS as it adds more things to find + circumvents the grind
yeah, I think there's definitely an argument there. I think I see the tedium as punishment though, which is honestly how Zomboid handles a lot of balance. not necessarily bad, but not exciting either
basically how I view it - if you dont want to put time into a journal you can watch VHS and burn through resources sitting around
but with the journal you have to becareful not to lose it - and make the judgement call of 'do I take it with me to keep it up to date' or 'leave it and update it when I get back'
I would also recommend anyone using it to set the return % to atleast 70
but most people use it when teaching new players
I may also make it use up the writing tools + require maintenance if read repeatedly
i wonder how interesting a rework could be, with design in mind for the whole journal concept. swap XP into "perk points" more or less, and buy different perks at different levels for a given skill. that'd make the whole journal thing neat, because you could lose certain perks at random in the journal (pages? idk) so you'd only have bits and pieces of the information
obviously would be much more of an endeavor to implement (especially in terms of compatibility with other mods), but I think something like that would be pretty neat
I used to have it only record fully unlocked levels
but I had to change to raw XP due to the way XP is calculated
Where can I find the logs for these errors on a dedicated server?
C:\Users\YourPCName\Zomboid\Logs
^^ there
I thought so too, but doesn't seem like it.
It's currently xx:42 right
If I trigger the error, my logs haven't updated
If you're the host the serverside errors appear in coop-console.txt
then the errors would be in C:\Users\YourPCName\Zomboid\ console.txt
Speaking of which - I think I figured out the issue with why it is transcribing multiplied XP lol
The XP multiplier hashmaps are a big headache I was hoping to avoid
same spot on the server.
yep - I can avoid dealing with XP mult maps
the issue was passing arguments using or due to some being false
and since false exists it was flipping to true ๐ค
because zombies are local
you also cant transmit player modData because they are local too
well yeah
player zombies might save their modData as their outfit isn't from an ID
they should save their modData as long as theyre visible
but once they despawn it be gone
that's kind of poo poo
unless theyre doing a if zombie then return like they do in several places
wait a sec
getPipedFuelAmount is a function in isoobject
you can pipe fuel from players
( อกo อส อกo)
time to matrix up some survivors to produce methane
Hey @sour island - sorry to bother. What is "Journal XP Used When Read"?
Even with the tooltip I'm not too sure
One time item?
It deletes the journal?
The XP when read is used up
The XP when read?
Is used up?
What XP?
I'm really confused, sorry haha
So basically what it means is
After reading the journal
The journal no longer works
You have to re-write a new one
Correct?
How do you spawn items in your inventory?????
getPlayer():getInventory():AddItem("Base.Rake")
perhaps I should make it allow you to add onto it but once read destroys it
i too rip apart the book i read
but basically it means on that specific journal, XP you gain can only be recovered once
if you gain XP later you can store and recover it - once
tfw you forget to include the modules name
There's a litter mod that makes literature items leave behind trash - the nude mags leave behind 'worn out magazine'

You don't need the module if the module is 'Base.' btw
The books leave behind 'ripped apart books' - so that survivor is just really working out their forearms
I have an idea for a mod and was wondering if I could get some feedback. Is it ok if I post my notes here?
I mainly want to know if it seems too ambitious, and if it's technically possible with the limitations of the modding framework.
Zomboid mod idea:
mod requires you to travel to each major city on the map to obtain blueprints for special items used to repair the escape helicopter. The blueprints are stored on computers which need to be powered. The computers are also connected to each city's tornado siren system which attracts zombies when activated. The siren system will be accidentally activated while the blueprints are being extracted onto a floppy disk. the floppy disc needs to go into a prototype VHS tape that can display the contents on a TV with a VCR. The blueprints will then require players to go to random locations to obtain 3 special items each. however, the helicopter has a VERY loud tampering alarm that draws in zombies from MILES around and even enrages some of them, turning them into sprinters. Once you start the escape sequence, the hacking tool that you made will take 3 ingame days to prepare the helicopter for takeoff. during this time, you will have to defend against the enraged zombies who can now even tear down large walls. they will get in and they will come for you. all tiles a certain distance around the takeoff zone will be blocked off by something (thick horde of stationary zombies?) to prevent the players from leaving. any player outside the zone at this time will die, and new character spawns will be disabled during this event. If the event is survived, the opening text displays again but instead says "this is how you survived".
the player must:
- interact with computer in each major city to receive floppy disk
- defend against hordes of zombies during this process (they will seek player) - process will last a few ingame hours.
- find four secret VHS floppy reader prototypes (the floppy gets stuck and can't be removed)
- watch floppy disks on four different TV's (the floppys brick the TVs and max out their volume, prompting nearby zombies to investigate)
with newly acquired blueprints, the player now must:
- locate 3 items per blueprint (12 total) scattered in random locations.
- one can be fished up with a low chance. (treasure map style, high fishing skill). item name: rare waterlogged component
- A zombie carries one - he is located in the mall among a massive hoard. item name: strange biological anomalie
- one is found when disassembling a rare type of radio. (requires high electrical skill. there will be three in the world at set locations - radio stations if they exist) item name: rare communications component
- one is found in a rare model of car. (there will be three in the world at set locations. high mechanic skill required) item name: rare engine part
one has a treasure map that shows where it can be dug up with a shovel. (requires high farming skill to successfully dig up. there can be three of these too.)
the rest can be randomly scattered across the world unless better ideas come up. they can just be called rare components. this way, each recipe requires one unique rare items and two rare components.
finally the player must:
-
build the repair components
-
locate the helicopter.
-
set up defenses to survive the final conflict
-
add components to helicopter
-
begin helicopter startup sequence (player will be warned that they have discovered an anti tampering system that will require higher mechanics and electronics than before - maybe 7 or 8 each - to hack through. player will be warned that once hacking commences, the alarm WILL be set off and will attract zombie hordes the likes of which they've never seen. player will be warned to prepare extremely well before the encounter.)
Is this directed at me?
The lore explanations for the events can be changed because I know they're dumb, but the core idea is to add meaningful long term goals that encourage the player to engage with all aspects of the game from exploration, to combat, to building, to leveling skills.
Hi again all, just wanted to use similar mechanics that claustrophobic trait uses , any ideas where that is located in the files?
Oh you're like those Reddit guys, I go there time of time to get ideas and things like that, there are people really interesting
So is this your way of saying there are too many ideas to implement?
I'm looking for some real feedback.
^^ a real feedback
That's all I needed to hear
So if I scoped this WAY down to like "travel to four major cities and collect four things", would that sound more possible?
it would yes.
but still still having those would have to be FORCED spawns in certain locations.
no "random" to it easily.
Yea, trying to make it random sounds like a nightmare
i mean it's POSSIBLE to randomize it by saying pick a random container in the list of container in this cell.
but that's the best i could offer as trying to stick it on a zombie would be about a bitch to do.
Yea, of course I'll be starting with a stripped down proof of concept
If I wanna try to get crazy I can look at that stuff later but I understand how complicated even simple things can be, especially in a modding environment with limited access to things.
man this XP stuff is kicking my ass
some of the skills are transcribing 1:1 properly - but others seem to be getting their multiplier applied
attempted index: N of non-table: null
LOG : General , 1672179814179> 36,994,035> -----------------------------------------
STACK TRACE
-----------------------------------------
function: spawnTrailer -- file: KYRPT_clientcommands.lua line # 11 | MOD: KYRP Trucking mod
function: onClientCommand -- file: KYRPT_clientcommands.lua line # 52 | MOD: KYRP Trucking mod```
would that be this?
nvm i found it. i are a derp
This is what I referred to as messing up the directions:
[IsoDirections.S] = 135.0,
[IsoDirections.SE] = -135.0,
[IsoDirections.SW] = 180.0,
``` I don't know why your code is throwing out that error
What was the issue?
also make that table local
One more question - when I said "random locations" before, I pretty much had the idea that I might be able to make a short list of predetermined locations to put things at and randomly choose from those. Does that sound technically possible, and within reason to accomplish?
so i'm looking at foraging, I want to catch amount of herbs player picks up, but from what I see it handles them in array? Or am I misunderstanding something?
function ISForageAction:forage()
forageSystem.doFatiguePenalty(self.character);
forageSystem.doEndurancePenalty(self.character);
forageSystem.giveItemXP(self.character, self.itemDef, 0.75);
--
-- add the items to player inventory
-- these items are generated when the icon is first spotted in self.forageIcon.itemList
local itemsAdded = forageSystem.addOrDropItems(self.character, self.targetContainer, self.forageIcon.itemList, self.discardItems);
local itemsTable = {};
for i = 0, itemsAdded:size() - 1 do
local item = itemsAdded:get(i);
if not itemsTable[item:getFullType()] then itemsTable[item:getFullType()] = {item = item, count = 0}; end;
itemsTable[item:getFullType()].count = itemsTable[item:getFullType()].count + 1;
end;
--
--create the halo note, injecting the item image
--TODO: this requires item images to be in media/textures - should get the image location from the texture here instead
local itemTexture;
for _, itemData in pairs(itemsTable) do
local item = itemData.item;
local count = itemData.count;
if item:getTexture() ~= nil then
if string.find(tostring(item:getTexture():getName()), "media") and string.find(tostring(item:getTexture():getName()), "textures") then
itemTexture = "[img="..tostring(item:getTexture():getName()).."]";
else
itemTexture = "[img=media/textures/"..tostring(item:getTexture():getName()).."]"
end
else
itemTexture = ""
end
if not self.discardItems then
table.insert(self.manager.haloNotes,itemTexture.." "..count.. " "..item:getDisplayName());
end;
end;
end```
it does, and could be done pretty easily... could also have a bit of randomness by doing like i said.
so it's not spot 1 2 3 it's random spot between 1 and 80
could be the first one you open, could be the last.
Alright thank you
๐ค radio interactions calls addXP(+50) 6 times for 300 XP but it only nets 75
sprinting around addXp(+1) = 1 XP
how would i write a simple func with on RMC with check car near clicked square and print moddata
basically... AUD does not do car moddata.
Hey hi, is the current save's in-game date / time exposed somewhere in the files?
I know the RADIO_SAVE file has the days passed, but an exact date + time would be superb
The GameTime object is stored in map_t.bin in binary. I'm working on a decoder for it but it's nowhere near ready to make public (undocumented, incomplete). I can send the current version of it your way once I'm at my computer though
Hm
I guess the second best thing would be making a mod that just logs it to a file every minute or so
seems like the xp issue was an old player jacked up from errors again - and it works
And grabbing it from there
there's functions for in-game time
Yeah, I'm writing a fairly extensive Discord bot for Zomboid server management
Think log browsing, player data management, etc
Was hoping to get an accurate time reading from the files without a mod
But alas
Is the RADIO_SAVE file updated live, or only on server shutdown / save?
Ok so I managed to catch items player picks up. What I did is literally just copied base game code and chaged it a bit to catch what I wanted, but now it throws error in log (not red interrupting ones, just general error in console.txt)
local original_forage_forage = ISForageAction.forage;
function ISForageAction:forage()
local itemsAddedShadow = forageSystem.addOrDropItems(self.character, self.targetContainer, self.forageIcon.itemList, self.discardItems);
local itemsTableShadow = {};
for i = 0, itemsAddedShadow:size() - 1 do
local item = itemsAddedShadow:get(i);
if not itemsTableShadow[item:getFullType()] then itemsTableShadow[item:getFullType()] = { item = item, count = 0}; end;
itemsTableShadow[item:getFullType()].count = itemsTableShadow[item:getFullType()].count + 1;
if not self.discardItems then
print("DTW Logger: picking up item: "..item:getFullType());
end;
end
original_forage_forage(self);
end
LOG : General , 1672182718850> DTW Logger: picking up item: Base.Twigs
LOG : General , 1672182718851> DTW Logger: picking up item: Base.Twigs
LOG : General , 1672182718851> Error, container already has id
LOG : General , 1672182718851> Error, container already has id
LOG : General , 1672182718851> Error, container already has id```
Do I care about those? It works and picks up items and stuff
idk what radio_save is - are you trying to get server time or in-game date like day/month/year?
in-game time
Preferably from a file / command / etc
The bot runs locally on the server, so it has full access.
RADIO_SAVE.txt is a file that keeps track of some radio related things, and incidentally also has a DaysSinceStart value
Which is reasonably useful
A more accurate value would be nice, though.
no... there's a gameTime object
has all he needs
public PZCalendar getCalender() {
this.updateCalendar(this.getYear(), this.getMonth(), this.getDay(), (int)this.getTimeOfDay(), (int)((this.getTimeOfDay() - (float)((int)this.getTimeOfDay())) * 60.0F));
return this.Calender;
}
from the java
Same here, but for personal use ๐ I intended to release the decoder I've used to read player data + that, but right now it can only reads data from the current version which is not ideal
(Why did I write it to only read data from the current version? Because I lack foresight, that's why)
Issue is I'm running the bot separately from the game right now. Interfacing using RCON and the game's files
So, if there's a non-mod-required way to grab this, it'd be superb.
Sounds like I'm doing the exact same thing you are, so yeah there is
I'm running a web server on the same vm I run the game server on which provides the data using RCON and reading files
If you want information from the game you could just have it print to a file
Not sure why non-mod would be ideal - you'd be digging around in hopes of scraping off the needed info
Not really digging around imo, since the time is just stored as numbers
(that is, if you know the format it's not guesswork)
I mean if he's adamant about not using a mod - he'd have to find a place that already has the information he wants
See here
Ohh, I see what you mean, I think
You're saying for any new feature not covered he'd need to keep digging for stuff, yeah?
Even for time, you can easily access the gametime object in a mod and have it print to a text file
in whatever format you want
although, grabbing the information from the save is clever
seems like alot more work
I don't disagree, but personally I prefer not requiring a mod for stuff like that
Yeah that's definitely true, I might go with a mod if I didn't want to have the versatility of having all the data
You're looking for GameTime's Calender var btw
should be a list of numbers = this.updateCalendar(this.getYear(), this.getMonth(), this.getDay(), (int)this.getTimeOfDay(), this.getMinutes())
it's a java calendar, so the format should match that documentation
how would i select a vehicle at a certain square
something is up with the TVs
based on addXP() calls I should have 300XP
I might just make it ignore TVs and say it's balanced gameplay
i am going to have an annuerism.,
I just had one
I've been messing with XPs that are all flat
but it is applying the multiplier afterall
I was using sprinting but they cap the xp to 1
I've been going around in circles avoiding the xp maps
welp, here I go I guess
I fucking did it
took 30 min and digging in base game code (thanks inteliji) but i did it
local original_forageSystem_addOrDropItems = forageSystem.addOrDropItems;
function forageSystem.addOrDropItems(_character, _inventory, _items, _discardItems)
if (not _discardItems) then
for item in iterList(_items) do
print("DTW Logger: picking up item: "..item:getFullType());
end;
end
return (original_forageSystem_addOrDropItems(_character, _inventory, _items, _discardItems));
end```
last error I resolved was that i wasnt returning original function
and in base game code it returns stuff
and i was like
why no workey workey
ok new question, you know how you can forage stuff and stuff is divided in categories, like junk, ammo, medical herbs
is there a way to access that table?
like lets say i want to get data what medical herbs can spawn
for scripts/items.txt if i'm trying to call icons from other mods, what do i need to preface the script? i saw Import but how can i find out what i need to import?
like for base vanilla icons we'll say to start ๐
NM i just had a spelling error ๐
function CheckCarModData(vehicle)
if (vehicle) then
}}} if (vehicle:getModData() ~= nil) then
for k,v in pairs(vehicle:getModData())do
print(vehicle:getScriptName() .. " has K: " .. k .. " & V: " .. v)
end
else
print("No Moddata found on " .. vehicle:getScriptName())
end
end
end```
the line with the }}} throws Object tried to call nil in CheckCarModData
wth man
can't i do something like this?
local herbs = {
"Base.Plantain",
"Base.Comfrey",
"Base.WildGarlic",
"Base.CommonMallow",
"Base.LemonGrass",
"Base.BlackSage",
"Base.Ginseng"
}
if item:getFullType() in herbs then
print("DTW Logger: picking up medical herb: "..item:getFullType());
end```
oh table needs to have keys
for that to work
what in the python am i looking at
function convertNumericListToKeyedTable(list,tbl) for _,value in pairs(list) do tbl[value]=true end end
```If you're lazy, lets you write out simple tables and then convert them into one that can use `list[n]` to check if a value is there
the conversion should be called once - can even leave it out of a function so its called when Lua is loaded
already did it this way but thx
for _, herb in pairs(herbs) do
if herb == item:getFullType() then
--print("DTW Logger: picking up herbs: "..item:getFullType())
local modData = player:getModData().DynamicTraitsWorld
modData.HerbsPickedUp = modData.HerbsPickedUp + 1;
if modData.HerbsPickedUp >= SBvars.HerbalistHerbsPicked then
break
end
break
end
end```
modData.HerbsPickedUp is defined somewhere right?
ye
I got lua where i keep my modData organized and I require it on all my other luas to make sure it loads it first

less typing for me

hey Chuck while I have you here
do you know any smart way of stopping my function from injecting itself into base game function on condition basis?
like I want my function forageSystem.addOrDropItems(_character, _inventory, _items, _discardItems) execute only if XYZ condition is met
(trying to minimize amount of things that can be ran without any need)
uh
Just put an if here:
local original_forageSystem_addOrDropItems = forageSystem.addOrDropItems;
function forageSystem.addOrDropItems(_character, _inventory, _items, _discardItems)
if (not _discardItems) then
for item in iterList(_items) do
print("DTW Logger: picking up item: "..item:getFullType());
end;
end
return (original_forageSystem_addOrDropItems(_character, _inventory, _items, _discardItems));
end
Seems like you do?
like here's example
local original_forageSystem_addOrDropItems = forageSystem.addOrDropItems;
function forageSystem.addOrDropItems(_character, _inventory, _items, _discardItems)
if not _character:HasTrait("Herbalist") and (not _discardItems) then
for item in iterList(_items) do
--print("DTW Logger: picking up item: "..item:getFullType());
local herbs = {
-- deleted for readability
}
for _, herb in pairs(herbs) do
if herb == item:getFullType() then
--print("DTW Logger: picking up herbs: "..item:getFullType())
local modData = player:getModData().DynamicTraitsWorld;
modData.HerbsPickedUp = modData.HerbsPickedUp + 1;
if modData.HerbsPickedUp >= SBvars.HerbalistHerbsPicked then
_character:getTraits():add("Herbalist");
HaloTextHelper.addTextWithArrow(_character, getText("UI_trait_Herbalist"), true, HaloTextHelper.getColorGreen());
break
end
break
end
end
end
end
return (original_forageSystem_addOrDropItems(_character, _inventory, _items, _discardItems));
end```
I use this to catch herbs that player picks up, and I don't want to do that anymore after they got the trait. I put condition inside first if, is that pretty much the best way to go about it without doing too many unnecessary things?
also, is _character == getPlayer()? assumed it is but havent tested it yet 
o
hmm
I'd only suggest implementing a key'd table - but idk how much more performance you can get out of it
I mean honestly doesnt matter much
I hoped I could pick up plants dynamically from forage defs
To account for modded herbs
But couldn't figure it out so just defaulted to some herbs from base game
need to comm someone to make a mod for me


how can i give base maintenance xp for repairing a weapon? with no other mechanics to keep it simple?
vehicle:table 0x1639368150
can i just take
function ISFixAction:perform()
and add player:getXp():AddXP(Perks.Maintenance, exp); to the function?
if (IsoGameCharacter.this.Traits.Pacifist.isSet()) {
if (var6.getType() != PerkFactory.Perks.SmallBlade && var6.getType() != PerkFactory.Perks.LongBlade && var6.getType() != PerkFactory.Perks.SmallBlunt && var6.getType() != PerkFactory.Perks.Spear && var6.getType() != PerkFactory.Perks.Maintenance && var6.getType() != PerkFactory.Perks.Blunt && var6.getType() != PerkFactory.Perks.Axe) {
if (var6.getType() == PerkFactory.Perks.Aiming) {
var9 *= 0.75F;
}
} else {
var9 *= 0.75F;
}
}
I'm trying to figure out how to unBoost XP for journals to have true flat XP
Iterator var11 = IsoGameCharacter.this.getDescriptor().getXPBoostMap().entrySet().iterator();
label191:
while(true) {
while(true) {
Entry var12;
do {
if (!var11.hasNext()) {
```I can't even read this
Maybe I'm overthinking it
๐ค 0.25 * all XP would simulate the player having 0 starting skills
But wouldn't that cause issues with Slow Learner recovering more than the intended XP?
hey is it possible to somehow play challenge mode through sandbox
i wanna play winter is coming but i wanna edit some values so im wondering if its possible to put that in sandbox
Slow Learner, Pacifism, and mods that let you modify XP rates all make me worried about this particular approach ๐
not a modder just asking
my occupations mod causes a crash whenever i try to generate a random character or use a preset character.
Hmm
I don't think those would be an issue
does no one know
this is the only issue i really have with my mod but it's a pretty big one to not be able to use the preset button
The global XP mult would need to be accounted for ๐ค
How about Strength/Fitness XP? Since their default multipliers are different ๐
I have the true raw XP -- which is ironically large amounts - it's very strange most XP gets hit by a 0.25 mult
is it because i removed vanilla occupations? im using profession framework and havent seen any other mods that use this framework have this issue
and all the professions have starting traits with mutually exclusive traits, but it doesnt have any issue when it comes to normal character generation
I have the XP logic - I can translate it over to Lua
I'm just thinking if I have to
Strength and fitness have a caveat to their xpboost - very weird -- also the sandboxvar excludes passives -- but the code also mentions a second sandbox var
Makes the global mult impact passives too
Is that in game?
Whether or not you have to is a very good question. I imagine if all XP (at minimum) had a multiplier of 1.0 - you could just call AddXP with the boolean that disables multipliers.
To take care of multipliers below 1.0, I'm not really sure what to do for elegance - especially if you want it to be compatible with other XP mult mods.
I don't think that's in the game, but I always assumed the global XP mult impacted passives.
It doesn't
I am already disabling the multiplier
The issue is transcribing XP
When you use addXP it's by default at the least being *0.25
Well, it might be even less, with Slow Learner - should be 0.7 * 0.25 = 0.175 then.
Ideally the XP being transcribed would be that of a basic unemployed person
Yeah I can see that logic.
I don't really mind the slow learner tbh
But won't that cause issues where Slow Learners will transcribe ~42% too much XP compared to what they actually gained?
Fair enough. I'm concerned about players (on dying and re-rolling) getting rid of Slow Learner and suddenly having higher XP values than before.
That also seems problematic. Unless you adjust of slow/fast learner upon reading the journal 
They'd have spent the time for it - if not more time
The XP is flat coming out
The multiplier is disabled
That's why the transcribe part is the tricky problem rn
This seems a big departure from how it works, currently, just to clarify.
Currently, skill books can be used to get large amounts of XP to write down in the journal. ๐
I know -- before the transcribing was addng post addXP() XP
You could make use of xpBoosts from books, and jobs/traits
I imagine alot of people will upset/confused
< Confused! ๐
Especially when the numbers don't match lol
:0

Night, Chuck. I'm excited to hear what you figure out. I'll have to answer some of the same questions with my strategy, so ๐
I should be able to control TV issues though - I laid the ground work
๐ช
You could also tie in jobs and traits to the XP log to do what you want
That is definitely part of my thinking. Perhaps I'll even try something a little ludicrous like giving/removing traits while reading XP from my journal, so I don't have to hard-code any multipliers.
That way you could, for example, read a section by someone with Slow Learner, and temporarily have Slow Learner during that section.
i figured out my problem
needed to add a default profession without any free traits
is vehicle:getId() always the same?
For anyone that has done a little Melee weapon coding.
For the Melee weapon code, does anyone know for the section for "PushBackMod", Is it the lower the stat for push back is, the more push back it actually does?, or is it the higher the push back stats is, the more push back it does?
I am looking at the Baseball Bat stats and it is showing as having a "PushBackMod" of 0.5, while Dumbbells have a "PushBackMod" stat of 0.5 as well, but then other weapons such as the Broken Bottle and Machete have a "PushBackMod" stat of 0.3, so I am not sure, as how can a Broken Bottle and a Machete have more push back as a pair of Dumbbells, or if it is going in the opposite direction, how is it that a Broken Bottle has more push back than a Baseball Bat.
The same for "SwingTime" as well, is the higher the number the quicker it is, or is it the lower the number is the faster it is?
You released it cool
I give it a try tomorrow
Might be cool
Hi. Has anyone made a "Cause of Death" mod or any other way to see what I was taking damage from when I die? Or at least what moodles were active?
Is there a way to reload mods while the game is running?
like while you are loaded into a game? you need to use the f11 debug to reload the specific lua files manually
But this won't work for scripting files?
Is there some attribute to make items grabbable through the context menu?
My item can't be grabbed despite being identical to other magazines. It also seems to float a little.
Cool, thanks.
sorry
Events.OnPreFillInventoryObjectContextMenu.Add()
here
the first one is for tiles the second 1 is for items
what do you mean it can't be grabbed?
Via right clicking
like you can't take it from a container?
From the ground
with the grab option via right clicking
I spawned in another magazine to test and I can right click it and there's a context option that says "grab magazine"
Can't do that with mine.
Gonna try out that function though
The official documentation can't be trusted can it
what makes you say that?
I'm asking
it can be trusted
Ok cool
Sometimes stuff gets outdated and not updated
you call a function and find out it goes by a different name and takes different arguments now
for example
That's why I was asking
those docs are for 41.77, which means they are one version behind, but it's not major
As best I can tell, it's autogenerated from the actual code, so it can't get that far out of wack.
That's good to know.
as far as this grab thing goes, it doesn't look like it's something item specific or anything
it should work for any item... i'm not sure why it's not showing up for you
Perhaps no space in inventory? 
No that's definitely not it
I can pick it up through the loot menu and it works for another magazine
Just not the one I created
The item has a bad tooltip, but I don't see how that could affect it. I assigned a tooltip name that doesn't exist.
It has an actual name
But I'll give it a tooltip from another item and test just in case
Hi, how to disable a context menu that placed inside another contextmenu? I tried to disable some some contextmenu from More Building > Architecture > Wall Style > Gray Cinder Block > Gray Cinder Block Fence (this is the menu I want to disabled since it's buggy and exploitable by players)
You don't need to overwrite the tooltip at all, unless that's the entire point ๐
Are you saying it's valid for the item to just not have one?
If so, do I take the "Tooltip" key out as well or just leave the value blank?
I tried using this event, but it's only trigger after I right click in the first time to open the contextmenu, so It says error because the script can't find "ContextMenu_GrayCinder_BlockFence"
local function OnFillWorldObjectContextMenu(player, context, worldobjects, test)
local optionName1 = getText("ContextMenu_GrayCinder_BlockFence");
local opt1 = context:getOptionFromName(optionName);
opt1.onSelect = nil;
opt1.notAvailable = true;
opt1.toolTip = nil
end
Events.OnFillWorldObjectContextMenu.Add(OnFillWorldObjectContextMenu)
lol im trying to make all containers locked by default or atleast the stuff are hidden.. but what i accidentally did was every thing is empty... could be a usefull code tho
This is an example of a perfectly ordinary custom item.
Cool, tooltip is gone then. We'll see if anything changes.
Probably not the exact issue, but perhaps you could show the source item, and your modded item so we can see the full changes? ๐
/*Source*/
item MechanicMag1
{
DisplayCategory = SkillBook,
Weight = 0.1,
Type = Literature,
DisplayName = Laines Auto Manual - Standard Models,
Icon = MagazineMechanic1,
TeachedRecipes = Basic Mechanics,
ReplaceOnUse = MechanicMag1,
Tooltip = Tooltip_item_MechanicMag1,
StaticModel = Magazine,
WorldStaticModel = MagazineMec1Ground,
}
/*Custom*/
item HeliBlueprint1
{
DisplayCategory = SkillBook,
Weight = 0.1,
Type = Literature,
DisplayName = Helicopter Repair Manual Volume 1,
Icon = HeliBlueprint,
TeachedRecipes = HeliComponent1,
ReplaceOnUse = HeliBlueprint1,
StaticModel = Magazine,
WorldStaticModel = MagazineHeliBlueprintModel,
}
and also this:
model MagazineHeliBlueprintModel
{
mesh = WorldItems/Magazine,
texture = MagazineHeliBlueprint,
scale = 0.4,
}
No alarm bells ringing here. Very strange about the missing context menu option. There must be something adding the Mechanics Mag to the context menu, since it doesn't straight up use the DisplayName or Category. (Unless the StaticModel is used for the context menu, which seems crazy)
I'm not finding it in the lua code easily. What was the phrase again "Take magazine"?
Grab magazine, you said.
Grab > "Item name"
Well it can't be the item name, surely, the other item is called "Laines Auto Manual - Standard Models"
For example - Grab > Electronics Magazine Vol. 1
Maybe item name was inaccurate
It's the item name
It does say "Grab > Laines Auto Manual - Standard Models"
At this point my best guess is your magazine is just in a cell that looks like you're clicking on it, but really it's in one of the cells nearby. Try picking it up, then dropping it from the inventory (without drag and drop) and see if you can right click at your feet.
Yea, I wanted to mention it seems like it might be floating a bit
(or if you do drag and drop, do it from inventory panel to inventory panel, rather than from inventory to world)
parts of the character model clip UNDER my custom magazine whereas that is not the case with the default ones
It's REALLY minor though.
What's the best way to disable xp gain for a recipe?
can anyone help. why my code isnt working
SES_C = {}
function SES_C.containerLockOutContext(worldobjects)
for _, v in ipairs(worldobjects) do
local square = v:getSquare()
if square then
for i = 0, square:getObjects():size() - 1 do
local object = square:getObjects():get(i)
if object:isContainer() then
if object:getModData()['spawned'] ~= true then
object:setCanBeLockByPadlock(true)
object:setLockedByPadlock(true);
if isClient() then object:transmitCompleteItemToServer();
object:transmitCompleteItemToClients() end
getPlayerLoot(0):refreshBackpacks()
object:getContainer():setDrawDirty(true);
end
end
object:getModData()['spawned'] = true
end
end
end
end
Events.LoadGridsquare.Add(SES_C.containerLockOutContext);
Try loading your model and the mechanics model into your editing software and see if you can see any immediate differences. Maybe you're off-centre.
I didn't edit any models.
The custom model I'm using is just the mechanic mag model but with a different texture. That's the bottom part of the stuff I copied earlier
nvm, I already did this, derp.
OnGiveXP:Recipe.OnGiveXP.None,
This is so minor but it's really bugging me
You sure it isn't the thing Glytch3r recommended?
Events.OnPreFillInventoryObjectContextMenu.Add()
That's how you'd add it manually, but I doubt every item in the base game has this done manually.
Have you created custom items?
I'm loading up the game with one now, no modifications to models.
bruh
I think it's related to how your model is acting, based on the info we have.
The warning appears with the doors and trunk, I think it has to do with their animations, because it does not happen with the hood animation
I haven't even started writing code yet and I'm having this many problems
With the original data just copy/pasted it works as it should. That's interesting.
Well this gives me something to go on
Thanks for the help
Re-reading your stuff, I'm not sure it's the model. But maybe try changing just 1 thing at a time, just to see when/if it breaks ๐ฆ
Yep, will do
I didn't mention this, but I had 4 items in that file with similar attributes
I removed them
Could be that's actually what fixed it. Maybe it was syntax related somehow.
You're not going to believe it man
It's the fucking icon
Idk HOW
IT WHAT
Ok so I am using a file that's probably way too large
but
I just
I just don't understand
Sure enough, used the smaller version of the icon that I use for the magazine texture and it works.
That's absolutely insane. This is going to be a wild ride...
Thanks for proving that my item was not behaving correctly. All fixed now. I'm going to bed...
Hi all. I create a special bag in my mod (name TBoT.tbag) and spawn only one in the PZ World. I assign the variable tbag to this container to add some item in game. But when i reload game or create new caractere in the world, il loose the variable tbag ans so i can t add item in the bag.
My question, How can i keep the id of the bag in memory when i reload the game and reassign it to the variable tbag ?
make it read write the data
that way you will be able to retrieve it
i understant but if i write the variable tbag it send me an error....
no imean write it on a file
i understand :
local player = getSpecificPlayer(0) tbag=player:getInventory():AddItem("TBoT.Bag_TBoT") local textebot=getModFileWriter("TBoT","tbag.txt",true, false) textebot:write(tbag) textebot:close()
Send me an error and write nothing
check if the file is actually there
and how you are reading it
print it to double check
the file is present but empty
cuz you did send it but when you read it it might be read as 1 string or array or what not
dpends on what you want it to be
ah then you might have to fix that writer
cant u use moddata?
waht data are you storing it exactly
i dont know modata a quick explanation or link to understand ?
You cant save a java object
tbag=player:getInventory():AddItem("TBoT.Bag_TBoT")
tbag is the container... i can add item in it after that with :
tbag:getInventory():AddItem("Base.Pistol")
but when i reload the game tbag is empty
what is it that you are trying to achieve in the first place?
i give a bag to the player. he can put the bag everywhere. And script can interact directly with the bag in certain circonstance to give item
what do you mean by he can put everywhere
it s a bag.. he can put the bag on the floor
cant you just spawn another one
ahh thehn when u respawn you want the bag back to the player?
no , this bag was representating a sort of base. Keeping item Receive antoher one by script etc...
non i only want to obtain the bag ID to add item in it
i dont get it
there s only 1 bag in a world
idk.. id just despawn it and respawn it if it was my proj
like browser said you cant store the obj
how can i recup item in it and despawns it after reload ?
store it on an array
or table
someone else with more exp should help you this mod your trying to do is far to complicated for my experience
goodluck
thx for your help. You give me some idea
You cant do it that way
is there a way to see all possible events in-game? Or more specifically is there an event for when a player is freshly spawned in?
new character or started playing
new char freshly made
so also should fire when you die and make a new char in the same save file
could use oncreateplayer and store in moddata if youve performed whatever you want to
does it fire when i make a new char after my previous died?
should do
yep just found it
thanks
local function onCreatePlayer(playerIndex, player)
local wallet = getPlayer():getInventory():AddItem("VM.Leather_Wallet")
wallet:getInventory():AddItem("VM.10Bill")
wallet:getInventory():AddItem("VM.5Bill")
wallet:getInventory():AddItem("VM.5Bill")
end
Events.onCreatePlayer.Add(onCreatePlayer)
What am i doing wrong here??
hey guys i just want to ask
can somebody explain what this modifiers all about?
ToHitModifier
AimingPerkCritModifier
AimingPerkRangeModifier
AimingPerkHitChanceModifier
AimingPerkMinAngleModifier
why are you doing getPlayer? you already have the player
yeah that too, but it doesnt fire even after i fixed the name to OnCreatePlayer
that was the correct name of the event
actually where do such things go folder-wise?
client
hmm, seems like that doesnt fire for already active saves
i started a new save and it does work but on my already present save
did you enable the mod in the main menu or in the save
try this :
local function CreatePlayer local player = getSpecificPlayer(0) player:getInventory():AddItem("VM.Leather_Wallet") player:getInventory():AddItem("VM.10Bill") player:getInventory():AddItem("VM.5Bill") player:getInventory():AddItem("VM.5Bill") end Events.onCreatePlayer.Add(CreatePlayer)
Did u fix all of the times u mentioned it or just function? U have to fix it on the event too
The event itself
function OnCreatePlayer(playerIndex, player)
local wallet = player:getInventory():AddItem("VM.Leather_Wallet")
wallet:getInventory():AddItem("VM.10Bill")
wallet:getInventory():AddItem("VM.5Bill")
wallet:getInventory():AddItem("VM.5Bill")
end
Events.OnCreatePlayer.Add(OnCreatePlayer)
This is how it looks right now and it works how it should on the new save
What is it for?
Distributions.lua is responsible for spawning items in container right?
@neon bronze
ItemPickerJava is
but definitions are in lua, e.g Distributions,ProceduralDistributions, etc
Basicly
I want to modify https://steamcommunity.com/sharedfiles/filedetails/?id=2907683021
Thanks do you know by chance how the zeds loot is defined?
So i do not need to pick the profession to select the traits
If anyone is willing to help please dm me
zombie loot depends on their outfit, it's in table SuburbsDistributions.all. e.g "inventoryfemale", "inventorymale","Outfit_Inmate"
yeah it's pretty easy
or SHOULD be if the mod author didn't make it hard ofc
lemme sub to the mod so that i can make the traits non-profession
Wait just like that?
well yeah it shouldn't be very hard lol
Was thinking i would do it hands down by my self with a bit of guidance
do you want to do it yourself?
Yeah but with guidance of course
ok ill still download it just to see how its put together
oh he made it really easy to make it non-profession
i believe
right so are you inside the workshop folder
you dont need to be in UI_EN that is translations
Ah
you need to go to lua > client > insurgenttraits
Yep in there
right so
lemme get the uh
pz modding thingy up to show u
do you know what traits are profession only?
Basically all of them.
that shouldn't be the case...? all the traits seem to have profession set to off
this is how traitfactory.addtrait works
What?
and the boolean that's called "profession" is set to false in basically all of them
But if you run the mod.
let me run it rq
Ohhhh i see why it says profession false
it adds the traits to the trait menu when you select the profession
holdon imma have to do a bit of reading to see where that's handled
Oh, nice, I might borrow this snippet to spawn my Yogis with a copy of their books
Wouldn't that spawn the items every time the player loads in?
Good point; I'll modify it to check whether I have the item first
Heads up appreciated! @sour island
this might be a super niche question but is there any mod that lets you configure multiple screens
as in
having the hud dedicated to a monitor seperately so its not on top of gameplay would be lovely
There's a mod that let's you do something like that but I heard it's pretty janky
You can move windows off the screen.
For example, you can move ingame health info panel to the edge of the screen and further.
It DOES NOT help with the second screen/monitor.
nvm
I cannot help with this, but I do have a mod for selectively hiding parts of the hud that you don't need to see most of the time.
Totally hear ya, n.w.
ty tho
Yep!
Haha I am the play Sekiro hudless and feel like it's among the greatest things in singleplayer gaming kinda guy lmao.
oh i usually play fromsoft with autohud
besides ds1
i feel like sekiro hudless would be kinda annoying tho cuz i attack differently based on boss health lol
Haha I do not
I play Sekiro 100% pressure never get hit
That's always my goal
My goal is not affected by boss health
fair just like for example
Haha
mibu corrupted monk, for a handful of attacks you can either parry or dodge and get more hits in the punish
Hey @thick karma hello ๐
early in the fight, parrys do NOTHING because its on full health
(note, we are talking Sekiro, so I often fail in my goal.)
(my goal remains unchanged nonetheless)
lmao
get health lower, parrys do more, change attack strat :p
anyway offtopic xd
Haha eventually I got it all done but there were some tough fights.
fingers crossed a multi monitor hud mod comes out one day
I didn't literally no-hit most bosses but I did one-shot everyone in Sekiro terms (I played through game reloading on death, so I didn't use respawning)
ahh fair
i got to owl on a kusabimaru-only no-WA no-upgrade run but quit just cuz i got bored and the poison attack lmao
And I did no-hit a good handful of them after dying a lot
Hahaha yeah no judgment game is brutal
more of a souls palyer tho
That's what makes it so awesome
yeah
lol yeah
i was super dissapointed when i beat early genichiro after i went into ng+
cuz i was like "really, vanguard demon gave me a bunch of loot and a dragon god easter egg and sekiro i literally parry him then the same animation plays???"
In NG when you have nothing it's p rough but doable
i usually manage it on NG
TBH I had more trouble beating opening "unbeatable" boss of Elden Ring
That took more hours of practice for me than Genichiro
(with a Warrior)
meh i didnt like ER so never played another run, didnt actually beat it
(not with a damn bow and shield pssh)
The windows for not taking damage by dodging in ER are small, character is slow, and opening boss swings everywhere lmao
lol
Sekiro instinct to dodge toward things helped me win that, but it was still extremely hard.
i got to mohg margott margit mongoose (dude in lyndell capital with a sword thats the same model as the first required boss)
I played through ER with a Sifu buddy at launch
was like level 50 and just went... yeah nah im not having fun anymore
lmao
That game is a gem
i played er no magic no summons or spirit emblems
Oh yeah I never used magic in my first run lmao
Booooo
Cut counter dodge jump
And grapple when allowed
yea in march
I grabbed on Epic because I couldn't resist, was too hyped for that game.
fair
And I have resisted before
id argue its better to pirate it *then get it on steam but meh
I waited for FF7R (and I)
Ethically I could see that argument
well if you know ur gonna pay for it when it comes to steam anyway and stick to that moral, then its fine imo
means you dont give epic money, therefore tencent and even the ccp money lmao
But then again ethically probably better still to drop out of the society of greed and blood entirely, but here I am playing games and making them more appealing to people for free
lmao humanity!
@sour island
Unrelated to the XP thing you're working on, I think I found a reasonable way to do XP-while-reading with only decoration.
Essentially, when starting a read, ISReadABook:new, I set the number of pages on the book (and the unread page count on the player) to a suitable amount for the XP stored (and not yet read).
Then I decorate ISReadABook:update and ISReadABook:stop for updates to the read page count and whenever you successfully read a page, I award the next N xp.
It's fairly simple code, and means it has compatibility with read faster while seated, while walking etc. mods out of the box.
Definitely I hear you on that.
i just think its a shite company, every game ive pirated besides abandonware and played for over 2 hours ive bought on steam
except danganronpa 1 which i still have to re-buy actually
Anyone knows how you can add Scrollbars to your panel?
For sure. Honestly, if I had a reliable pirated copy available at the time I was trying to play Sifu, I would have been open to it
But ultimately I had $40 and didn't want to spend time looking, or dealing with update hassles, etc.
well now it's a bit late
lmao
they dont refund people even if they dont get their content ๐
hm?
Epic occasionally asks how you like games now
oh yeah
But nevertheless I answered honestly about Sifu
because big shareholders at game publishers dont like steam reviews
Because that game was 100% worth my $40
I think every 6 year old should have to beat Sifu without dying.
even tho basically all consumers love steam reviews because they are an amazing system for any site to have so clearly labelled
When they succeed, they can go back to normal school.
lmao
Why are you laughing at my plan for fixing America?
its my panic reaction when i see an idea so impeccable
๐
can we bring this to the UK too i believe we can benifit from such a system too
\[T]/
No doubt anyone with a brain knows Steam has among the best existing review mechanisms in capitalism for consumers
Not just in gaming
yeah
But shout-out to Amazon for adding the precise average in tiny font beside the โญ recently, that is pretty clutch
its like tim sweeny simply doesnt understand that steam is so dominant because of good features and putting the consumer first
Nice to not have to mouseover or click anywhere to know exactly what the positive rate is
I WISH Steam did that
they arent perfect, the refund systems ahve been hit and missed and they have fucked around and found out with french laws
agreed
they also spurred on the lootbox system with csgo and tf2 cosmetics but still steam just has so many features and stuff
a h
So now instead of being a bad representation of the scores of bad modders' mods, it's a bad representation of ALL mods that haven't achieved sufficient popularity.
Oof nice fix Steam
ahh igy
i prefer nexus anyway in general
its a bit less convinient and FUCK having to subscribe for download speed (and log in for any downloads)
but i find the site to just be rly nice to use and find old versions and stuff
(If you're unaware, your positive rate is not directly tied to stars until like 200 reviews on Steam, but shows up long before that. I have mods that had 93% upvotes that were showing up with 3 stars because they hadn't been rated enough. My 98% still has 4 stars).
oh thats so ass
Oh it's super ass
Someone showed up on one of my mods asking why it was rated so low when it works well
I was like TYSFM FOR ASKING lmao
im rly casual with mods and only tend to use popular stuff anyway but i see how that can fuck over new modders
Because I don't want to just whine about this at the top of my mod descriptions
But given a chance to answer someone in my comments oh yes.
yea
I see it as a huge and stupid and easily avoidable issue
thanks for the tip lol ill make sure to check actual comments and stuff on "low rated" small mods :p
Yes indeed I have learned the same

