#mod_development
1 messages Β· Page 100 of 1
yes, but we're talking about attachment points - which use a rotational offset from the bone translate
@tame mulch This file should be helpful for you when looking at internal types for event functions. (Wrote this for build 41.68 using the Wiki for Lua events)
All the event functions are there for what's known in 41.68.
THAt is whAt i am saying.
YOU HAVE TO ROTATE 90 DEGREES FROM THE PROP2 BONE
that's why you need to start digging at the code to find where each AttachmentType is defined and the entrypoint
you don't have to rotate "from" anything - it'll automatically use the bone's translate as the origin point.
(hence why it's an offset)
I sent you the old one prior to optimizations.
This is good for seeing what is actually passed for the events, rather than assuming them.
I'll also need to see what's changes since 41.68.
Well something certainly has to rotate from wherever it is to fix this. It's clearly a rotation issue, right? Skizot seems to be suggesting that the item is rotated in relation to the prop2 bone.
The rotation assigned to any equipped item clearly has to be relative. So the question becomes relative to what? I think @faint jewel is saying it's relative to the prop2 bone...
well your new attachment point, needs to be based off prop2 and rotated 90 fricking degrees.
i wish @late hound was here, he could use whatever buzzwords you would have to hear to understand what i am saying.
Maybe I'll ask Peach for clarification if they ever show up. No big deal. This does not have to get solved any time soon. Just a side exploration that has me bamboozled.
Yo skiz
I saw the light switches u made for nippy
I know its from a tile but lets say we have worldstaticmodels we want to place to the char. Is its hard to do or just correct placing and size?
If i have a
Thanks for the insight regardless. It definitely looks like a model problem to me, not a matter of this or that individual item being rotated wrong. Literally every in-game item looks wrong in my left hand.
if you have a WHAT?
yup.
if there is a way to OVERRIDE that I would like to know as well.
But... sure looks wrong to me.
A world static like the 3d that can be placed on the ground
i dont think it was that far planned out.
if you have a model i can help make it carryable.
it's a rotation issue on the model, not the bone
By "model" do you mean the hammer? Or the player character?
So you're saying the player's forearm is rotated wrong at the model level or what? What part of the player model do you believe to be rotated wrong?
GameSpeed = 0 is x1
no - the hammer model is attached to the player model - so it's an issue with the translate of the model that's being attached
For real? Sounds illogical but ok . I believe u haha
Like 1 = x1 , 2 = x5 , 3 = x20, 4 = x40
(you would only want to modify the bone position if you're making a new anim entirely - but you aren't doing that (yet))
So you think that every single model in the game is attached in this weird and subjectively wrong-seeming way?
it correspond to the option you have top right in SP
They copy-pasted this wrong strategy to the way they attach hammers, and machetes, and guns, etc?
huh? the vanilla attachments work fine lol, but if you're attaching something to a different bone entirely then it needs a reference for that bone in particular. the left hand isn't the right hand, in other words
it's not wrong by any stretch of imagination
the prop2 bone is wrong.
Have you even looked at the pictures I posted?
yes?
Look at how the player holds a pistol in left hand
because the model isn't set up to be held in the left hand.
it's set to be attached to a completely different bone
no - that's the bone
I hear you @faint jewel
THAT would fix ALL the left hand holding.
it'd also break a lot of stuff if you don't rotate it back, and it's a hacky fix at best
Bip01_Prop2
well then they need to fix the OTHER SHIT. because that's all hacky and wrong.
not sure what you mean by that, the items you hold in your left hand work fine
But they don't look right.
OOOOOOHHHH HPOSSIBLE IDEA
they do if they're offset properly - try holding a bag in your left hand
I don't think 0 = x1
but for some reason the server's game is paused π€
or the time just isn't set
Right but that is a fundamentally different item. I am talking about how almost everything but bags looks
the bags all use the left hand bone anyways.
yes, but it's the same concept
...yes
If you don't think the way the game draws your gun in your left hand looks wrong, I really don't know what to tell you, except, "Okay."
that's the point
dude lol
how are you not getting this
the rotation of the MODEL that's being attached to the BONE is what you need to set, for the left hand bone
it cannot use the settings that the right hand bone uses, because the left hand is in a different position with different rotation than the right hand bone
so you need to find where the rotation offset for attaching it to the right hand is, so you can make a similar offset for the left hand
you tell ME how to make a model have two DIFFERENT transforms then
because that is what you are saying.
or you want a SECOND model for the left hand maybe?
is that for the tools?
attachment bighikingbaglefthand
{
offset = 0.8790 0.2000 -0.0740,
rotate = 178.0000 -15.0000 77.0000,
bone = Bip01_L_Hand,
}
attachment hikingbagrighthand
{
offset = 0.8960 -0.1300 -0.0440,
rotate = -178.0000 -15.0000 100.0000,
bone = Bip01_R_Hand,
}```
that's precisely what I'm saying
@thick karma you can try changing the world offset for Hammer in that file - maybe it's using those values for the right hand attachment as well, as a sort of default?
Talking about the getGameSpeed function
I hear what you're saying, but what I'm saying is that if the rotation offset for each item's model or type of model is defined somewhere, that means that each of those models or types has the wrong rotation offset definiton, or NO rotation offset definition, for your left hand.
yes, that's exactly the case - because why would they have one set? they aren't meant to be held in the left hand in the vanilla game.
...that's not wrong, it just doesn't display the model
getGameSpeed don't get you the actual game speed but a int from 0-4 based on value you can select in SP
"Meant to" is just trying to pretend they didn't do it wrong.
you say we're not "meant to" hold a gun in our left hand
Not "meant to" hold a hammer
But we CAN
so meant to is nonsense language
you want them to implement offsets manually for every single bone on the player character? like what lmfao
every item + every bone combination
that's thousands of manual offsets
If they allow the equipping of items that way, and they look wrong that way, then it's fair to say the way they let us equip MANY items in our left hand is wrong
That's all I'm saying.
Always fun to watch Node install on a new computer..
except you can't use a weapon in the left hand, and you'd have no reason to equip a weapon in the left hand, except for using them as tools. and even then - don't they just not show up when you equip them secondary?
I didn't know if you attached those using the attachment debugger or not
the fact that no one has really cared about this before is just evidence that it's not really an issue
but you seem resistant to anyone pointing that out
its a matter of perspective π
lol sure @pulsar heath
its like the sendclient and sendserver
because it's not really "wrong" if you're already doing something weird in the first place, it's just not implemented behavior
for me its wrong the way they do it
From my perspective, running around with a big sharp blade pointed AT your own thigh is not ideal.
so... perspective π
But yeah, subjectivity and such.
It's wrong, and you're wrong. lol
then don't equip it in your left hand
there's no use for equipping it in your left hand, so why would anyone
he's making a dual weild mod.
if it were an issue, someone would care and would have fixed it (they haven't!)
lol deny that until you're dead, that's fine, but you're not convincing anyone
what's get gonna do? strap it to his dong? LOL
...no? lmfao keep it in his bag or equip it in his primary slot like a normal person
because, as I pointed out, there's no functionality implemented for secondary weapons
also, just so you know... ONLY CLOTHING can use those attachment points.
that's why this is probably the first time anyone is bringing this up - because it's an issue of the player doing something really stupid
finally done going through the error log from yesterday's test
No functionality except, as I pointed out, holding them, which is most definitely a functionality on the programmatic and aesthetic level.
...that's not true, at all
show me something that isn't clothing that uses them?
literally any item with a 3D model can use them. you can prove it to yourself in less than 10 seconds if you have the game open - click "Attachment Editor" or whatever it's called
also when items are equipped to back etc they count as clothing.
really?
that's not really the case
at all
it just attaches a model to the player at a given bone
that's why you can attach anything to any bone, using the debugger
well notice NOT ONE of the attachment use the prop bone.
which is what ALL the weapons use.
because that's handled by the AttachmentType property
I already said that, multiple times
(and also because zombies shouldn't be carring weapons in their hands!)
so the problem is the weapon "look" when equiped?!
@red tiger from my testing update seems to trigger at 10fps regardless of ui render speed
you sir, are wrong. you die on your hill but it's in the wrong spot.
cant you just ( a lot of work )
couldnt validate in code
This is why I use OnTickEvenPaused.
create "skins" that when equiped on secondary replace the original?
I don't know what you're smoking but I need some of it. It's all literally there in the code, you can go look at it
TIS's current UI implementation doesn't need a high-frequency update tick for UI soooo I guess this wouldn't be a priority for them to fix.
M3ss, the problem is, the attchment point for weapons in the left hand is rotated wrong in the player model. he SWEARS it's in the attchment points but not ONE attachment point uses the prop2 bone.
terrible usage
@finite radish If you can show us where the code orients a weapon (e.g. a hammer) equipped in your left hand in relation to your model / bones / anything at all... Please do.
I cannot find that.
you only ever need to update the ui whenever a new one is rendered
That would be far more useful than being told that it's actually not wrong. π
aka use render
Not if you pool all elements under one event register.
models are not orientated to sit on a bone - it's hard baked afaik
Element caching would be so helpful.
you still dont need to update that fast/slow
they do.
as in there's a model for the item and a model for on_floor
i promise you.
Omg multiple convo going on
Mod chats busy tonight
only ever at the correct time which is on render
I do not use render() because CPU logic should be outside of render()
if anything you could use OnPreUIDraw
which I don't get but I don't do models - it seems like it'd make more sense to reuse the same model files for floor/in_hand
prerender() works too.
isoGameCharacter.secondaryHandModel = this.addEquippedModelInstance(isoGameCharacter, owner, inventoryItem2, "Bip01_Prop2", inventoryItem2.getItemReplacementSecondHand(), b);
getItemReplacementSecondHand is tied to getItemReplacement, which is tied to getAttachmentType, which is tied to the item script wherein AttachmentType is set.
it doesnt matter if called render or not its just a name
if everything else works, just detect if is equiped as secondary and manipulate the model so that it looks properly equiped... isnt that a simple way to do it?
its simply the hook triggered when the ui is going to be drawn
I'm following what I've learned to be proper separation of render logic and cpu logic.. Even though the render methods for UI runs on the main thread.
It's just a force of good habit.
i understand from that perspective but tying this to ticks is not a good choice
So how is getItemReplacement rotating the secondary item such that it looks... like it looks... for so many items?
Not sure why TIS went with render-caching draw instructions for UI. I'm guessing the issue would be how Kahlua handles multiple threaded environments.
Is that Javaside entirely I'm guessing?
leads to either not enough updates or too many depending on ui fps settings
Models for attachments aren't rotated afaik - the only place I saw rotation was for world attachment
I'd prefer an async environment but I haven't tried to experiment with implementing that.
it's not - it's getting the AttachmentType and using an offset stored in that (maybe that world attachment offset we saw earier - I thought it was for Place Item but maybe it's not, who knows - it could also be stored in the model itself for all I know)
so since the AttachmentType is meant for a right-hand item and defined as such, it's using that data for the left hand as well
We're talking about how guns / knives / hammers / etc. look when attached to your left hand
There is a clear indication that they are rotated wrong at some point
Whether in the code, or at the model level, I do not know.
that would be the model
Skizot says model, Crater disagrees but I'm not clear on where its rotation IS defined, because I haven't yet seen that code.
rotated 90 degree
I faintly recall seeing that done in java
Skizot is saying the attachment point is rotated incorrectly, I'm saying the model is using a rotation transform designed for the right hand
it IS.
my issue with prerender is because i like using it for stuff like panels where it has a background and then you draw on top of that
i mean i've only been fucking with then for the past 3 weeks making all these damned held items.
easier to keep the background on prerender and only overwrite render for the rest without having to type again the background rendering
@sour island
Look at the series of pics
I see that
They appear rotated 90 degrees off of where they should be for the bladed weapons
The pistol looks all kinds of wonky
if it were, then the bags would also be attached at the wrong point, because they use the same offset format.
I recall seeing in the java for left hand it just flips the model
I kind of hope they support rotate and shifting in attachment scripts as they do for world attachments
Right, I see what you're saying. Skizot has a workaround but you're arguing the "proper" fix would be to have left-and-right-hand attachment definitions.
And I am arguing that attaching items to your left hand using code written for your right hand looks "wrong". π
And constitutes a "wrong" design
if only i had some popcorns... best debate i've seen so far in this channel π
what would be the right design? a whole new model?
i agree it looks wrong, that's why you're trying to fix it. it just hasn't been an issue anyone has really had until you brought it up, because people don't tend to equip weapons in their secondary slot (because there's no reason to, other than screwdrivers)
Any design... where the lefthand item looks correct
I think the code uses left and right hand definitions for holding backpacks e.g. @sour island
That is a perfectly "right" solution afaic
Because it makes things look correct.
My standards are not exactly unattainable
Just want a weapon to be held the same on both sides
Not too crazy lol
Seems p standard to me
I haven't checked myself, but my theory is that you could fix it one of two ways:
- implement the attachment points like the bags are implemented, and swap them via code
- create a new model with the proper offset and then use that to feed
AttachmentType, which replaces the offsets but not the model
Just because no one brings it up doesn't mean that 1) They know it's right (or wrong), and 2) That it would do something to report it.
I've had problems with bob and kate since 2014.
I'm just pointing out why it's not really an issue in every normal circumstance
but it is an issue overall
(because the offhand isn't meant for weapons)
if nobody sees the house on fire its still an issue
That's fair, and I know that, and I agree with this... I just don't have any need for that information. π
and future proofing stuff is always good practice
I am trying to solve a problem nobody has fixed, and knowing why nobody cares about the problem enough to fix it doesn't help.
yeah but this is more like... your upstairs windowsill that you can't reach without a ladder is dusty. like yeah, it's a problem! technically! but do most people dust their hard-to-reach windowsills? not usually. might not even see it without a ladder
but you do have a way to dust it
true!
which is not the case here
and that's precisely what Burryaga aims to fix
they should at least provide a "ladder"
if (var14.getPrimaryHandItem() != null) {
var11 = var14.getPrimaryHandItem();
} else if (var14.getPrimaryHandMdl() != null) {
var1.primaryHandModel = this.addStatic(var2, var14.getPrimaryHandMdl(), "Bip01_Prop1");
}
var12 = null;
if (var14.getSecondaryHandItem() != null) {
var12 = var14.getSecondaryHandItem();
} else if (var14.getSecondaryHandMdl() != null) {
var1.secondaryHandModel = this.addStatic(var2, var14.getSecondaryHandMdl(), "Bip01_Prop2");
}
No, it's more like if you got to someone's house, and they happened to install their doorhandles backwards, but reality wasn't designed to cope with that, so the door handle was rotated 90 degrees into the door in a way that made no sense.
While I swear I saw the models being rotated this part of the model manager implies the prop2 oreintation is wrong
but im still saying that if the code works for the interaction of the dual wield
as the arguments are identical
Exactly what @faint jewel believes.
if that were the case though, you'd also see incorrect behavior with the bags - but they seem to have their own offset handling
bags have models for left and right hands no?
that's what I just said
actually it's 1,2,3,4 not 0,1,2,3 forgot how lua table works
do they have separate models? that's a good question
or rather, a good insight, if you already know that to be the case
I'm lost about this convo because of the desire to compare semantics for the convo itself..
Sorry, I wasn't clear whether you finished your comment believing "you'd also see incorrect behavior with the bags"
the bags? i dont think so...
Because you would NOT expect the same problem with bags because there is a custom treatment of the holding of the bags...
ReplaceInSecondHand = Bag_GolfBag_LHand holdingbagleft,
ReplaceInPrimaryHand = Bag_GolfBag_RHand holdingbagright,
I assumed the t-pose of the model would properly transform the 4x4 matrix orientation of items.
so then rotate prop2. if you're convinced that's the best solution, then I'm not sure why you haven't gone with that already
I am not saying it's best, I am just discussing what everyone is saying; and it sounds like prop2 would need to be rotated in dozens of animations, which is a bit more work than I feel willing to do for a basic dual wielding mod to look right.
so bags have their own approaches
and the secondary hand attachment is probably rotated wrong
if they fixed the rotation of prop2, the extra models wouldn't be necessary
for the bags i mean
what Skizot said is technically true, but the attachment modification does exist in the scripts:
{
offset = 0.8920 -0.1530 -0.0670,
rotate = -178.0000 -15.0000 100.0000,
bone = Bip01_R_Hand,
}
attachment bighikingbaglefthand
{
offset = 0.8790 0.2000 -0.0740,
rotate = 178.0000 -15.0000 77.0000,
bone = Bip01_L_Hand,
}```
which probably corresponds to the models you just showed
those are for SPECIFIC BAGS.
yes, we can see that π
I don't think anyone believes "bighikingbag" is referring to a generic bag
attachment duffelbagrighthand
{
offset = 0.3440 -0.1810 -0.5550,
rotate = -7.0000 57.0000 77.0000,
bone = Bip01_R_Hand,
}
attachment duffelbaglefthand
{
offset = 0.3410 -0.1830 -0.5710,
rotate = -7.0000 57.0000 77.0000,
bone = Bip01_L_Hand,
}
you know what. fuck the stress. you are right crater. you are super jesus of PZ. now tell him how to fix it rather than going "you're wrong"
if you don't know then stop talking.
I've explained how to handle it multiple times
yeah, it really is. no clue why it's done that way
but you don't.
I don't what? 
you want him to make a hammer into a bag. the attachment do NOT work that way
...it's just a model, man. it doesn't care if it's a bag or a hammer or a dildo
is it possible to just change the player's prop2?
You would have to do it in many animations @sour island
that's one solution, yeah - that's what Skizot was sugggesting, and it might work fine
at worst you'd have to modify everything that currently uses prop2
And then you would probably have to undo what they've done with bags
but it looks like the bags don't even use that bone
Because presumably the bag fix applied to a fixed prop2 would look wrong
Well maybe not then idk
yeah. would be worth testing, at least - but you're right that a bunch of anims may have to be replaced
it depends entirely on how frequently they manually reference prop2 or if they just rely on it being a child bone of the hand bones
So this isn't used for equipping a backpack???
because if they only animate the hand bones, then the prop bone should go with it
This uses prop2, right?
@sour island is it ok for me to piggyback your conditional speech mod for my integration mod and just add a section for the speech on reward redemption? Not feeling very happy to write something that already exists in another mod
so what I gathered from this is that there's models for floor items, models for held items (only some), and bags have models for each hand but weapons use the same model for left/right hand -- but the attachment point is rotated to be mirrored making the models held upside down?
this way ill just add a require to the mod ini and will be done with it
it could be that the bags are... applied to prop2 by default, but then they're actually reassigned to the hand bones. it's really weird, like from what Chuck was saying - they overwrite the default bag model parameters and replace them with new ones
at that point whatever works works - there's not a right way to do shit lol
true
I only have experience with using the floor models as weapons in my weapon conversion mod, and there's no way to change the orientation for held models through script
I can tell you that much
So I can atleast save you some time there
Fair enough
the bags are ATTACHED THE THE HAND BONE AND NOT THE PROP.
Thanks for that tip @sour island
so the hand bones are probably orientated properly
but the bags have different models for left/right
so that point is kind of moot
big hiking bag probably has the same exact model btw- that's why it's orientated inversely
the bag I pasted has the same offset so the difference has to be how the model is itself
not sure why you'd have offsets AND different models :\
yeah me either tbh
the green bone is the hand bone it is good. the red bone is the prop and it's fucking wrong.
maybe just issues between artist -> programmer
But you're saying there is no way I could create a custom attachment type and change the rotation of items assigned that type?
and changing the bone's placement will require changing anything that touches prop2?
at this point I'm starting to think the attachment types are actually just model names - so if you made a new model called HammerLeft you could presumably use it as an attachment type
but I don't know that for certain
Not its "placement" per se, just its rotation needs to change supposedly.
could be from the changes over time - pixel based to 1.5X etc
but yeah I assume it could have consequences
If I create a custom attachment type, what string references it?
Module.TypeName?
I haven't tried it recently but I couldn't fix the floor items in hand to sit right
hmm? no, you'd need to define a new model, if what I'm thinking is correct
No worries. I mean if it isn't meant to be, it's cool. There are other mods. But if I can't fix the direction of blades, I'm probably good on doing dual wielding.
do me a favor, try modifying the world attachment point (on the Hammer model) rotation to see if that actually changes anything
not at a PC where I can test that atm, but it's worth a shot
it does - changes how it looks on the floor
yeah, that's what I assumed at first, but I wasn't sure if it was recycling those values for attachment as well
but some of the items have different models for world attachment and in hand
Trying it.
No apparent change when equipped.
lol yeah but it looks pretty wonktastic
By the end of the swing it looks like I'm hitting myself.
You think that you could transform the item's matrix4 by grabbing the rest-pose matrix from the source art in TIS's database.
Like get the rest orientation and then add that in code.
It would fix this problem.
in what code?
just need to have it rotate the model by 90 degrees after it's attached.
@thick karma okay so all the bullshit in the past however long aside, if that doesn't work, I think this is the best option:
no fucking with models or scripts, just do it via lua
just use OnEquipSecondary, take the passed item, use item:getStaticModel() (probably) to get the model name, and then use that to get the model object and rotate it
I figure this would be easily solved Java-side
and it ONLY Need the prop2 definition one, as all the other shit uses the hand bone.
You can rotate the model object in your hands after you have it equipped?
THIS is useful and could work.
yeah
Whaaaat?
YEAH YEAH... THIS COULD WORK!
maybe. it's worth a shot
I don't get why manual rotations are needed to simply attach a child bone to the hand bones.
I don't know what table/func you'll need to plug the model string into to actually get a model object, but I know one exists. from there it's just a matter of there being a rotate/transform function, or a directly usable field
The goal would be to not need to define for both hands, correct?
because it's not the attachment, it's the rotation of the model after it's attached.
it's because when the player model was first made they didn't PLAN on dual weidling and didn't think that they needed to rotate the offhand bone. YOU ALWAYS HAVE TO RATOE THE OFFHAND if you wanna use the same model at least.
the vanilla game solves it by making a new model with a different transform, but that's a pain in the ass. it's an option if the lua route doesn't work though
and they chose to write a bunch of arbitrary code to fix it, when rotating that one bone and reexporting all the anims is all that would really be needed.
I expect a fix for this to be on the TODO list for TIS's render team.
The question is priority.
If they're to have animal models for 42, items will need attachment options for those models too..
So maybe 42 will have a fix? π€
I can get the model name but I don't see a function for getting the actual object or rotating it... still looking of course.
hi guys I want to try designing maps.. how do I go about it?
I messed around with cheat mods but looking at the work other people do (the scale and quality) there is definitely a easier way... is it a application/engine? appreciate some noob friendly advice.
I'm blind. thanks man
It's freezing outside and the streets are now glass from sleet / frozen rain / ice. I need a drink.
I fixed the Offhand weapon rotation in my mod Fancy Handwork already btw. I applied a lefthandmask animation that corrects the rotation
@finite radish @faint jewel !
i knew it was a mod i had dealt with recently.
i was looking for it too
which mask @dark wedge ?
FHholdingitemleft?
@thick karma you making an off hand attacking mod or something? Been dying for a good one to use with the amputation mod
burry, i suggest making fancy handiwork a requirement lol.
That, and FHholdinggunleft.
The lefthandmask actions fix guns and item rotations, righthandmask fixes the weapon wobble when you walk
Yup
@faint jewel I just subbed
I am thinking about it updating an old one, yeah. I was discouraged by the bad orientation of the offhand, but it seems @dark wedge (who is ALSO apparently working on a dual wielding mod) already fixed that.
yes I am excited to see his work on that as well. If I could make a suggestion to both of you make it work similar to this mod here https://steamcommunity.com/sharedfiles/filedetails/?id=2727440840 Danger zone is fine and all but I love how this mod gave me more control over my offhand attack by just having it replace the push
duel weilding and a solid amputation mod are easily on the top of my mod want list.
so I always have my eyes out for one
I am actually working on a version that doesn't overwrite shove OR use OgreLeg style combos... lets you offhand with L1 instead of L2. So you can still shove.
I was just doing some looking, be thankful that dhert did it via anims lmao. if you wanted to do the "pure lua" fix we were looking into, it'd be... a lot of work. there's calls to private java code via an exposed accessor that only exists on the UI scene so you'd essentially have to do some UI modding and make an invisible dummy UI element, then use that to get access to the accessor functions, which would then allow you to rotate a model
Yeah praise be to dhert!

Here's how @dark wedge made it look... nice work!
you are so funny
Talking about it more raises the possibility of it happening. <3
i think if that logic held up, we'd have NPCs by now :~)
This is true. Devs are less likely to prioritize stuff no one is complaining about.

He said the forbidden word.
(runs away)
something something laptop hotel room something
On the other hand, if people didn't routinely beg for NPCs, we would probably never see them.

Not like they would take on that kind of labor if we didn't want them.
Sounds great!
How'd you know?
:~)
Was actually there last weekend lol
I've actually PZ-modded a couple times in those.
Good stuff.
is there any demand for a properly typed and OOP-featured class system? like would anyone actually use it over ISBaseObject? also no, I don't mean in Typescript, Jab 
There is.
Well my solution literally does just that.
It's one example of implementing that level of abstract Lua code as OOP.
I didn't write it either. It's actually TSTL that did it.
I know that @drifting stump Is going hard on his OOP solution atm.
same though, purely with lua
I've got a lot of really neat stuff set up. static functions/fields, accessors for properties, sealed classes, etc.
I'd argue that it will be more work to implement this in a language that doesn't come packaged with syntax support / sugar for these structures.
the only work is in implementing it, more or less. from there it's fairly straightforward
I scale things like typing some extra code to implement something as simple with countless implementations in a scaled codebase.
Like.. maybe 5-10 seconds to set it up, multiplied by thousands of times.
For small projects? You're correct.
For engines and code bases scaling hundreds of containers? Oh boy.
that last part is precisely what I'm addressing though.
If something were to change to fix a bug or improve the implementation, all of that code would need to be changed too.
I'm clarifying some of the caveats with that approach.
with my approach, it won't be an issue - encapsulation was the goal, and I've achieved it
If it's a personal tool then sure. If it works for you, then it's good.
Giving some insight as an architect.
it'd work for anyone who wants to use it, I'm building it as a library
I'm going to try to have interop with ISBaseObject as well as java objects (to some degree) as well, but that's not a priority atm
You can't extend Java objects in Kahlua.
You can only wrap them.
You'd have to do some boilerplate to make this solution of yours somewhat seamless, or less cumbersome to uninformed coders.
that's more or less what I meant - as it stands, the Java objects have little restrictions and you can do silly things with them that break your code entirely. plus, you can't iterate over them with pairs (and I may not be able to fix that easily since __pairs is 5.3+ I think, but I can do a manual implementation without too much trouble)
yeah, that's the goal - I'm doing a lot of the heavy lifting and the end result is going to be easy/readable at a glance without needing to know what's happening in the guts. lots of error endpoints as well
I'm more or less writing "safe" Lua, with C# and Rust as inspiration (despite Lua not needing to be thread safe, because threads aren't a thing, but it saves a lot of bugfixing headaches and you waste a lot less time, and it's overall cleaner)
It does make me curious as to why you'd reject (At least in this project), the type-safety and OOP syntax of Typescript, something that is already provided and ready to use.
It's not me trying to force some standard, rather just asking the purpose of writing your own.
Is it to avoid compilation?
I'm trying to avoid re-inventing the wheel in my situation.
sorta? it's more like adding another layer (or as many as three layers, since you've mentioned HTML and CSS for UI) to the already extant clusterfuck that is Java->Kahlua->IS-OOP->regular Lua... doesn't sound like fun, for anyone really
Maybe I don't quite understand your goals, concerns, and interests.
The project you mentioned is an example. It is not forced on anyone to use as part of the Typescript environment.. (More like a plugin / library of its own). Assuming it wouldn't be fun is a concern.
A lot of people have come to my discord org server over the past half year discussing how fun it was coding in a language like TS (which some knew more than Lua)
goals: actual OOP that doesn't suck
concerns: the current OOP that PZ uses is dogshit, and barely qualifies as OOP since it breaks encapsulation and allows you to play fast and loose with access
interests: forcing Lua tables into acting like C# classes and providing "safety measures" to make sure you don't step out of those restrictions, because doing so will result in worse code
I agree that ISBaseObject is a little too simple, however without the language.
sure, but you aren't just coding in TS - if you really want to know what you're doing you'd need an understanding of TS, Lua, and Java
don't get me wrong, I'm not saying your idea is bad, it's pretty awesome and it's a good option
I'm just making another one along similar premises
The goal is actually to mitigate this wall that gets in the way of people. You are assuming way too much about how things work here.
Yes and thanks for clarifying that.
All tools are options for people to do what they want.
I wouldn't have spent a month adding in generated documentation for Java's method-signature confusion for Lua if I didn't have the goal of simplification of the discovery and implementation process of PZ's API in mind.
... And the few months it took to perfect resolving generic types for classes, methods, fields, and parameters.
Lua is walking in the dark in many ways. Your tool would allow for people to stay on a path.
It will help people for sure.
(HERE) How do you think, what will be best example of creating mod for beginners? I want explain in it about adding new item, new recipe and some lua functional
multiple consistent approaches
Is this only for in Lua?
example download, article, video
I'd use a wiki page and maybe a video as two examples.
I mean what include in this mod? (P.S. I will do text version on wiki + video)
Ah. There's probably a fair few people here who stream modding for PZ that could maybe help with the video part if they're willing
For typeScript will be another guides (for advanced level)
I guess adding a new item would be a good step
Aww haha oh no. I can help with that ofc and that's not as advanced as you may think. π
You could make it a series - add in a variant of a current item - at least visually, then increase the intensity - new recipes, to new features
scripts and recipecode alone is a rabbithole
especially when you get to doParam and scriptManager
(Runs away and writes a UI program to aid in scripts like I promised 6 months ago)
__>
making that item a weapon / clothing can be an offshoot series
Maybe we could figure out categories for this series)
I made a weird discovery with EHE that makes me both excited but confused
I also feel like I've been going in circles
but code in the /server/ folder normally shows up in console.txt and isClient()==true
Try test on dedicated server
Does dedicate operate differently to hosting from the main menu?
cause I used 'sendClientCommand' with twitch integration and the code then fires in co-op console and isServer==true
Try check logs on player, that connected to your host
This is from hosting from the main menu - that's where the prints go
I have all the helicopter events in /server/ as I assumed it would be serverside
and it should be updating clients along the way
This doesn't seem to be the case - and instead the events and scheduling is done on the client's 'server'
I think, if you host, on your PC runs client+server, so this log is shows
im sure crater knows better than the lua devs themselves and if the approach theyre taking is manually declaring each public field/method then its not a good approach too much boilerplate
there are logs for co-op (server) and the regular console (client)
plus it doesnt inherit changes down the road to super classes
I'm just not sure how to make it so the system is occurring on the true server where isServer()==true
Can you send code, that you use for check?
I can try to build an example for testing
im only taking this long getting it done simply because its not easy to design it in a way that is simple to code with, document and extend
lmao what? I'm using features the Lua devs created for this purpose exactly, I don't recall saying I was somehow "better" than the Lua devs. nor would I, since that statement doesn't really make any sense
you keep saying how terrible the "tis oop" is
they literally copy pasted from the lua docs
I'm having trouble with some sandboxVars, when I try to use them when building a table they're just getting the default, but if I call them later they're showing the saved value. Do I need to init the sandbox vars so it gets the saved values?
sandboxvars are initialized during loading so any code that runs before that wont have access to the correct values
theres an event that is triggered after they are loaded
Making a mod that uses the MP chat to spawn things.
chatMessage:getAuthor() returns a string with the name of the person that sent the message, rather than the actual player entity that sent the message. How can I get the correct player entity from the username? I tried local sender = getPlayerByUsername(chatMessage:getAuthor()) but it didnβt save properly. Any idea what Iβm doing wrong?
My test doesn't have any issues - so I guess there's something janky going on my end
nvm spoke too soon
LOG : General , 1675275913647> 11,857,015,738> [CLIENT_SERVER_TEST] TEST: 11 EveryTenMinutes isServer():false isClient():true
From console
LOG : General , 1675275888598> 11,856,990,690> [CLIENT_SERVER_TEST] TEST: 91 EveryTenMinutes isServer():true isClient():false
This is code sitting in /server/
so clients are executing their own copy of server code?
the number of test counts the number of times the print message is sent out too
I set it to send commands when moving
Right now, it just sets the target player on fire so I can make sure itβs getting the right player as the target. When I get the ID code working, Iβll change the effects.
just preface your file with if isClient() then return end
Yes, will be doing so
just kind of confused why this is a normal behavior
I wonder if the opposite is true for server and /client/ ?
so all this time I was writing EHE thinking it was server side 
oh man...
fortunately the server side events broke cause the gamespeed is 0
but this means every event was sort of clientside sending other clients marker/sound updates

