#mod_development

1 messages Β· Page 100 of 1

faint jewel
#

my dual cellphones... i had to change that bone or the phone was facing away from the ear πŸ˜›

finite radish
#

yes, but we're talking about attachment points - which use a rotational offset from the bone translate

red tiger
#

@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.

faint jewel
#

YOU HAVE TO ROTATE 90 DEGREES FROM THE PROP2 BONE

finite radish
#

that's why you need to start digging at the code to find where each AttachmentType is defined and the entrypoint

red tiger
#

Actually that file looks somewhat dated..

#

Heh

#

It's a lot cleaner now.

finite radish
#

(hence why it's an offset)

red tiger
#

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.

thick karma
#

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...

faint jewel
#

i wish @late hound was here, he could use whatever buzzwords you would have to hear to understand what i am saying.

thick karma
#

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.

ancient grail
thick karma
#

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.

thick karma
#

😦

#

wrong wrong wrong...

faint jewel
#

yup.

thick karma
#

"wrong"

#

(maybe that's how they want it)

faint jewel
#

if there is a way to OVERRIDE that I would like to know as well.

thick karma
#

But... sure looks wrong to me.

ancient grail
faint jewel
#

i dont think it was that far planned out.

#

if you have a model i can help make it carryable.

sour island
#

figured out the issue I guess

#

getGameSpeed = 0 on servers

#

πŸ€”

finite radish
faint jewel
#

HMMMM!

#

I might have found somethng.

#

burry

#

can you put a gas can in both hands?

thick karma
#

By "model" do you mean the hammer? Or the player character?

faint jewel
#

teh player

#

dammit no.

#

this wont work.

thick karma
golden sparrow
finite radish
ancient grail
golden sparrow
#

Like 1 = x1 , 2 = x5 , 3 = x20, 4 = x40

finite radish
thick karma
golden sparrow
#

it correspond to the option you have top right in SP

thick karma
#

They copy-pasted this wrong strategy to the way they attach hammers, and machetes, and guns, etc?

finite radish
#

it's not wrong by any stretch of imagination

thick karma
#

Have you even looked at the pictures I posted?

finite radish
thick karma
#

Look at how the player holds a pistol in left hand

finite radish
#

...in left hand

#

yes

#

πŸ™‚

thick karma
#

So how is that not wrong?

#

because people can't hold things in their left hand?

finite radish
#

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

faint jewel
#

does THIS help any?

finite radish
thick karma
#

I hear you @faint jewel

faint jewel
#

THAT would fix ALL the left hand holding.

finite radish
#

it'd also break a lot of stuff if you don't rotate it back, and it's a hacky fix at best

faint jewel
#

Bip01_Prop2

#

well then they need to fix the OTHER SHIT. because that's all hacky and wrong.

finite radish
#

not sure what you mean by that, the items you hold in your left hand work fine

sour island
#

but my events use gametime * for speed control

#

and there isn't an issue is SP?

faint jewel
#

OOOOOOHHHH HPOSSIBLE IDEA

finite radish
sour island
#

I don't think 0 = x1

#

but for some reason the server's game is paused πŸ€”

#

or the time just isn't set

thick karma
#

Right but that is a fundamentally different item. I am talking about how almost everything but bags looks

faint jewel
#

the bags all use the left hand bone anyways.

finite radish
#

...yes

thick karma
#

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."

finite radish
#

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

faint jewel
#

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?

pulsar heath
finite radish
#

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?

golden sparrow
thick karma
finite radish
thick karma
#

But they are allowed to be held.

#

So it's wrong.

finite radish
#

...that's not wrong, it just doesn't display the model

golden sparrow
#

getGameSpeed don't get you the actual game speed but a int from 0-4 based on value you can select in SP

thick karma
#

"Meant to" is just trying to pretend they didn't do it wrong.

finite radish
#

what lmfao

#

that's nonsense

thick karma
#

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

finite radish
#

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

thick karma
#

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.

red tiger
#

Always fun to watch Node install on a new computer..

finite radish
thick karma
#

No, they do show up

#

I just showed you pictures...

#

They show up... wrong...

finite radish
#

I didn't know if you attached those using the attachment debugger or not

thick karma
#

No.

#

The game is just doing it wrong

#

lol

finite radish
#

the fact that no one has really cared about this before is just evidence that it's not really an issue

thick karma
#

but you seem resistant to anyone pointing that out

pulsar heath
#

its a matter of perspective πŸ˜„

thick karma
#

lol sure @pulsar heath

pulsar heath
#

its like the sendclient and sendserver

finite radish
#

because it's not really "wrong" if you're already doing something weird in the first place, it's just not implemented behavior

pulsar heath
#

for me its wrong the way they do it

thick karma
#

From my perspective, running around with a big sharp blade pointed AT your own thigh is not ideal.

pulsar heath
#

so... perspective πŸ˜„

thick karma
#

But yeah, subjectivity and such.

thick karma
finite radish
pulsar heath
#

dual wirld

#

wield

thick karma
#

HOLDING the item is implemented behavior

#

we HOLD it wrong

faint jewel
#

he's making a dual weild mod.

finite radish
#

if it were an issue, someone would care and would have fixed it (they haven't!)

thick karma
#

lol deny that until you're dead, that's fine, but you're not convincing anyone

faint jewel
#

what's get gonna do? strap it to his dong? LOL

pulsar heath
#

triple wield?

#

πŸ˜„

finite radish
#

because, as I pointed out, there's no functionality implemented for secondary weapons

faint jewel
#

also, just so you know... ONLY CLOTHING can use those attachment points.

finite radish
#

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

pulsar heath
#

finally done going through the error log from yesterday's test

thick karma
finite radish
thick karma
#

And that functionality is functioning wrong.

#

Lmao

faint jewel
#

show me something that isn't clothing that uses them?

finite radish
faint jewel
#

also when items are equipped to back etc they count as clothing.

pulsar heath
#

really?

finite radish
#

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

faint jewel
#

well notice NOT ONE of the attachment use the prop bone.

#

which is what ALL the weapons use.

finite radish
#

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!)

pulsar heath
#

so the problem is the weapon "look" when equiped?!

drifting stump
#

@red tiger from my testing update seems to trigger at 10fps regardless of ui render speed

faint jewel
#

you sir, are wrong. you die on your hill but it's in the wrong spot.

pulsar heath
#

cant you just ( a lot of work )

drifting stump
#

couldnt validate in code

red tiger
pulsar heath
#

create "skins" that when equiped on secondary replace the original?

finite radish
pulsar heath
#

wouldnt that make it look "fine"=

#

?

red tiger
#

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.

faint jewel
#

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.

drifting stump
thick karma
#

@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.

drifting stump
#

you only ever need to update the ui whenever a new one is rendered

thick karma
#

That would be far more useful than being told that it's actually not wrong. πŸ˜‰

drifting stump
#

aka use render

red tiger
sour island
#

models are not orientated to sit on a bone - it's hard baked afaik

red tiger
drifting stump
#

you still dont need to update that fast/slow

faint jewel
#

they do.

sour island
#

as in there's a model for the item and a model for on_floor

faint jewel
#

i promise you.

ancient grail
#

Omg multiple convo going on
Mod chats busy tonight

drifting stump
#

only ever at the correct time which is on render

red tiger
drifting stump
#

if anything you could use OnPreUIDraw

sour island
#

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

red tiger
finite radish
drifting stump
#

it doesnt matter if called render or not its just a name

pulsar heath
#

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?

drifting stump
#

its simply the hook triggered when the ui is going to be drawn

red tiger
# red tiger `prerender()` works too.

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.

drifting stump
#

i understand from that perspective but tying this to ticks is not a good choice

thick karma
red tiger
#

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.

thick karma
#

Is that Javaside entirely I'm guessing?

drifting stump
#

leads to either not enough updates or too many depending on ui fps settings

sour island
#

Models for attachments aren't rotated afaik - the only place I saw rotation was for world attachment

red tiger
finite radish
thick karma
#

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.

faint jewel
#

that would be the model

sour island
#

wrong in what way?

#

upside down?

thick karma
#

Skizot says model, Crater disagrees but I'm not clear on where its rotation IS defined, because I haven't yet seen that code.

faint jewel
#

rotated 90 degree

sour island
#

I faintly recall seeing that done in java

finite radish
#

Skizot is saying the attachment point is rotated incorrectly, I'm saying the model is using a rotation transform designed for the right hand

faint jewel
#

it IS.

drifting stump
#

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

faint jewel
#

i mean i've only been fucking with then for the past 3 weeks making all these damned held items.

drifting stump
#

easier to keep the background on prerender and only overwrite render for the rest without having to type again the background rendering

thick karma
#

Look at the series of pics

sour island
#

I see that

thick karma
#

They appear rotated 90 degrees off of where they should be for the bladed weapons

#

The pistol looks all kinds of wonky

finite radish
# faint jewel it IS.

if it were, then the bags would also be attached at the wrong point, because they use the same offset format.

sour island
#

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

thick karma
#

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

pulsar heath
#

if only i had some popcorns... best debate i've seen so far in this channel πŸ™‚

sour island
#

what would be the right design? a whole new model?

finite radish
#

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)

thick karma
#

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

finite radish
# sour island what would be the right design? a whole new model?

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
red tiger
#

I've had problems with bob and kate since 2014.

finite radish
pulsar heath
#

but it is an issue overall

finite radish
#

(because the offhand isn't meant for weapons)

pulsar heath
#

if nobody sees the house on fire its still an issue

thick karma
pulsar heath
#

and future proofing stuff is always good practice

thick karma
#

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.

finite radish
pulsar heath
#

but you do have a way to dust it

finite radish
#

true!

pulsar heath
#

which is not the case here

finite radish
#

and that's precisely what Burryaga aims to fix

pulsar heath
#

they should at least provide a "ladder"

sour island
#
         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");
         }
thick karma
#

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.

sour island
#

While I swear I saw the models being rotated this part of the model manager implies the prop2 oreintation is wrong

pulsar heath
#

but im still saying that if the code works for the interaction of the dual wield

sour island
#

as the arguments are identical

pulsar heath
#

you should just manipulate the model

#

to make it look good

#

and be done with it

thick karma
finite radish
thick karma
#

No @finite radish

#

Because they have special definitions

sour island
#

bags have models for left and right hands no?

finite radish
golden sparrow
finite radish
#

or rather, a good insight, if you already know that to be the case

red tiger
#

I'm lost about this convo because of the desire to compare semantics for the convo itself..

thick karma
#

Sorry, I wasn't clear whether you finished your comment believing "you'd also see incorrect behavior with the bags"

pulsar heath
#

the bags? i dont think so...

thick karma
#

Because you would NOT expect the same problem with bags because there is a custom treatment of the holding of the bags...

sour island
#
        ReplaceInSecondHand = Bag_GolfBag_LHand holdingbagleft,
        ReplaceInPrimaryHand = Bag_GolfBag_RHand holdingbagright,
red tiger
#

I assumed the t-pose of the model would properly transform the 4x4 matrix orientation of items.

finite radish
faint jewel
#

holdingbagleft is an ANIM MASK

#

not an attachment point.

sour island
thick karma
#

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.

sour island
#

so bags have their own approaches

#

and the secondary hand attachment is probably rotated wrong

faint jewel
#

if they fixed the rotation of prop2, the extra models wouldn't be necessary

#

for the bags i mean

finite radish
# sour island

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
faint jewel
#

those are for SPECIFIC BAGS.

finite radish
#

yes, we can see that πŸ™‚

#

I don't think anyone believes "bighikingbag" is referring to a generic bag

sour island
#
        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,
        }
faint jewel
#

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"

sour island
#

it's not rotated to fit the hand in a way that you think

#

they're different models

faint jewel
#

if you don't know then stop talking.

sour island
#

entirely

#

the offsets are adjustments

#

which is even more baffling

finite radish
finite radish
faint jewel
#

but you don't.

finite radish
#

I don't what? PepoThink

faint jewel
#

you want him to make a hammer into a bag. the attachment do NOT work that way

finite radish
#

...it's just a model, man. it doesn't care if it's a bag or a hammer or a dildo

sour island
#

is it possible to just change the player's prop2?

thick karma
#

You would have to do it in many animations @sour island

finite radish
#

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

thick karma
#

And then you would probably have to undo what they've done with bags

finite radish
#

but it looks like the bags don't even use that bone

thick karma
#

Because presumably the bag fix applied to a fixed prop2 would look wrong

thick karma
finite radish
#

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

thick karma
finite radish
#

because if they only animate the hand bones, then the prop bone should go with it

thick karma
#

This uses prop2, right?

pulsar heath
#

@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

sour island
#

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?

pulsar heath
#

this way ill just add a require to the mod ini and will be done with it

finite radish
# thick karma So this isn't used for equipping a backpack???

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

sour island
#

at that point whatever works works - there's not a right way to do shit lol