just from a brief look, it seems like the update loop of GameTime has lots of sections and most of them are conditioned behind bClient or bServer, but the branch that actually calls LuaEventManager.triggerEvent("EveryTenMinutes"); isn't - so the event triggers both on client and server instances
what about onTick?
it's a pretty weird trap, i wonder if the server folder actually did behave as expected in an older version or something?
afaik the old MP was all leveraged off of the host server
the new peer-to-peer stuff might have caused the discrepancy
i think all the time events do run on the server
@bronze yoke Not likely. I think this client-server-shared is an attempt to sanitize server-specific code but ultimately was delayed indefinitely due to something not working right (My guess)
yeah i thought it could be something like that too
Probably something that didn't pan out or caused too much trouble for the devs.
I'm making this guess because of how the Java code is.
the java code 
so as long as I prevent the scheduler from firing on isClient()==true all I should have to worry about is relaying updated positions/sounds to players
I think this meant every player had their own scheduler going
I'd expect those API flags to be consistent with what anyone would expect them to be: simple yes / no.
looks like it's also both
I've seen this behavior before.
Maybe we could make additional API to give the expected result with additional checks under the hood.
is OnTick timed differently between server and client?
it's tied to processor capability, so yes - it's even different between clients
I'm surprised that OnTick doesn't send a delta long value.
it sends a delta, but it's just an integer iirc. basically a frame counter since the gameloop and render loop aren't completely divorced
My server is a fair bit slower
excuse me if i'm literally just making stuff up LOL but i think it might be at a set, typically lower frequency on the server?
could be. lots of dedicated servers for other games use a fixed tickrate parameter
i remember observing exactly the same thing and i remember someone mentioning something about it to me but i don't remember what the explanation for it was
let me check the java I guess
In Lua you'll never need to handle the render thread. Even UI's render hook runs in the Lua main thread.
TIS uses their SpriteRender.instance to cache draw calls for the next available render-thread context.
I don't think that's the case, is it? render() and update() would be identical, otherwise, making one of them redundant
they run on different ticks but in the same thread
I know this for certain. I'm modding the render engine.
i mean yeah, everything runs on the same thread - it has to
that's what the ui update rate option is about
It is redundant in the way you're looking at it.
Not entirely. It's how TIS implemented it though.
Kahlua can't run across threads, so TIS didn't really have an option (without dropping Kahlua)
Kahlua supports multi-threaded environments. TIS chose not to use this feature.
since when?
I don't know.. I read the code I guess?
I just recently looked at the docs and they specifically state you shouldn't do that
i'd read on kahlua's site- yeah
like, ever
are you getting it confused with coroutine? because that has nothing to do with threading
They have the option.
Making a mod that uses the MP chat to spawn things.
chatMessage:getAuthor() returns a string with the name of the person that sent the message, rather than the actual player entity that sent the message. How can I get the correct player entity from the username? I tried local sender = getPlayerByUsername(chatMessage:getAuthor()) but it didnβt save properly. Any idea what Iβm doing wrong?
Haha okay buddy.
it didn't save properly? what do you mean?
You can't execute the same Lua environment in two threads. You can execute different Lua in different threads.
In the debug error menu, itβs saying that the author and tab of the chat are saving properly, but the variable βsenderβ isnβt anywhere to be found. Then the error runs when I try to do a thing involving the βsenderβ variable
...which would be pointless, because the state is entirely independent. without parallel interaction (or at least an interrupt call of some sort) it'd be effectively useless to pretty much everyone
getAuthor() probably isn't returning a username
it might be a character name or something
Itβs returning βpieandcheese647β when I use it on a private server
additional note on the update vs render
update is triggered every 100ms
render is triggered every ui frame
Not character name
I don't get what going on about this helps anyone. I don't care about being right about this, even technically. It's how TIS implemented it that matters.
Some people need to know that it's the same thread on execution for update() and render() because they could have a proper background of coding games.
There's a underlying assumption on either side that can hurt both parties.
use getPlayerFromUsername()
tbh fuck all that technicality bs.
I am doing that
you're using getPlayerByUsername
I don't really care about being right for my own sake, I'm just trying to point out that it's not some arbitrary decision by TIS that somehow kept us from, in case anyone eventually reads this and thinks it's somehow something that the devs could/would change (and it isn't, for the above reasons)
Ok.
wait this means my events will be much slower if I use OnTick serverside...
'EveryOneMinute' seems to not have the same issue but that's still pretty slow
where'd you find the 100ms bit? that's interesting, kinda wanna take a look at the guts
was it exactly 100ms? because I think tickrate is dependent on the client's processing power
but if it was a nice even 100ms every time then you're probably right
interesting, that makes sense
it was triggered 10 times per second independently of any other fps setting
ui uncapped, capped at whatever amount, game fps uncapped or capped
ikr lol
irl time
Isn't UPS for PZ targeting 30 or 50?
browser was just talking about the UI update(), not sure if the main game loop has a target/cap/etc.
I would imagine it runs uncapped, and just uses a state machine to manage event timing
It's very bad to not target a UPS rate. It's fine to implement both locked and unlocked FPS.
why's that bad?
if your main loop is detached from game logic, that's usually a good practice actually. it's only in older games where you see the opposite
Game logic without a rate of ticks (or managed delta time values passed in tick), can cause an array of issues that may even give players an advantage in multiplayer games.
not if the state is managed, which it should be in every case
Artifacts and time-based components can give way to complex bugs.
I think you've got it backwards, those are issues when you tie logic to the loop - because if the CPU (it's not always the CPU, but just for example) can't keep up with the instructions, your logic is now executing behind schedule instead of skipping updates to the correct position
Simple applications are fine. They typically sleep the thread which is a form of capping UPS.
Hey. I'm going to block you because I don't like being talked down to. Have a good one.
I wasn't talking down to you, but okay!
Hello. How to prevent player build thing on sand terrain type ?
You have to hook to the vanilla build fuctions and add a check if the grounds tile is part of an array you make fontianung all the various sand floor tiles
The windturbine requires an alternator part to be installed. Said part for now requires spare engine parts to be made as you (extract) the alternator from a car engine. And repurpose whatever scrap is left for the turbine. This way the windturbines wont be as easily made. You need to sacrifice car engine parts to make a single one
anyone know how to resolve the fact OnTick is timed differently if there's a way to confirm by how much?
weirdly enough OnTickEvenPaused seems to be the same speed as OnTick in client
both OnTick and OnTickEvenPaused are faster on client
which I find strange
the name implies they should be the same and OnTick should just be paused when the game is paused
I wish we could read ACTUAL time correctly.
i wanna take a number of tiles, add that to the start time as seconds and get a NEW time that should be my completion time.
nvm I think it was my imagination
LOG : General , 1675280689849> 0> [CLIENT_SERVER_TEST] TEST: 275 OnTickEvenPaused isServer():false isClient():false
LOG : General , 1675280689851> 0> [CLIENT_SERVER_TEST] TEST: 275 OnTick isServer():false isClient():false
LOG : General , 1675280689866> 0> [CLIENT_SERVER_TEST] TEST: 276 OnTickEvenPaused isServer():false isClient():false
LOG : General , 1675280689869> 0> [CLIENT_SERVER_TEST] TEST: 276 OnTick isServer():false isClient():false
LOG : General , 1675280689882> 0> [CLIENT_SERVER_TEST] TEST: 277 OnTickEvenPaused isServer():false isClient():false
LOG : General , 1675280689885> 0> [CLIENT_SERVER_TEST] TEST: 277 OnTick isServer():false isClient():false
LOG : General , 1675280689900> 0> [CLIENT_SERVER_TEST] TEST: 278 OnTickEvenPaused isServer():false isClient():false
LOG : General , 1675280689902> 0> [CLIENT_SERVER_TEST] TEST: 278 OnTick isServer():false isClient():false
added a counter per ID
lol
that's in SP let me check in MP
LOG >> [CLIENT_SERVER_TEST] TEST: 331 OnTickEvenPaused isServer():false isClient():true
LOG >> [CLIENT_SERVER_TEST] TEST: 331 OnTick isServer():false isClient():true
LOG >> [CLIENT_SERVER_TEST] TEST: 318 OnTickEvenPaused isServer():true isClient():false
LOG >> [CLIENT_SERVER_TEST] TEST: 49 OnTick isServer():true isClient():false
it is a bit slower
but not actually that far off
LOG >> [CLIENT_SERVER_TEST] TEST: 1493 OnTickEvenPaused isServer():true isClient():false
LOG >> [CLIENT_SERVER_TEST] TEST: 1224 OnTick isServer():true isClient():false
sir?
LOG >> [CLIENT_SERVER_TEST] TEST: 7378 OnTickEvenPaused isServer():false isClient():true
LOG >> [CLIENT_SERVER_TEST] TEST: 7378 OnTick isServer():false isClient():true
so they're the same speed it's just that the server has a paused moment
so the times ran is about 2-300 off
i see you got the counter method working, but if you want a different method you could use os.time. might even allow you to measure the length of a tick, I think it goes out for a good number of decimal places. I'm still thinking ticks vary between machines rather than being some sort of fixed/target value, but I don't know that for sure
i'm pretty sure there's a target myself
where have you seen it? I've been looking a little bit but not very focused on it atm
def curious to figure it out if there is one
i didn't run any tests but it seemed apparent when i was working on one of my mods, and i'm almost certain there is a lower tick rate for servers
i believe the tickrate for servers thing, that'd make sense
We are having an issue where this code does not seem to update ingame. Or is unable to grab the wind value. Anyone can make a guess why?
local modData = generator:getModData()
modData.wind = 50 --climateManager.ClimateFloat.windIntensity * 100
generator:transmitModData()
end
local function OnClimateTick(climateManager)
for k,_ in pairs(AllWindTurbines) do
if k:getModData().wind then
if k:isActivated() then
CheckWindLevelAndSetTurbineSpeed(k)
CheckAndUpdateSprite(k)
end
else
AllWindTurbines[k] = nil
end
end
end
--Events.OnClimateTick.Add(OnClimateTick)
Events.EveryTenMinutes.Add(OnClimateTick
Also should this be in the server lua folder?
important to note is that this is based on code from the steam powered generator lol, I'm still trying to figure out the context and how everything even runs in the game, I'm somewhat regretting basing it on an existing mod, but the docs are hard to parse because it's either outdated or not describing what I need to know >u> slowly getting there though
that AllWindTurbines array is being updated further up with
object = instanceof(object, 'IsoGenerator') and object or ReplaceExistingObject(object, 0, 100)
AllWindTurbines[object] = true
end
local function LoadWindTurbine(object)
AllWindTurbines[object] = true
end
but I have no idea if the game runs that automatically or something is supposed to get hooked somewhere first
The counter is just counting the event firing - not really useful, but I suppose OnTick is fine even when it's slow for servers depending on how it's used
when you add OnClimateTick, you're passing a function that takes an argument (climateManager) which won't work in that format. that might not be what's causing the issue, but I figured I'd point that out (you also don't use that parameter in the function, so you can just get rid of it)
yea I'm still trying to figure out why it's not updating the value in the game at all
it's not setting the value to 50, so the array is probably not updated, though the functions do seem to be hooked further down below:
if instanceof(isoObject, 'IsoGenerator')then
NewWindTurbine(isoObject)
end
end)
Events.OnObjectAboutToBeRemoved.Add(function(isoObject)
AllWindTurbines[isoObject] = nil
end)
this will break immersive solar arrays
oh?
please check sprite
I'm reusing code from the steampowered generator so I guess that'd also break ISA
is the moddata initialised somewhere?
you only set the wind moddata after checking if it already exists
We changed the water.moddata thingy
I think it is, the parameter is always showing when the generator runs
if instanceof(isoObject, 'IsoGenerator') and isoObject:getTextureName() == "windturbine___" then
NewWindTurbine(isoObject)
end
yea it's what used to be the water parameter, I figured that was already plumbed through the whole stack so I could just reuse that
thanks I'll replace it with that!
done
it's not exactly break, just that it includes any generator
yea very fair
it's just reusing the steampowered generator code so it may be an issue in there too then
do you have permission to use that mod's code?
MapObjects.OnLoadWithSprite("solarmod_tileset_01_0", LoadPowerbank, 5)
If we could get the "pure" code absolutely needed to make the normal generator work that would be the most helpfull basis of our code I think
we mainly based it of another mod because we dont know what is exactly needed just to make a standard generator work
you need MapObjects to trigger those commands
Ive made a tileset that works
and it picks up and behaves like a normal generator after being crafted
just with our visuals
rightclicking it indicates that it is our windturbine
did more digging, looks like OnTick runs unfettered without limits as long as your game settings are set to uncapped FPS. otherwise it does some division based on the Java master clock to determine when ticks should fire
still not sure how that applies to servers, but may be worth knowing. also, OnTickEvenPaused runs even when the actual game world isn't loaded, aka it'll run in the menus and whatnot
the generator info window also says our values like "wind %"
I- not necessarily, this was still a learning thing and I figured that throughout the process we'd replace everything, but it's more involved than I thought it would be, if it ends up actually being the base for the final mod then I'll definitely contact the author, but I'm not sure about that yet because the steampowered generator mod seems to do a lot of unnecessary things we might be able to skip, I just don't know what is and what isn't necessary yet
This mainly why we would like documentation or the exact lua codes needed to make a vanilla generator mod so we can build off of that before we release the mod
oh, i suppose if you're not planning to release the mod in that state it's fine
what the scheduler does is run on tick but checks the in-game hour to pass events - skips the process if the hour matches a stored value
it's more about trying to get something that works, and then once we do we can redo it in a more clean way
so I think I'm fine even if the rate is drastically different
we have no idea right now how we can extract and just make a mod that adds a "copy" of the original generator just with different item names and recipes
and tiles
I just have no idea what to even do to make it work, it still seems like voodoo
I get the hooking of events and all but I don't really know what's loaded when and how and why and what's really needed and what isn't etc
but I can see something like this causing alot of issues for people trying to sync a mod between MP/SP
If we got this we would obviously build our mod off of that instead
generator mods are one of the more complicated kinds of mods
the way the steampowered generator seems to communicate from the client to the server is like it's relying om some kind of message bus but I don't really know where to find that in the docs at all
where'd you find this? I didn't see that at all in the main game loop
also might be worth checking out OnRenderTick, which would be wild if it runs on the server
and how it differentiates between the server and client is like 'if client then return'? I think? or does the file structure actually matter?
Is there any way we could get the exact lua codes the standard generator uses?
yeah, just look at the file
it's not hidden or anything
@little holly
the way you're storing the objects might cause issues later
you store an object but the square might be unloaded, then another object will be added which is technically same object on map (but different userdata object).
the scheduler I refer to is for EHE - it's my own - also I checked on render tick and it does the same thing just all at different rates
what's the consensus on this? how do people normally create MP frameworks that work? what's a good example to use?
@little holly anthropy I think the best cause of action is possibly to just throw out our current luas and use make a fresh start code purely based on the original generator in the game and modify/add on that.
like I kinda tried to use the steampowered generator to learn how to do these things but from what I gathered they have their own share of bugs
MOGenerator.lua
sure but that'd require me to understand what is required in the first place
The original generator.lua
it'll help you guys to set up a VSCode workspace with the vanilla lua files loaded so you can ctrl+shift+F to find stuff, like all instances of IsoGenerator
Thank you
vanilla has improved syncing of default generators this year
^^
This is why we want to build from the original generator in the game
that way we dont infringe anyone elses mod either
we are basically just looking at mods for reference to understand. Never intended to directly use anything
I don't know if it's enough but we can try sure
all art assets are made for our mod. We only lack the code part
that helps
I'll try use the vanilla luas and see how far we can get
Anthropy Ive made backups of our current state of the "non releasable" mod so it is safe if you remove all the old LUAs
but keep the scripts I made and art
those are original
this is why git is useful, the first version was a fantasy from chatgpt that had no chance of ever working at all :P
those that makes the recipes work
you don't have to keep backups thanks to git
that looks interesting
We have to keep our namings tho
it's not going to be easy without taking a look at IsoGenerator in the java. and even then, you might find that the parts of that class that you need to access are private, which means they're immutable more or less (but you might be able to re-implement some of the logic in Lua)
just make sure to keep the files we do need, but lets discuss that in private
if you're just starting out though, this is going to be a nearly impossible first project
Why tho?
oh okay, that makes more sense. I was like "scheduler? ticks referencing the in-game hour? huh" but I wasn't thinking 
We are getting the hand on how certain things work already
"this year", should be "last year" 
Like we have made the art assets function that I made from scratch and the recipes and items. And it behaves like the normal generator inventory and world wise...
because it's going to to take a lot of interop between the lua and the java class to make it work properly, and if you're brand new then you probably aren't familiar with that (unless you're coming from something like GLua or Roblox, but even then you need some Java knowledge and some general understanding of the quirks of Kahlua)
that's fine I like steep learning curves as long as the projects are meaningful, I don't like making a colorful box mod and then a colorful storage box and then then a colorful storagebox that repels zombies etc, I like just working on something that I'd actually use :P
fair though!
https://github.com/FWolfe/Zomboid-Modding-Guide/blob/master/api/README.md
this'll help with some of the more esoteric stuff
good luck π«‘
I like to think I'm somewhat decent with code but- ahh yea that'll help
this is a pretty crazy first mod
We like crazy. This is what we both have wanted the most in the game for a while now
trying to find any pioneering work already done and the expectations from the APIs and game itself seems a bit.. well hard to find in the rest of the game's help wikis because it's a very skill based game to begin with heh
this is neat though
it's a clusterfuck even once you understand it, honestly
sooner or later you get a bit faster at navigating stuff, but none of it is intuitive
yea games are like that, that's okay
it's difficult to call it a modding api
it's like a modding allowance
it's more like they exposed a bunch of methods and went 'good luck!'
I think I'm just going to start with the vanilla generator and modifying that to have static fuel levels, and then something wind based, or something along those lines
like "here's a few exposed guts, good luck putting them together. here's a handful of examples, oh and we did all the UI stuff for you so there's that, but otherwise get fucked lmao"
yea I've seen that in some games, and honestly it's better than games where they don't expose anything at all, but it can be a jungle to navigate heh, especially with the game changing over time and the docs that DO get created, inevitably aging
At least this game has helpfull debugging tools
but I've gotten this far and I'm sure I can make something
Picking apart the steamgen mod teached us a lot
when spawning items/zombies/vehicles for MP the recommended way is to send a command to all clients right?
we did it only for educational reasons
definitely. you're off to a decent start
also yes, there's games like stationeers where as much as I love the game, I cannot make actual functional mods because they just don't expose anything, if you ask around a lot some people will tell you that you can decompile the game with a C# decompiler because it's not obfuscated, and you can technically override parts of it :P but yea that's a bit too far out for me
thanks! if you're curious we're keeping this place here as project page https://git.dragonhive.net/anthropy-zefnoly-collabs/zomboid/windturbines
is that how it does it? I assumed that it's spawned on the server, and then there's a broadcast that says "these are the spawned objects this player should be able to see" and then it pushes the relevant updates
I haven't checked any of that beyond when the command is sent to the server to spawn the vehicle though, so that could be totally wrong
the horde spawner sends a client command
the vanilla debug tool that is
I'm just curious cause now I have to refactor all of EHE to be truly serverside
so far events work as do markers and sounds
hopefully this should fix the sound issue
also I know why events were messing up now - the scheduler was reusing active IDs
oh, I think zombies might be different - if I remember correctly zombies have a client "owner" that handles zombies, and the positions and whatnot are then broadcast to other players (somewhat inaccurately, especially in laggy situations) and the owner switches when the zombie targets someone else (or the owner leaves the range, with another player still in the loaded area)
that could also be off - that's a vague memory of how it works from a while ago
if events occurred soon enough it could start trying to broadcast two events through the same marker and set of emitters
. _ .
I can test with the events that drop off zombies and trash
atleast that seems to still work
i think when in doubt I'd just follow the debug menu's lead on what's called in which sections. I'm not aware of any quirks with the zombies that are spawned through that, but they may exist
iirc there's a limit on the number of zombies that can actually be in a cell before they start despawning (maybe it was chunk-based, not sure) but not sure if that'll be an issue, and I could be misremembering
Just trying to see what I need to refactor
ironically single time sounds don't work but loops which gave me such a hard time do
Anyone taking commissions ATM? I have a mod I would like to give a facelift to.
seems like sounds played on the server don't relay to clients unless isClient is true
where all the clients can hear it???
I like that helicopter graphic.
ty
relayed via sendServerCommand, maybe?
doesnt need to be normally
but I'll have to do that
for looped sounds to broadcast properly I track and move an emitter using commands
for non-looped I didn't have to do this
does it play before you move the emitter? like, without looping
wonder if it needs to have some sort of update sent to the client
I'm not sure - the fmod stuff is very convoluted
yeah I can imagine, I've seen as much in other games before and I had very little idea what was going on
I had a lot of grief working with the internal fmod stuff too.
Can confirm.
normally when you use playsound from server/client folders the sound gets played regardless - as long as isClient==true apparently
this isn't true for emitters that move around and are looping a sound though
hence why I took the time to work out a command relay
the sound stays where the emitter first appeared
i wouldn't spend too much time on it, i think the sound engine is getting more changes with B42
yeah I'm just going to do a quick command to tell all clients to play a sound on xyz
events can't seem to shoot zombies either
very very strange
Try This One Neat Trick To Play Sounds (Server Owners HATE This!)
jk i doubt it'll have that much effect on server overhead
Good afternoon everyone, I want to add an item to spawn in the game by default, it's my first time doing a PZ mod and I wanted to know what is needed
is it possible to make the player into an NPC to run on some logic 
I'm wanting to make the "Nuclear biochemical mask" spawn normally on the map
you need to prepare a list of containers you want for the item and a function to insert them
Where can I do this? and is there any example of this here on discord or on the wiki?
https://theindiestone.com/forums/index.php?/topic/38165-quick-guide-how-to-mod-the-loot-distribution-system-distributionslua-proceduraldistributionslua/&do=findComment&comment=365101
This is one way to do it.
This is a visual guide for mappers and modders who need to add or modify PZ's loot entries using the new ProceduralDistributions.lua approach. Whilst the ProceduralDistributions.lua file has been in the game for quite a while (i.e. the Gigamart shelves having distinct loot types), TIS will be eve...
is there something for transmitting damage or some such?
seems as though the server isn't staggering or killing zombies
Aiteron the modding page looks better now π
i think if you get technical, players are already NPCs (or at least share some names from the old system)