finite radish
#

KEKW true

sour island
#

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

thick karma
#

Fair enough

faint jewel
#

the bags are ATTACHED THE THE HAND BONE AND NOT THE PROP.

thick karma
#

Thanks for that tip @sour island

finite radish
#

we just said that skizot

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

faint jewel
sour island
#

not sure why you'd have offsets AND different models :\

finite radish
#

yeah me either tbh

faint jewel
#

the green bone is the hand bone it is good. the red bone is the prop and it's fucking wrong.

finite radish
#

maybe just issues between artist -> programmer

thick karma
sour island
#

and changing the bone's placement will require changing anything that touches prop2?

finite radish
#

but I don't know that for certain

thick karma
#

Not its "placement" per se, just its rotation needs to change supposedly.

sour island
thick karma
#

but yeah I assume it could have consequences

#

If I create a custom attachment type, what string references it?

#

Module.TypeName?

sour island
thick karma
#

Module.Sex.TypeName?

#

Something else entirely?

finite radish
#

hmm? no, you'd need to define a new model, if what I'm thinking is correct

thick karma
finite radish
#

not at a PC where I can test that atm, but it's worth a shot

sour island
#

it does - changes how it looks on the floor

finite radish
#

yeah, that's what I assumed at first, but I wasn't sure if it was recycling those values for attachment as well

sour island
#

but some of the items have different models for world attachment and in hand

thick karma
#

No apparent change when equipped.

sour island
#

some of the world models are held upside down

#

so atleast it's not that bad

thick karma
#

lol yeah but it looks pretty wonktastic

#

By the end of the swing it looks like I'm hitting myself.

red tiger
#

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.

thick karma
#

in what code?

red tiger
#

The engine itself.

#

So Java.

faint jewel
#

just need to have it rotate the model by 90 degrees after it's attached.

thick karma
#

Ohhhhhh

#

Yeah

finite radish
#

@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

thick karma
#

I figure this would be easily solved Java-side

faint jewel
#

and it ONLY Need the prop2 definition one, as all the other shit uses the hand bone.

thick karma
#

You can rotate the model object in your hands after you have it equipped?

faint jewel
#

yeah

thick karma
#

Whaaaat?

faint jewel
#

YEAH YEAH... THIS COULD WORK!

finite radish
red tiger
finite radish
#

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

red tiger
#

The goal would be to not need to define for both hands, correct?

finite radish
faint jewel
#

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.

finite radish
#

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

faint jewel
#

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.

red tiger
#

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? 🀞

thick karma
drifting ore
#

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.

thick karma
drifting ore
#

I'm blind. thanks man

thick karma
#

No worries.

#

If I knew more details I would provide them

#

Not my thing.

red tiger
#

It's freezing outside and the streets are now glass from sleet / frozen rain / ice. I need a drink.

dark wedge
#

I fixed the Offhand weapon rotation in my mod Fancy Handwork already btw. I applied a lefthandmask animation that corrects the rotation

thick karma
#

@finite radish @faint jewel !

faint jewel
#

i knew it was a mod i had dealt with recently.

#

i was looking for it too

#

which mask @dark wedge ?

#

FHholdingitemleft?

hot patrol
#

@thick karma you making an off hand attacking mod or something? Been dying for a good one to use with the amputation mod

faint jewel
#

burry, i suggest making fancy handiwork a requirement lol.

dark wedge
#

That, and FHholdinggunleft.
The lefthandmask actions fix guns and item rotations, righthandmask fixes the weapon wobble when you walk

faint jewel
#

so does your mod work for all 1handed items?

#

even custom ones?

dark wedge
#

Yup

faint jewel
#

bingo.

#

there's your fix burry

#

require that.

thick karma
#

@faint jewel I just subbed

thick karma
hot patrol
#

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

thick karma
finite radish
# thick karma <@134706201291128833> <@201100405390835713> !

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

finite radish
thick karma
#

Here's how @dark wedge made it look... nice work!

late hound
thick karma
red tiger
finite radish
thick karma
red tiger
#