i think so, yeah. more or less. at least in the case of SuperbSurvivors, can't speak to any others
How would one identify a zombie in MP?
the code on server side is clearly identifying targets to shoot at
but the stagger and damage aren't being applied
TIS has said that zombies will stay client side with owner system, this might be affecting things
ah
so I'd have to just fire it as a command
but how do I identify the zombie for all clients?
it's also not shooting me either
And thank God for that.
I remember the lag bite days..

now we have shared ping lag
Depending on how bad that gets, lesser of two evils.
true I can always kill the other guy
I remember PvP struggling with B41.
I think a lot of it has to do with client-auth in places that needs to be server-auth.
i remember when b41 mp came out the blog post basically ended with 'don't do pvp, it's shit'
PVP needs alot of work lol
Hi guys. Nice to meet you. Im pretty new to PZ discord and i wanted to know something about modding. So tell me if this is the right channel. I have an idea for a mod and i wanted to ask ppl that know about modding PZ to see if its beyond my reach. Ive seen some videos about how to do custom maps etc, but before getting into i need to know if i have time to devote to it.
The game could use a struggle or grapple mechanic
Pls this.
Also can we get chain hooks on vehicles so we can drive around zeds hooked up on them to bounce into things?
Kthx.
haha
adding a targeting system would be fun too
rn it's all RNG as to what body part you hit
Aiming in iso has always been such a strange animal.
I just mean - on the paper doll health panel
drag a target around the body
as a relative preferred area
Any mapping questions goes in #mapping
Modding discussion is here.
#mod_support for support on mod-specific issues I think?
you could even use the x/y and a rng buffer zone to accoutn for variables impacting aim
set your target on the head? well now when you're "aim" drifts a couple pixels it might be off the body and be a miss
#mod_support is end-user issues
Nvm
just general mod related tech support
basically a purgatory to alleviate tech_support
Also what a name, swapping B and T like that.
A LotR fan in hiding.
God that guy was OP.
Then i guess itd be here. Its not so much about mapping as changing other elements. In brief, id like to make a mod in which theres vampires. They nest in the day in building they turn into nests that attract and/or spawn zombies, not sure yet. It would add some weapons and some changes.
As in only for problems?
with mods?
it's modding_(tech_)support
Ok
I know its adumb question, but to keep it short, how hard would it be. I have a bit of experience coding and modeling in 3d
you should start by having a read on that link
Thx
I don't blame anyone for asking people what something could take in terms of work, time, and know-how to make a mod. It's a good idea since it's PZ.
I'd think of dressing up zeds as vampires in vamp clothing.
The logic is something I'm not sure how to go about.
well theres is a mod callend zombies fear the sun that might help on the logic
I know that zeds operate as boids with leader zeds. Maybe you could hook into that with pathing?
since it makes all zombies hide during day time inside the nearby buildings
Thx
the logic there should be easy to apply on a vampire mod
I'd further clarify if I had more info on pathing.
I lnow it. the idea comes in fact from a churning of several mods ive seen but nobody has done what i have in mind to my knowledge. The vampires could be under the sun but highly weakened and in pain. So as to not make it too easy.
well thats up to you, read the wiki familiarize yourself with the modding in pz and give it a try
you can always ask for help
here
Im readfing it in fact
Oh yeah. If you sub to mods, you can find the code for them in /steam/steamapps/workshop/content/108600/
You can see what those mods do.
aha, ok, didnt know that
Lol. I love the unaffected zed at the bottom.
He's just living life a breath and a groan at a time.
well the jets are somehow moving back and forthe
not sure what that's about
none of the other events do this
occasionally
Of the vampires?
moving fixes it which is equally weird
Zeds in general.
prob some logic failing