He said the forbidden word.

#

(runs away)

finite radish
#

something something laptop hotel room something

thick karma
finite radish
thick karma
#

Not like they would take on that kind of labor if we didn't want them.

red tiger
finite radish
#

:~)

red tiger
#

Was actually there last weekend lol

#

I've actually PZ-modded a couple times in those.

#

Good stuff.

finite radish
#

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 KEKW

red tiger
#

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.

finite radish
#

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.

red tiger
#

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.

finite radish
#

the only work is in implementing it, more or less. from there it's fairly straightforward

red tiger
#

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.

finite radish
#

that last part is precisely what I'm addressing though.

red tiger
#

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.

finite radish
#

with my approach, it won't be an issue - encapsulation was the goal, and I've achieved it

red tiger
#

Giving some insight as an architect.

finite radish
#

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

red tiger
#

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.

finite radish
#

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)

finite radish
#

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)

red tiger
#

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.

finite radish
# red tiger Is it to avoid compilation?

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

red tiger
#

Maybe I don't quite understand your goals, concerns, and interests.

red tiger
#

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)

finite radish
# red tiger Maybe I don't quite understand your goals, concerns, and interests.

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

red tiger
finite radish
#

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

red tiger
red tiger
#

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.

tame mulch
#

(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

sour island
#

multiple consistent approaches

red tiger
#

Is this only for in Lua?

sour island
#

example download, article, video

red tiger
#

I'd use a wiki page and maybe a video as two examples.

tame mulch
#

I mean what include in this mod? (P.S. I will do text version on wiki + video)

red tiger
#

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

tame mulch
sour island
#

I guess adding a new item would be a good step

red tiger
sour island
#

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

red tiger
#

PZ modding for dummies

#

I can get behind that

sour island
#

scripts and recipecode alone is a rabbithole

#

especially when you get to doParam and scriptManager

red tiger
#

(Runs away and writes a UI program to aid in scripts like I promised 6 months ago)

#

__>

sour island
#

making that item a weapon / clothing can be an offshoot series

red tiger
sour island
#

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

sour island
#

Does dedicate operate differently to hosting from the main menu?

pulsar heath
#

i can check on my dedicated logs if you want to

#

or i can just send them to you

sour island
#

cause I used 'sendClientCommand' with twitch integration and the code then fires in co-op console and isServer==true

tame mulch
sour island
#

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'

tame mulch
#

I think, if you host, on your PC runs client+server, so this log is shows

drifting stump
#

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

sour island
#

there are logs for co-op (server) and the regular console (client)

drifting stump
#

plus it doesnt inherit changes down the road to super classes

sour island
#

I'm just not sure how to make it so the system is occurring on the true server where isServer()==true

tame mulch
sour island
#

I can try to build an example for testing

drifting stump
#

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

finite radish
drifting stump
#

you keep saying how terrible the "tis oop" is

#

they literally copy pasted from the lua docs

finite radish
#

that's an example

#

do you only use code that's on the Lua docs?

humble oriole
#

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?

drifting stump
#

theres an event that is triggered after they are loaded

tawdry moss
#

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?

sour island
#

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

tawdry moss
bronze yoke
sour island
#

Yes, will be doing so

sour island
#

just kind of confused why this is a normal behavior

#

I wonder if the opposite is true for server and /client/ ?

bronze yoke
#

it's not

#

server runs on the client but client doesn't run on the server, thankfully

sour island
#

so all this time I was writing EHE thinking it was server side drunk

bronze yoke
#

oh man...

sour island
#

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

red tiger
finite radish
# sour island just kind of confused why this is a normal behavior

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

sour island
#

what about onTick?

bronze yoke
#

it's a pretty weird trap, i wonder if the server folder actually did behave as expected in an older version or something?

sour island
#

afaik the old MP was all leveraged off of the host server

#

the new peer-to-peer stuff might have caused the discrepancy

bronze yoke
#

i think all the time events do run on the server

red tiger
#

@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)

bronze yoke
#

yeah i thought it could be something like that too

red tiger
#

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.

bronze yoke
#

the java code stressed

sour island
#

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

red tiger
#

I'd expect those API flags to be consistent with what anyone would expect them to be: simple yes / no.

finite radish
red tiger
#

I've seen this behavior before.

#

Maybe we could make additional API to give the expected result with additional checks under the hood.

sour island
#

is OnTick timed differently between server and client?

finite radish
#

it's tied to processor capability, so yes - it's even different between clients

sour island
red tiger
sour island
#

but I am both

#

. _ .

#

this is counter+1'ing each ontick

finite radish
sour island
#

My server is a fair bit slower

bronze yoke
#

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?

finite radish
#

could be. lots of dedicated servers for other games use a fixed tickrate parameter

bronze yoke
#

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

sour island
#

let me check the java I guess

red tiger
#

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.

finite radish
bronze yoke
#

they run on different ticks but in the same thread

red tiger
finite radish
#

i mean yeah, everything runs on the same thread - it has to

bronze yoke
#

that's what the ui update rate option is about

red tiger
#

It is redundant in the way you're looking at it.

red tiger
finite radish
red tiger
finite radish
#

since when?

red tiger
#

I don't know.. I read the code I guess?

finite radish
#

I just recently looked at the docs and they specifically state you shouldn't do that

bronze yoke
#

i'd read on kahlua's site- yeah

finite radish
#

like, ever

#

are you getting it confused with coroutine? because that has nothing to do with threading

red tiger
#

They have the option.

finite radish
#

they don't though

#

not with Kahlua

tawdry moss
#

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?

red tiger
#

Haha okay buddy.

finite radish
#

from the horse's mouth

bronze yoke
red tiger
#

You can't execute the same Lua environment in two threads. You can execute different Lua in different threads.

tawdry moss
# bronze yoke it didn't save properly? what do you mean?

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

finite radish
bronze yoke
#

getAuthor() probably isn't returning a username

#

it might be a character name or something

tawdry moss
#

It’s returning β€œpieandcheese647” when I use it on a private server

drifting stump
#

additional note on the update vs render
update is triggered every 100ms
render is triggered every ui frame

tawdry moss
#

Not character name

red tiger
#

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.

bronze yoke
#

use getPlayerFromUsername()

red tiger
#

tbh fuck all that technicality bs.

tawdry moss
bronze yoke
#

you're using getPlayerByUsername

finite radish
tawdry moss
#

Hah

#

Thanks

sour island
#

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

finite radish
drifting stump
#

from testing

#

and its triggered by the games main loop

finite radish
#

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

drifting stump
#

it was triggered 10 times per second independently of any other fps setting

finite radish
#

oh, hmm

#

per game second, or OS second?

drifting stump
#

ui uncapped, capped at whatever amount, game fps uncapped or capped

bronze yoke
#

10 times per game second 😟

#

a game second is VERY short you know

finite radish
#

ikr lol

drifting stump
#

irl time

red tiger
#

Isn't UPS for PZ targeting 30 or 50?

finite radish
#

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

red tiger
#

It's very bad to not target a UPS rate. It's fine to implement both locked and unlocked FPS.

finite radish
#

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

red tiger
#

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.

finite radish
#

not if the state is managed, which it should be in every case

red tiger
#

Artifacts and time-based components can give way to complex bugs.

finite radish
#

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

red tiger
#

Simple applications are fine. They typically sleep the thread which is a form of capping UPS.

red tiger
finite radish
#

I wasn't talking down to you, but okay!

wraith dew
#

Hello. How to prevent player build thing on sand terrain type ?

ancient grail
polar thicket
#

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

sour island
#

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

faint jewel
#

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.

sour island
#

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

faint jewel
#

lol

sour island
#

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

finite radish
bronze yoke
#

i'm pretty sure there's a target myself

finite radish
#

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

bronze yoke
#

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

finite radish
#

i believe the tickrate for servers thing, that'd make sense

polar thicket
#

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?

little holly
#

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

sour island
finite radish
little holly
#

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)
fast galleon
little holly
#

oh?

fast galleon
#

please check sprite

little holly
#

I'm reusing code from the steampowered generator so I guess that'd also break ISA

bronze yoke
#

is the moddata initialised somewhere?

#

you only set the wind moddata after checking if it already exists

polar thicket
#

We changed the water.moddata thingy

little holly
#

I think it is, the parameter is always showing when the generator runs

polar thicket
#

we renamed it throughout whole code to reuse that

#

^^

fast galleon
#
    if instanceof(isoObject, 'IsoGenerator') and isoObject:getTextureName() == "windturbine___" then
        NewWindTurbine(isoObject)
    end
little holly
#

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

little holly
#

done

fast galleon
#

it's not exactly break, just that it includes any generator

little holly
#

yea very fair

#

it's just reusing the steampowered generator code so it may be an issue in there too then

bronze yoke
#

do you have permission to use that mod's code?

fast galleon
polar thicket
#

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

fast galleon
#

you need MapObjects to trigger those commands

polar thicket
#

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

finite radish
# sour island The counter is just counting the event firing - not really useful, but I suppose...

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

polar thicket
#

the generator info window also says our values like "wind %"

little holly
# bronze yoke do you have permission to use that mod's code?

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

polar thicket
bronze yoke
#

oh, i suppose if you're not planning to release the mod in that state it's fine

sour island
little holly
#

it's more about trying to get something that works, and then once we do we can redo it in a more clean way

sour island
#

so I think I'm fine even if the rate is drastically different

polar thicket
#

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

little holly
#

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

sour island
#

but I can see something like this causing alot of issues for people trying to sync a mod between MP/SP

polar thicket
bronze yoke
#

generator mods are one of the more complicated kinds of mods

little holly
#

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

finite radish
#

also might be worth checking out OnRenderTick, which would be wild if it runs on the server

little holly
#

and how it differentiates between the server and client is like 'if client then return'? I think? or does the file structure actually matter?

polar thicket
#

Is there any way we could get the exact lua codes the standard generator uses?

finite radish
#

it's not hidden or anything

polar thicket
#

which file?

#

I know its not hidden

#

we just dont know what files

fast galleon
#

@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).

sour island
little holly
polar thicket
#

@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.

little holly
#

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

polar thicket
#

That could include multiplayer parts as well

#

the most basic stuff

finite radish
little holly
polar thicket
finite radish
#

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

polar thicket
fast galleon
#

vanilla has improved syncing of default generators this year

polar thicket
#

^^

#

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

little holly
polar thicket
#

all art assets are made for our mod. We only lack the code part

little holly
#

I'll try use the vanilla luas and see how far we can get

polar thicket
# little holly that helps

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

little holly
#

this is why git is useful, the first version was a fantasy from chatgpt that had no chance of ever working at all :P

polar thicket
#

those that makes the recipes work

sour island
little holly
#

you don't have to keep backups thanks to git

polar thicket
#

ah ok

#

Remove all the luas and lua folders

little holly
polar thicket
#

We have to keep our namings tho

finite radish
little holly
#

just make sure to keep the files we do need, but lets discuss that in private

finite radish
#

if you're just starting out though, this is going to be a nearly impossible first project

sour island
#

it's several jets stuck in a loop

#

not sure why that's happening now

finite radish
polar thicket
#

We are getting the hand on how certain things work already

fast galleon
#

"this year", should be "last year" ded

polar thicket
#

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...

finite radish
# polar thicket Why tho?

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)

little holly
finite radish
#

good luck 🫑

little holly
#

I like to think I'm somewhat decent with code but- ahh yea that'll help

bronze yoke
#

this is a pretty crazy first mod

polar thicket
little holly
#

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

finite radish
#

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

little holly
#

yea games are like that, that's okay

bronze yoke
#

it's difficult to call it a modding api

finite radish
#

it's like a modding allowance

bronze yoke
#

it's more like they exposed a bunch of methods and went 'good luck!'

little holly
#

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

finite radish
#

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"

little holly
#

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

polar thicket
#

At least this game has helpfull debugging tools

little holly
#

but I've gotten this far and I'm sure I can make something

polar thicket
#

Picking apart the steamgen mod teached us a lot

sour island
#

when spawning items/zombies/vehicles for MP the recommended way is to send a command to all clients right?

polar thicket
#

we did it only for educational reasons

finite radish
little holly
#

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

finite radish
#

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

sour island
#

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

finite radish
#

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

sour island
#

if events occurred soon enough it could start trying to broadcast two events through the same marker and set of emitters

#

. _ .

finite radish
#

they get called synchronously though, so that shouldn't be possible

#

(in theory)

sour island
#

I can test with the events that drop off zombies and trash

#

atleast that seems to still work

finite radish
#

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

sour island
#

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

hot patrol
#

Anyone taking commissions ATM? I have a mod I would like to give a facelift to.

sour island
#

seems like sounds played on the server don't relay to clients unless isClient is true

#

where all the clients can hear it???

red tiger
sour island
#

ty

finite radish
sour island
#

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

finite radish
#

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

sour island
#

I'm not sure - the fmod stuff is very convoluted

finite radish
#

yeah I can imagine, I've seen as much in other games before and I had very little idea what was going on

red tiger
#

Can confirm.

sour island
#

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

finite radish
#

i wouldn't spend too much time on it, i think the sound engine is getting more changes with B42

sour island
#

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

finite radish
#

Try This One Neat Trick To Play Sounds (Server Owners HATE This!)

#

KEKW jk i doubt it'll have that much effect on server overhead

mystic vessel
#

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

fast galleon
#

is it possible to make the player into an NPC to run on some logic drunk

mystic vessel
#

I'm wanting to make the "Nuclear biochemical mask" spawn normally on the map

fast galleon
#

you need to prepare a list of containers you want for the item and a function to insert them

mystic vessel
fast galleon
# mystic vessel Where can I do this? and is there any example of this here on discord or on the ...
sour island
#

is there something for transmitting damage or some such?

#

seems as though the server isn't staggering or killing zombies

fast galleon
finite radish
sour island
#

isn't that how the current NPC mods do it

#

they're all just isoPlayers

finite radish
#

i think so, yeah. more or less. at least in the case of SuperbSurvivors, can't speak to any others

sour island
#

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

fast galleon
#

TIS has said that zombies will stay client side with owner system, this might be affecting things

sour island
#

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

red tiger
#

I remember the lag bite days..

sour island
#

now we have shared ping lag

red tiger
sour island
#

true I can always kill the other guy

red tiger
#

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.

bronze yoke
#

i remember when b41 mp came out the blog post basically ended with 'don't do pvp, it's shit'

sour island
#

PVP needs alot of work lol

craggy depot
#

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.

sour island
#

The game could use a struggle or grapple mechanic

sour island
#

I know I bring up SS13 alot but just rip them off

#

and to a lesser degree Barotrauma

red tiger
#

Also can we get chain hooks on vehicles so we can drive around zeds hooked up on them to bounce into things?

#

Kthx.

#

haha

sour island
#

adding a targeting system would be fun too

#

rn it's all RNG as to what body part you hit

red tiger
#

Aiming in iso has always been such a strange animal.

sour island
#

I just mean - on the paper doll health panel

#

drag a target around the body

#

as a relative preferred area

red tiger
#

Modding discussion is here.

sour island
#

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

bronze yoke
red tiger
#

Nvm

bronze yoke
#

just general mod related tech support

red tiger
#

Ahhh

#

You can tell that I don't help people here. xD

sour island
#

basically a purgatory to alleviate tech_support

red tiger
#

Also what a name, swapping B and T like that.

#

A LotR fan in hiding.

#

God that guy was OP.

craggy depot
# red tiger Modding discussion is here.

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.

craggy depot
#

with mods?

sour island
#

it's modding_(tech_)support

craggy depot
#

Ok

craggy depot
pulsar heath
#

you should start by having a read on that link

red tiger
#

I'd think of dressing up zeds as vampires in vamp clothing.

#

The logic is something I'm not sure how to go about.

pulsar heath
#

well theres is a mod callend zombies fear the sun that might help on the logic

red tiger
#

I know that zeds operate as boids with leader zeds. Maybe you could hook into that with pathing?

pulsar heath
#

since it makes all zombies hide during day time inside the nearby buildings

pulsar heath
#

the logic there should be easy to apply on a vampire mod

red tiger
#

I'd further clarify if I had more info on pathing.

craggy depot
pulsar heath
#

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

red tiger
#

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.

sour island
red tiger
#

He's just living life a breath and a groan at a time.

sour island
#

well the jets are somehow moving back and forthe

#

not sure what that's about

#

none of the other events do this

pulsar heath
#

?

#

the jets dont just cross the area and fly away?

#

looping back and forth?

sour island
#

occasionally

craggy depot
sour island
#

moving fixes it which is equally weird

red tiger
sour island
#

prob some logic failing

red tiger
#

I'm a UI / tools / Java mod guy.

#

This is why I'm useless in here.

#

x)