#mod_development

1 messages Β· Page 105 of 1

jaunty marten
ancient grail
#

Its a valid question

sour island
#

Most people don't even know how the bonus XP works for starting levels

sour island
#

"Does this mod work?"

pulsar heath
ancient grail
#

Hehe

jaunty marten
#

is it mod for pz? I need for project zomboid

pulsar heath
#

no its for tetris... i just wanted to put in the pz workshop 'cause i couldnt find the tetris workshop

thick karma
#

Y'all I am trying to figure out how to horizontally mirror a vanilla animation in fragMOTION... can anyone help me understand what I'm missing? I can mirror the whole animation and it LOOKS right, but because the right-side objects move to the left side and vice versa, it borks out when I export it for use in the game. Can anyone tell me simply how to import a vanilla .x into fragMOTION, mirror it horizontally in a way that looks actually mirrored, and export it for use in game?

(Copied from #modeling in case they don't know.)

jaunty marten
#

always wanted weapons mod for tetris..

sour island
#

peach may know

#

heh

#

i turned off knock down

#

and the zombies are still getting dropped

pulsar heath
#

stale is gone?

sour island
#

seems like when they got stale the game knocks them down

ancient grail
sour island
#

I just have health change going on

ancient grail
#

That guy should be a meme

sour island
#

I like the 'theft of the west' guy

red tiger
jaunty marten
ancient grail
#

πŸ‘Œ

pulsar heath
#

πŸ˜„

red tiger
#

Credit me if used. Thx.

#

It's a working model for Lua code.

sour island
#

I forgot where it was written - but someone got super angry about the Stalker PZ community spotlight

red tiger
#

@pulsar heath @jaunty marten

jaunty marten
ancient grail
#

Whats goin on everyone starting to regress

#

Posted it jab

jaunty marten
pulsar heath
#

added to the favourites... will tinker with it after i get off work tonight... even if im on vacation... the money is good i need to get out for a change πŸ˜„

#

i still need to prep the set for tonight... or i can just wing it

jaunty marten
#

I was just thinking about that recently cos automatically load is a shit cos u can't create own order to load files

#

awesome

red tiger
#

I can't do anything about people listening for the server command and contents, however the design protects against file override / global override.

#

The loader can be customized.

red tiger
#

Server-specific content and hot reloading makes this loader very useful.

sour island
#

It's not "how the devs intended you to play" dude. You made a sandbox preset inspired by zomboid... with a crap load of mods and multihit enabled. The theft of the true zomboid experience continues - rubbing yourself on anything you think is cool. Zomboid is a HARD game based on a T H E A P O C A L Y P S E, a S U R V I V A L game, where a POST A P O C A L Y P T I C society could be formed. Casuals trying to make their OWN "zomboid"... they don't care about indie stone devs, they don't understand the atmosphere, they don't respect the heritage - the HERITAGE of ZOMBOID... they just want it for themselves. No difficulty, just guns and maid outfits, CDDA or Dying Light is what you want, steal from ANOTHER zombie game. I'm a redditor I see it clearly. Casuals and modders will NEVER be VANILLA APOCALYPSE PLAYERS.
I wrote one for more hardcore pz players

red tiger
#

Going back to work here in a couple of minutes.

jaunty marten
pulsar heath
#

the ppl these days... if you dont like it, just dont F#"$#$ use it

#

simple isnt it?

pulsar heath
#

its like one dude that EMAILED ME like 20 times

#

dunno how the hell he got my email address

sour island
#

I wrote the 2nd as a copypasta lol

pulsar heath
#

asking for me to remove the car events from the mod

red tiger
pulsar heath
#

... dude... just dont enable it...

ancient grail
#

Ehat happen to the overlay thing earlier vishnha you got to work like u wanted

#

?

pulsar heath
#

it only does what you let it do... if you dont check mark the events they will not be triggered

nova socket
ancient grail
nova socket
ancient grail
#

Keyboard warrior

red tiger
#

Server-specific content for mods is the big thing for this mod loader.

#

People would have to upload it as workshop content which is then DMCA territory. :D

jaunty marten
ancient grail
#

Plumber mode mario

sour island
red tiger
#

The loader itself isn't even in a file.

jaunty marten
#

I created legacy code for me by myself..

red tiger
#

Only the boot loader is.

#

So the code that operates to send the mod code and the mod code are prevented from file overwriting / overriding.

pulsar heath
#

and performance wise, all good?

jaunty marten
ancient grail
#

β˜•

#

Here you take the buggest coffee

#

Biggest*

pulsar heath
#

well ill test it out later... time to get ready to work for a few hours...

jaunty marten
#

but at least I didn't broke pipes linking and sprites set correctly

pulsar heath
#

bbl

ancient grail
#

Have a good one m3ss

#

@thick karma youve been on modelling the whole day πŸ™‚

red tiger
#

I'm going to work on my UML later on today.

thick karma
#

@ancient grail Don't tell me what to do!

red tiger
#

It's getting populated.. haha

ancient grail
#

Im not

red tiger
#

(From last night)

#

Planning my next Lua transpiler.

jaunty marten
thick karma
sour island
#

I wrote it based on the original message

thick karma
#

ohhhhhhhh lmao

#

I seeeeee

#

Got ya

sour island
#

that comment was in response to the stalker modpack spotlight

red tiger
#

I ignore all of that lol

#

I mod, not customer service.

sour island
#

hm

jaunty marten
quasi kernel
#

Me coming back to the modding scene after like a month only to notice another farming mod is popular and I get to patch it

red tiger
finite radish
#

i was gonna say, if that was a real message... the "heritage of zomboid" is multihit. the new "default" difficulty is relatively new

finite radish
jaunty marten
red tiger
#

Oh lol

finite radish
quasi kernel
#

Mmm cawfee

red tiger
jaunty marten
sour island
#

someone made a thread saying me making a fake comment image linked to my github was sketchy - cause he had a question about flares

#

never asked his flare question

red tiger
sour island
#

also I've been looking around to see what syncs zombies with no luck

ancient grail
quasi kernel
#

I'm curious, has anyone else ever had a temporary "falling out" with programming?

#

I had one for like a good month or two and wanted nothing to do with it.

#

Entirely possible tbh, just before it happened I worked on a bunch of systems in a game for a friend for like a week straight so

quasi kernel
#

Glad I'm not the only one then hehe

jaunty marten
red tiger
#

It's called "Burnout" usually.

#

I mitigate burnout by having many projects to work on for when the one I'm currently working on is stuck on a issue.

#

Working on a project for a long time can get boring.

sour island
#

I like making dumb posters

#

good stress relief

quasi kernel
#

Amazing

red tiger
sour island
#

seeing his name pop up typing

jaunty marten
#

I can completely drop the project when trying to do smth and game crashes so I don't want to open it again.. it's done LUL

sour island
tame mulch
red tiger
bronze yoke
#

best way to avoid burn out is to just stop when you get bored... obviously not as much of an option if you're doing it as a job, but forcing yourself doesn't help

sour island
#

like i said, I went to school for art

quasi kernel
#

Fair statements from all of y'all, thank you

tame mulch
#

πŸ˜„

quasi kernel
#

I usually end up hyperfixating on something and end up destroying myself trying to fix every little.thing.

jaunty marten
quasi kernel
#

Because I have determination like no other, I will literally break both of my legs if it means I get to fix every tiny problem in a mod. Thing is that usually doesn't happen without several nights of lost sleep and problems sneaking in anyways.

sour island
#

also made the scrap mod posters -

jaunty marten
#

will be so funny with first spawn in horde

sour island
#

I hope one of my dumb posters ends up on a spotlight

#

I dropped the ball with EHE

quasi kernel
#

EHE is hands down my favorite mod by the way, thank you for making it.

jaunty marten
sour island
#

he's wearing a tig welded baseball hat

#

the cowboy hat is tig welded too

jaunty marten
#

it's fine XD

hot patrol
jaunty marten
sour island
quasi kernel
#

I'm still upset that I lost a week of my life to virtual plants

sour island
#

discord used to flag this as inappropriate

#

yes the walls are from googling 'fancy wall paper' images skewed

quasi kernel
#

Outstanding

sour island
#

the floor is minecraft carpet

jaunty marten
quasi kernel
#

Yes

tame mulch
sour island
#

wait for SteamCoin

#

would be nice if you could use like a million points for a dollar atleast

jaunty marten
tame mulch
jaunty marten
#

it will be in b42?

sour island
#

turn off your cpu fan if you die

jaunty marten
willow estuary
# tame mulch Cool idea btw

Could be a lot of fun, just a problem with the middle parties making it more complicated than it could be for the implementation I had in mind stressed

sour island
#

You mean how every company that sells a keyboard or mouse has it's own lighting program that doesn't work with eacother?

tame mulch
willow estuary
tame mulch
sour island
#

Since there's two red names here - any clue how to apply damage to zombies in MP that doesn't cause them to blip out of the game?

#

The damage is being applied clientside (they fall with out being told to, then pop out of the game)

#

serverside didn't seem to do anything (no knock down either)

tame mulch
#

I am not sure that is possible (serverside), but why not send command from server to client and apply damage on client side?

sour island
#

I am doing that now

#

the zombies stop being interactable and disappear shortly

#

like I can walk on top of them and can't swing at them

#

then they vanish

tame mulch
#

Hmmm. I think this connected with way how zombies work in MP

sour island
#

I also commented out the 'zombie:knockdown()' and they're still falling to the ground

#

so it's like lying on the floor is their goto 'uh oh somethings wrong'

#

going through the java but it's kind of going in circles between isogamechar and isozombie

#

I don't see a 'transmit' 'send' or anything

willow estuary
#

I don't do anything that affects or interacts with "active" zombies or their actions so the MP zombie handling, it's all Quantum Rocket Surgery to my 2 brain cells.

tame mulch
#

Maybe this is protection for incorrect behaviour in MP?

willow estuary
#

But yes, I think that.

sour island
#

Same - the fact there is two zombiemanagers (virtual and 'normal'?) and it touches some undisclosed c++ stuff makes me not want to mess with it

tame mulch
willow estuary
#

Oh, yes, there's definitely zombie handling stuff that's in C++ and not the java.

sour island
#

I wonder if I can just run Hit() using the IsoPlayer.instance

#

zombie:SetHealth() causes the issue as well as :applyDamageFromVehicle() which doesnt need a vehicle ironically

#

server's top player None None

dark wedge
sour island
#

atleast knockdown doesn't trigger the issue

finite radish
#

@sour island NetworkZombieVariables.setInt(realZombieAlways, (short)0, zombiePacket.realHealth);
some of the other bits in the NetworkZombieSimulator (mainly in parseZombie) may be helpful to figure out what's going on behind the scenes

#

the realZombieAlways object in that function is the same as what's being spawned by you and m3ss

#

I doubt you'll be able to actually call much of that code directly without getting the player's UdpConnection, but the code there may help lead you toward why the behavior is happening

#

basically the parseZombie there is taking a packet from the player, and then using the data in the buffer to determine certain values so the server knows what's going on with the zombie (and then it's sent out to wherever it's needed)

#

(at least, that's what I got out of it - I didn't look into it indepth)

sour island
#

I'll see if it's used with attacks

#

ah PlayerHitZombiePacket

#

I guess my issue is zombies generally don't receive damage on the server side

#

I wonder how fire works in that regard

#

this.Health -= this.FireKillRate * GameTime.instance.getMultiplier() / 2.0F;
this.setAttackedBy((IsoGameCharacter)null);

#
this.Health -= this.FireKillRate * GameTime.instance.getMultiplier() / 2.0F;
this.setAttackedBy((IsoGameCharacter)null);
#

hm

red tiger
#

lol

finite radish
# sour island hm

there's a few methods in IsoZombie that might helpful, like hitConsequences. it might be what's causing your weird knockdown behavior though, if whatever damage function you're using calls it

red tiger
#

Why hasn't the text render code in IsoGameCharacter not been arbitrated to a simple string API?

#
isoZombie:setCustomName('Special Zed');
#

πŸ₯Ί

finite radish
#

isn't that what halo notes are for? or is that something else entirely?

red tiger
#

All the label needs is a string field with a getter setter.

sour island
#

I think I figured it out or atleast got closer

#

will update if confirmed

ancient grail
# sour island

Your style is a cross of andy warhol pop art + horror vacui + modern + mixmedia

ancient grail
sour island
#

that picture is in reference to a classic early popart piece

red tiger
sour island
finite radish
#

me when i get home from work

ancient grail
#

Let us capture everything that happens lol

finite radish
#

you can always just write your own

#

ez pz

sour island
#

welp sounds dumb but

#

the issue was I wasnt calling death

finite radish
sour island
#

prior to this I was letting their update catch their health was <= 0

finite radish
#

like, you needed the grim reaper's phone number?

#

oh SMILERS

sour island
#

so I guess the server was like 'well this is fucked, goodbye'

jaunty marten
#

goodbye, Chuck

sour island
#

nvm

#

not the issue

ancient grail
#

If i knew how i wouldnt have said that

sour island
#

seems related to if they die or not though

#

the attack heli doesnt do as much damage as the rifle heli

#

and the rifle heli is causing deletes

jaunty marten
sour island
#

its the attack code for EHE

#

I made EHE actually serversided

#

this would imply EHE is probably not even working on the workshop

finite radish
#

there's a guide somewhere (maybe fenris's) that shows you how to add your event handler to the Events.* table so it's usable everywhere

sour island
#

Everything works except the damage part - the server deletes the zombies

finite radish
ancient grail
jaunty marten
bronze yoke
#

adding an event is as simple as

-- at startup:
LuaEventManager.AddEvent("EventName")
-- then when you want to actually trigger the event:
triggerEvent("EventName", param1, param2, etc...)
finite radish
ancient grail
red tiger
#

Oh wait

#

nvm

#

You did it

#

aaaaaaaaaaaaaaaaaaa

#

I remember people triggering the event to add it and misread yours as doing just that.

sour island
#

so I set lowest health to 0.01

#

the issue is precisely killing zombies lol

#

I wonder if I should leave the code on server side but only send the knock code through πŸ€”

fast galleon
#

thinking about the attached sprites... seems simple to make in-game drawings now

tawdry moss
#

after some more toiling, I got the zombies to spawn serverside but the outfit assignment isnt working. They're spawning with regular outfits for the area and not the cutsom outfit I'm trying to use

#

how can i give the zombies custom outfits

red tiger
#

When I thought of me getting out of work on Friday and counting down the time before working on my own stuff: I thought of this lol

#

This, but in my head right now

#

Like why would my brain do this to me. =(

#

Been thinking about doing a modding jam session this weekend.

sour island
#

back at the problem again

#

needed the break, but applying the function serverside has the same issue

#

zombies meant to die blip

#

the damage should definitely be carried out clientside either way

winter thunder
#

So uh- Been awhile, off and on working, teaching myself a lot as I have worked... But uh

#

I got my drug mod to actual run as intended. Which I couldnt have done without the help of many of you lovely people <3

#

So I figured I would jump in here and share some appreciation spiffo

sour island
#

so I think I know the issue with the bodies now

#

but not sure how to fix it

#

unless I'm mistaken calling zombie:Kill(nil, true) should be calling isoZombie:Kill() but I have a feeling it's calling IsoGamCharacter:Kill() ? or would that not be possible?

weak sierra
#

im having one of those days.. i put a lua file in a mod, run a test server/client with the mod, one of the first lines is a print statement, and neither server nor client are running it :|

#

no syntax errors

#

first three lines are this

#
UdderlySandboxReversionFix = {}
local modName = "UdderlySandboxReversionFix"
print("["..modName.."] Initializing..")```
#

and i don't even see that print statement

#

this is in shared..

#

same deal on client

#

ah wait i did a stupid

#

i copied the non-testing version to the test mod workshop folder but i didn't rename the inner mod

#

derp.

tawdry moss
#

Which is super stupid

sour island
#

tried that previously but I'm going to retry it and check the variables

#

all those functions call eachother

#

something is definitely not triggering

tawdry moss
#

I’m trying to make a mod where the player says β€œdog goblin” in MP chat and a special super powerful zombie with a goofy outfit spawns.

I’ve tried looking at code from EHE Spiffo event to get something akin to that, a virtually unkillable zombie that can push cars away, but it doesn’t seem like the outfit containing the AI item is applying correctly for me. How did you get the outfits to apply?

sour island
#

outfits need to be defined in xml

tawdry moss
#

I swear if that’s the problem

sour island
#

got it working

#

god damn

#

so to get zombies to die on clientside you have to apply something to be it's attacker

#

the game uses a dummy zombie for this if it needs one

#
            targetHostile:setAttackedBy(getCell():getFakeZombieForHit())
            targetHostile:becomeCorpse()
sick umbra
#

does anyone knows the purpose of the MetalValue property when item scripting?

weak sierra
#

not sure if it serves a purpose in vanilla or not but it's very convenient for mods :P

ancient grail
ancient grail
ancient grail
willow estuary
#

I believe that nil works, as in

zed:Kill(nil)
ancient grail
#
getPlayer():Kill(getPlayer())

hehehe

ancient grail
#

how do i stop rotation using xml

tame mulch
ancient grail
#

Aw snap... I wanted to minimize lua as it needs sendcommands

tame mulch
#

What exactly you want to do with anims?

ancient grail
#

Gestures

tame mulch
#

Like emotes?

ancient grail
#

For an rp proj they want multiple animstions available
But diffrent from the authentic anim
I mean
For example the sprint
Instead of just moving without key press im going to change their actual run. Ive done this part tho

#

Then sorta like the sitdown
When you move you stop but instead tha snimations used are like the falldown animations

#

But will stay on thr ground till you move

And not loop

tame mulch
#

I did something similar with fall down anim and FitnessState

ancient grail
#

Hmmm are you doing an injury mod too?

#

I also got the idea of leg injury would make player need to crawl to move untill a certain time

formal hamlet
#

Is there's some way to use a custom animation for eating/consuming an item?

ancient grail
#

You would have to mod the xml

formal hamlet
#

So you can't add a EatType?

ancient grail
#

You can you have to add an xmknwith that.eattype

#

I think

#

Bkt related to what you are going for but its still technically eating hehe

formal hamlet
#

Thanks~

dark wedge
#

cool. i'm much further along than i thought. really just need to add some sandbox vars for configuration now:

drifting ore
#

omg dude it looks so clean also lol

ancient grail
#

Nice

#

Time to donthe decapitation mod

dark wedge
#

Thanks! It has full controller/co-op support now, it works like how you would expect, i.e. having only an offhand you can attack like normal, and i also got my offhand speed calculation to match the vanilla's except for backpacks affecting the speed as you can't get the speedmodifier from non-clothing items it seems. but, i didn't see any vanilla bags that gave one so should be fine?
Last thing i'm going to add is an auto-offhand setting so when you're dual-wielding you'll automatically alternate between primary and secondary if enabled (always start with right though). if you have that disabled, you have to hold control (or L Bumper) to do the offhand attack

drifting ore
#

damn man

#

i love that you add the options to disable and enable

dark wedge
#

no guns yet. i'm going to release just the melee first so i can squish bugs, balance, and get feedback on it. that'll be the next big release.

drifting ore
#

I love that you tested with amputated arms and all haha

#

about to give a whole new spin to the game here

dark wedge
#

ha. yea, an offhand mod that worked with TOC was a common request, so wanted to make sure i was compatible.

tame mulch
#

Need help - Anyone have link for tutorial how to decompile PZ class files to java files?

#

I only found how to decompile to set in env of IntelliJ

mossy garnet
#

I think even if you decompile them it will all be obfuscated right? I have used JD-GUI in the past

#

It's standalone

tame mulch
#

JD-GUI now not work because game started use new version of java

#

Decompile is possible, but I don't remember where guide :/

tardy wren
#

How to run a bit of code only if it's done on a server, and vice versa only on a client?

dark wedge
tardy wren
#

Is it that simple?

dark wedge
#

yup. those are built-in functions so you can conditionally control where code runs. of course, server code needs to be in the "server" or "shared" folders too

tardy wren
#

Right, uh... I'll check it out

#

A friend made some code but it don't run

#

Trying to load sandbox options from globabModData

#

Cuz for some reason they don't update properly

vast nacelle
#

Can someone more familiar with the Java side enlighten me on how/when an MP server parses the Procedural Distributions list?

I had thought by adding my items to the PD list during the OnInitGlobalModData event would let me use sandbox settings to adjust the chances on them.
But when I started a server up for testing and used the "Refill Container" admin/debug option, my items never spawn, because it seems the Java side only parses the PD list when starting the world but before sandbox options are loaded or global mod data is initialized. (LootZed says my items should be able to spawn... because LootZed actively parses the PD list unlike the Java Item Picker... Thanks TIS)
Except... they can still spawn somehow through some nebulous process because during play sessions with some friends, we do find the items where I intended them to spawn.
So something is causing the Java Item Picker to reparse the list.

Is it reparsing it after a new person joins a server? Or is there some other circumstance that forces the server to reparse the PD list?

dark wedge
#

I cannot answer all of your questions, as I do not know. However, you can try to use the event OnPreDistributionMerge. SanboxVars exist here, and based on the name i would expect it to happen before it builds the PD list. it definitely happens before OnInitGlobalModData

thick karma
#

@tame mulch hey I know you were in here taking guide requests... Can we get one for creating a mirror copy of a vanilla animation? I'm guessing if y'all do this there must be an easier way than what I've seen...

tame mulch
thick karma
#

I have fragmo but I don't know the correct steps to flip it in a way that works out in game.

#

I can Mirror All over X axis, but it seems to flip too many things, such that even though the animation LOOKS perfect after that, it doesn't work in game

#

Then I tried flipping poses on all keyframes but that creates a rather obviously borked reflection

ancient grail
#

Maybe cuz the bone is flipped

#

Like the left is right and stuff
Im not telling you what to do tho 🀣

thick karma
#

Lol so many maybes but I'm really looking for some definitely stuff

#

I renamed the right bones as left and vice versa after my mirror flip; that did not fix the issue.

#

There is clearly some specific process for flipping animations correctly and efficiently that I was hoping someone knows

#

I imagine these nice Mirror All functions wouldn't exist if there were no possible way to get them to work nicely.

vast nacelle
thick karma
#

And I know dhert wants to know too lol his method is a headache

tame mulch
thick karma
#

No problem. I am happy to use Blender, the only thing is that I want to be able to import vanilla .x files into Blender for modification

#

And guides on doing that are scarce if they exist

#

I saw some deprecated slash abandoned plugin projects

#

There is already an animation guide for making a new animation from the T-pose in Blender that works very well... I just want my pose to begin and end in identical vanilla positions.

tame mulch
#

I will check. Maybe I will found a way

thick karma
#

If you do, you're the man.

#

I think many people would be happy to do their animations in Blender over Frag if we had a working strategy for messing with vanilla ones. At the moment, I think most people use Blender for original animations built from the T-pose

raven spoke
#

Hi, im trying to figure out how to remove an [OVERLAY] from a tile (removing a paint from a wall)
found a mod by God's Will (Clean Dirt), it only removes [ATTACHED]

    local inventory = self.character:getInventory()

    for i=0,square:getObjects():size()-1 do
        local object = square:getObjects():get(i);
        
        if object then
            if object:getTextureName() and luautils.stringStarts(object:getTextureName(), "overlay_graffiti") or
            luautils.stringStarts(object:getTextureName(), "constructedobjects_signs") then
                --return inventory:contains("Bleach") and (inventory:contains("BathTowel") or inventory:contains("DishCloth") or inventory:contains("Broom") or inventory:contains("Mop"));
                return (inventory:contains("BathTowel") or inventory:contains("DishCloth") or inventory:contains("Broom") or inventory:contains("Mop"));
            else
                local attached = object:getAttachedAnimSprite()
                if attached then
                    for n=1,attached:size() do
                        local sprite = attached:get(n-1)
                        if sprite and sprite:getParentSprite() and sprite:getParentSprite():getName() and 
                            (luautils.stringStarts(sprite:getParentSprite():getName(), "overlay_grime") or 
                            luautils.stringStarts(sprite:getParentSprite():getName(), "overlay_graffiti") or
                            luautils.stringStarts(sprite:getParentSprite():getName(), "constructedobjects_signs")) then
                            --return inventory:contains("Bleach") and (inventory:contains("BathTowel") or inventory:contains("DishCloth") or inventory:contains("Broom") or inventory:contains("Mop"));
                            return (inventory:contains("BathTowel") or inventory:contains("DishCloth") or inventory:contains("Broom") or inventory:contains("Mop"));
                        end
                    end
                end
            end
        end
    end
    
    return false
end```
nova socket
#

I'm a bit confused about how SandboxVars are stored? I changed one of the SandboxVar directly but Lua scripts still grabbing the old value? Thought about the different scope issue in runtime... Quit.. coming back... And... Sandbox var is changed permanently, but Lua scripts still assign old value to my local variables?

tame mulch
#

If I will can understand assimp lib :/

fast galleon
drifting ore
#

hi.just a goofy ah idea.when your charecter is dropping it play dream on.yk like jumping from a high floor like 2 floor? yk.sorry if im not saying it in aright place

nova socket
fast galleon
#

I mean specifics could help, is it your code / is it vanilla code / is it actually a lua file or is it something in the scripts folder. Are you saving the value locally and then changing the global value (that would not work, you'd need to manually update the local)?

#

90% of issues are simple mistakes

nova socket
#

I'm probably missing something obvious

#

blames rubber duck for not helping out

#

HOWEVER... doing this just makes everything fine again.

function OnInitGlobalModData(isNewGame)
...
    IC.ResetTime = SandboxVars.ICurrency.ResetTime;
    print("ICurrency: Setting ResetTime = " .. IC.ResetTime);
...
end

Events.OnInitGlobalModData.Add(OnInitGlobalModData)
#

So it seems that Sandbox vars current data is read after the lua, not before and I guess its falling back to default values.

#

Default value is indeed 168 in my case.

#

Thanks for being my rubber duck @fast galleon

fast galleon
#

I use both ways.

thick karma
#

lol I tried to use Fragmo to change the props from being connected to the pelvis to being connected to my hands:

#

It... didn't work.

#

lol the animation stayed this way after I ran it btw

#

I'm walking around like this

tardy wren
#

Ah, crap...

tardy wren
#

I changed the compost bags to have a lower useDelta, but when gathering compost into them, it still only fills it up to 4

thick karma
#

lol oof

tardy wren
#

Maybe I need to override the compost bag instead of changing them via doParam

nova socket
#

Talking about overriding

#

I've done changes to existing item in Base everything is just fine but Category doesn't seem to override at all

#

Anyone got the solution?

#

Well.. besides "just make your own" πŸ˜„

ancient grail
nova socket
#

ye ye that one

fast galleon
tardy wren
#
function ISGetCompost:perform()
    local amount = self.compost:getCompost()
    local uses = math.floor(amount / COMPOST_PER_USE)
    if self.item:getType() == "CompostBag" then
        uses = math.min(uses, USES_PER_BAG - self.item:getDrainableUsesInt())
        self.item:setUsedDelta(self.item:getUsedDelta() + self.item:getUseDelta() * uses)
    else
        self.character:removeFromHands(self.item);
        self.character:getInventory():Remove(self.item);
        local compostBag = self.character:getInventory():AddItem("Base.CompostBag");
        uses = math.min(uses, USES_PER_BAG)
        compostBag:setUsedDelta(compostBag:getUseDelta() * uses);
        self.character:setPrimaryHandItem(compostBag);
    end
    self.compost:setCompost(self.compost:getCompost() - uses * COMPOST_PER_USE);
    self.compost:updateSprite();
    if isClient() then
        self.compost:syncCompost();
    end
    -- needed to remove from queue / start next.
    ISBaseTimedAction.perform(self);
end
#

But, uh... Do item overrides get loaded before lua files?

ancient grail
fast galleon
#

and scripts even earlier

tardy wren
#

oh okay

ancient grail
#

@fast galleon has the solution for this i believe

tardy wren
#

so I think I just need to override the compost bag to make this work then

#

yeah, it was that simple

tardy wren
#

Overriding the compost bag worked tho so

#

The tooltip is really not rounding correctly but whatever

fast galleon
#

What do you expect to achieve with this? Will the bag hold more compost or just add less compost when used?

#

I use this for bucket compost and couldn't think what the expected behaviour would be in this scenario. So I just set it to 4 too, no item checks.
@tardy wren

tardy wren
#

And while I can't set it to neatly have 12 uses, giving the compost bag a lower useDelta with an override does work fine, at least in SP

#

Setting them via doParam was odd. While the bags did indeed have more uses, filling them only yielded 4 uses maximum after all, consuming a full 10% off the composter

ancient grail
fast galleon
thick karma
#

Wow moving these props around manually when they are connected to my pelvis is absolutely infuriating....

#

Can anyone make this make sense?

#

Why the pelvis?

#

I feel like if it made any sense it wouldn't bother me so much... but I just don't understand why the hand items are bound to your pelvis and it never bothered anyone else who was making the animations...

jaunty marten
sour island
red iron
thick karma
#

Lmfao

jaunty marten
#

meme status

thick karma
#

You don't make the head the child of the pelvis.

thick karma
#

You make the head the child of the neck

#

The neck is the child of the torso

#

The torso is the child of the pelvis, perhaps

#

The fingers are the child of the hand, which comes from forearm, which comes from upper arm, etc back into the torso

#

So it's not like EVERYTHING is the direct descendent of the pelvis

#

My question is WHY would the thing in your hands be the DIRECT descendent of your pelvis

#

I don't mean to ask "why are bones connected"

jaunty marten
thick karma
#

I get that everything is ultimately connected.

#

But why would the pelvis be the immediate parent of a held object?

jaunty marten
#

what r u trying to do?

thick karma
#

lol probably nothing anyone can help me do

#

I am making a custom animation

#

An attack animation

jaunty marten
#

new one? for what

thick karma
#

I am making a lefthand attack animation specifically atm.

#

For dual wielding

jaunty marten
#

ah, u working on duel wielding

#

yea yea

thick karma
#

I'm just trying to seek understanding

jaunty marten
#

u creating from scratch? or u trying to mirror original animation

thick karma
#

As it stands the decision to make the prop the direct descendent of the pelvis baffles me

#

I would expect it to make EVERY weapon animation obviously harder, and would expect their pro animators to notice that... So there must be A) an easy way they use to connect props to their hands when doing attack animations, or B) a REALLY great reason to make it so hard to make props track your hands.

thick karma
#

The mirrors are so borked I see no advantage in working from a mirror

#

No one has told me yet how to do it correctly

#

Only vague things like "use Blender"

#

lmao

#

Except the people suggesting that do not know how

#

I'm like, "Okay, sure, I'll use Blender, how do I import a .x file into Blender, mod it, and export it for use in the game?"

#

crickets

#

Dhert has given me the clearest instructions for functionally flipping a vanilla animation but his technique results in a lot of bork

#

That needs to be manually fixed anyway

#

Because it's an imperfect mirror.

#

(highly imperfect)

#

It makes body parts go approximately where they might be needed but not exactly.

#

I can make a perfect mirror in Fragmotion, but upon exporting it, it will not look right.

#

No one has told me how to fix that, so I am making lefthand animations from scratch instead.

jaunty marten
thick karma
#

yes

jaunty marten
#

ah, there's not .x but .fbx

thick karma
#

That is for using Blender to create a .fbx from a .blend template.

#

Not a .x from a .x

jaunty marten
#

yea yea

thick karma
#

So it's not useful for modding the vanilla animations I'm concerned with

#

It's fantastic for original animations though.

jaunty marten
#

never tried to create animation but what's different between .x and .fbx for pz? as I get it they both for that, right?

golden sparrow
thick karma
#

@golden sparrow He cleans it up manually.

#

I'm talking about how it looks immediately after the mirror.

golden sparrow
#

Oh okk

thick karma
#

He has to go through 4800 frames of the flipped animation and correct a bunch of poo

golden sparrow
#

I'm in the no idea what i'm talking about group lol, never touched anim

thick karma
#

I mean dhert's way is fine. But it doesn't change the problem of having to move both props* (left and right hand) manually throughout the animation because it's naturally bound to your crotch instead of your hand.

#

Also you end up having to readjust all kinds of stuff if you're doing a full-body mirror (e.g. if you're trying to mirror the ground attack, during which character kneels.)

#

The dhert-mirror for the ground attack literally rotates your body 90 degrees toward the ground, borks your legs, and sticks your shin and feet and arms through the ground, e.g.

#

(meaning the mirror made using his technique before cleaning it up)

#

He is aware of this and currently releasing his animation with vanilla ground attack until he does his own custom ground attack because of how nontrivial that animation is to mirror.

red tiger
#

Good morning.

nova socket
#

Can somebody give me a tip about actions
ISTimedActionQueue:add(ICDefaultAction:new(getPlayer(), getPlayer(), 180))
Throws

[04-02-23 17:35:00.546] LOG  : General     , 1675524900546> Object tried to call nil in addToQueue.

Considering that ICDefaultAction:new() does construct properly and returns table

What exactly is action in

addToQueue: ((action: any) => any) | any;
static add: (action: any) => any;

then?

red tiger
#

You figured out that my Lua transpiler for type defs is incomplete for PipeWrench.

#

I'm actually not sure. Someone in here will tell you.

nova socket
#

Yeah, its ok about that.

red tiger
#

I think ISTimedAction is an object that you pass in.

#

Not 100% sure since I've not needed to work with it.

nova socket
#

I followed a few examples but it seems

require "TimedActions/ISBaseTimedAction"
ICDefaultAction = ISBaseTimedAction:derive("ICDefaultAction");

Is not sufficient to make it being an action with new() in it.

#

Object tried to call nil in addToQueue why nil I wonder if argument is supplied

red tiger
#

Possibly looking for a property in a param that it didn't expect?

nova socket
#

Its a wild guess at this point, considering static add(action: any) has only one argument

red tiger
#

Wait..

#

Are you extending the class?

#

Because PipeWrench has issues extending TIS classes in Lua.

#

It's a thing I need to look at.

#

You can wrap classes though.

fast galleon
tardy wren
#

Just executing it while the file loads would be fine as well, though, since I don't need any sandbox vars

polar thicket
#

Ok progress on our generator mod modding. Right now we are just trying to make our item be a seperate generator from the ingame one. We have looked at how other generator mods does thing to get an idea how we should derive and setup ours (from scratch at that. Dont worry)

We are at a point where we get no errors on startup. You can craft the generator and the translate Luas with context info all works. Which means part of the lua codes work as intended. But as soon as the generator is crafted. the code to forcedrop it on the ground upon creation does nothing

#

also if you right click it in inventory it says "take generator" which does nothing ofc

#

but as soon as we drop it on the ground a big repeating error occours until we skip it and a normal generator is dropped

neon bronze
#

sounds like something is borked with the world model

#

since you can craft it and it does come up as an item

polar thicket
neon bronze
#

can you add it to your inventory through the items list?

golden sparrow
#

What is this lol

polar thicket
golden sparrow
#

Decompiler giving some strange result

polar thicket
#

the tile naming is right

neon bronze
#

did you define it as a moveable?

polar thicket
#

gonna double check but im sure I did

#

I referenced the normal ingame generator

#

gonna double check if the tile defs are right

#

if that is the problem then well heh

neon bronze
#

yea its defined as an item, i though it was a moveable of how it works in game

#

but its an item

red tiger
#

You can make a Lua interface and extend it there if you need to.

#

Wrapping is what's being used for some stuff right now when using PipeWrench. I'll need to see what I can do to fix TSTL's class stuff to work with TIS's class.

polar thicket
#

Although this is the tiledefs included with the modding tools through steam

#

that is because the generator has the "take generator" command

pulsar heath
#

@red tiger i still think youre nuts ( due the ammount of work you did ) but damn... well done... awesome job on the project

quasi geode
# golden sparrow What is this lol

BodyPart.class?

int baseChance = 40000;
if (!bandaged())
{
    baseChance -= 10000;
} else if (getBandageLife() == 0f)
{
    baseChance -= 35000;
}
golden sparrow
red tiger
# golden sparrow What is this lol

So it's a char being interpreted as a short value when it's a constant value. This is an artifact of fernflower. Use JAD when this shows up as it can give you the right value. What you can also do is this:

char foo = '#';
int bar = (int) fooo;
#

JAD shows these as proper values.

#

Also, JAD can decompile functions that fernflower fails to.

#

It's by no means a better decompiler than fernflower however it can cover for these issues.

neon bronze
#

do you have a custom model for it?

red tiger
#

Part of the planned transpiler 2.0 for Lua code is resolving types.

neon bronze
#

cause i suspect it has something to do with the model

nova socket
golden sparrow
nova socket
#

In fact I'm not compiling it in TS right now.

red tiger
nova socket
#

I use PipeWrench as a big-ass manual to read through before going scrolling game lua folders for any references

polar thicket
red tiger
polar thicket
nova socket
#

I was aware some issues might happen when I seen that lua has a lot of any as argument types.

neon bronze
#

do you not define it in a .txt?

polar thicket
# polar thicket

This is part of the LUA in the map objects in server side of code

polar thicket
#

as said the item works

#

I can even craft it

fast galleon
#

hm, do you prefer generator pickup / drop or moveable place / pickup ???

nova socket
polar thicket
polar thicket
#

we can even rightclick it in the item list and it will says "take generator" as an option

#

BUT it is not forcefully dropped when we craft it. Something the client side of the code does have a function for

nova socket
neon bronze
# polar thicket

well you do not have a worldstaticmodel or a worldsprite defined for generator so maybe thats a problem?

polar thicket
#

the vanilla one doesnt

#

neither the steamgen mod

red tiger
polar thicket
#

and no generator lua code we find in any of the vanilla files point to a world model

#

neither the vanilla item code

nova socket
polar thicket
nova socket
#

If you want to make gens being pickable I can give you a code

polar thicket
#

without it becoming the vanilla generator

polar thicket
nova socket
#

But gen probably have to derive from IsoMovable*

fast galleon
polar thicket
#

we looked at how steamgen mod derived things to get a basic understanding

nova socket
#

Basically sprite properties just have to have "IsMoveAble"

polar thicket
#

and our tiles works fine when we edit the steamgen code to use them so tiledefs are not the issue. They are setup like the vanilla generator tiledef

#

Ok let me rephrase our current issue

#
  1. when we craft the item. It does not autodrop on the ground. It stays in inventory. Similarily to the steamgen mod we have the needed code there in the right place in the folder structure.
#
  1. when we manually drop it we get the error screen I posted above
#

and it becomes a normal generator

fast galleon
#

start a thread pls

#

this seems like a long issue

polar thicket
#

Ok I will start a thread here

golden sparrow
#

@polar thicket Why don't you make it a building object if you want it to be constructed on the ground directly ?

#

I mean an object that can be built thought Build Menu accessed using right click

polar thicket
#

And it is not what the steamgen mod does. In that mod it is crafted into a generator object that behaves similarily to the vanilla generator in code. And is forcedropped as it is not intended to be in player inventory with a lua

stuck wigeon
#

Hey guys, complete newbie to modding in PZ (Never really messed with Lua before so I'm already way over my head), I was wondering exactly how easy/hard it is to go about doing UI stuff? I don't want to do anything stupidly complex; just hide the Scratch/Bite defence lines/values in clothing (Probably leaving the protection tab in health untouched just for simplicity's sake)

crisp wren
#

is there any framework/example of how devices like TVs are established? havent seen anything in the folders

steady onyx
#

Quick question. Can you change the world model of an item like a bag depending on if it has any items inside it? I'm trying to get something like the shelf tiles, which populate with random junk when you put stuff on them

nova socket
#

Timed actions template
For case if somebody was wondering, with explanations

require ("TimedActions/ISBaseTimedAction");
ICDefaultAction = ISBaseTimedAction:derive("ICDefaultAction");

function ICDefaultAction:isValid()
    return true -- Mandatory bool, or false otherwise and action will not be performed
end

function ICDefaultAction:update()
    -- Optional, called on every frame of execution
end

function ICDefaultAction:start()
    -- Optional, called once on start of action, if action validity check is passed
end

function ICDefaultAction:stop()
    -- Mandatory, called once action is interrupted
    ISBaseTimedAction.stop(self) -- Mandatory, performs core functions
end

function ICDefaultAction:perform()
    -- Mandatory, called once action is complete
    ISBaseTimedAction.perform(self) -- Mandatory, performs core functions
end

function ISBaseTimedAction:new(character, target, time)
    -- Mandatory for ISTimedActionQueue
    local o = {}
    setmetatable(o, self)
    self.__index = self
    o.character = character;
    o.maxTime = time; -- Can be -1 making action indefinite until set to completed conditionally

    -- Optional 
    o.caloriesModifier = 1;
    o.stopOnWalk = false;
    o.stopOnRun = false;
    o.stopOnAim = true;

    -- Custom (any arguments)
    o.target = target;    

    return o
end

-- Runtime example
ISTimedActionQueue.add(ICDefaultAction:new(getPlayer(), getPlayer(), 100))
stuck wigeon
# ancient grail Visually?

Yeah, don't want to actually remove the stats themselves, just hide the UI part so I can't see how much protection they give when looking at them

ancient grail
#

Yeh heres a reference from new age profession
It replaces the context menu smoke
And drink alcohol

stuck wigeon
#

Isn't the context menu when you're right clicking on it though? Cause you'd only see the stats of clothes when you're actively hovering over it, if it's the same thing then my bad, just curious :)

nova socket
#

@red tiger figured the shit out ^

red tiger
ancient grail
#

Really? How are they doing that?

formal hamlet
undone elbow
#

How to move (using code) by feet not to the center of a tile?

ancient grail
#

setX(getX()+0.5)

#

just a theory idk the syntax

undone elbow
#

It's teleport, not moving by feet...

#

For example, if I need to automatically go to the corner of a tile:

quasi kernel
#

I think getting back on track with modding is gonna be the hardest part

#

For me to actually do

sour island
nova socket
#

Question: ProceduralDistributions has real effect only on server-side so I can escape it on client?

sour island
#

Could cause checksum issues

nova socket
#

I mean if not isServer() then return end

fast galleon
sour island
#

ScreenToIsoX and Y, would be what you most likely need @undone elbow

#

This would only work if walkTo supports floating X/Y

fast galleon
#

pathfinding behaviour has a function for float, it also has walk to direction of an object

simpler solution: just get another square for the timed action. You can also get a square with floats, this would still call the function with int arguments

nova socket
#

I dared to visit #general_chat and its different world there in the same Discord

real sierra
#

Question about sendServerCommand() and sendClientCommand(): are they reliable and do they preserve order?
as in, if a packet gets lost, does the packet get re-sent so that the message eventually gets delivered? (assuming the connection doesn't drop)
and, do the messages arrive at the other end in the same order as they were sent?

nova socket
real sierra
#

Yeah, I need to know if PZ's networking layer is replaying messages.

nova socket
#

That you can only get from devs themselves

real sierra
#

yes

#

(it's pretty common for games to use UDP and have an implementation of TCP-like retransmissions on top of UDP for some, but not all, messages. like in a game like CSGO, you might send the message "Bob killed Larry with the mp5" reliably because that doesn't happen very often, but "Bob is currently at position x,y,z" unreliably because that information will soon become stale anyway)

nova socket
#

... And most of the games that has that sort of relays usually not serving all the information, but only chosen by devs. So if you are looking for any sort of anti-dupe you gotta improvise

real sierra
#

PZ is using an open source middleware called Raknet which has reliable delivery as a feature but IDK whether it's enabled for sendServerCommand/sendClientCommand specifically

nova socket
#

Yep you pretty much just repeating my words in own way KEK

real sierra
#

Okay, poking through it, it looks like sendClientCommand ends up being sent to RakNet asking for "RELIABLE" but not "RELIABLE_ORDERED" delivery.

#

same for sendServerCommand, they both use the ClientCommand packet type.

winter thunder
#

How bad is it to have a lot of non-local functions?

#

Due to the way I am hooking onto events and things, I cannot use local functions for a lot of the things I am doing :( but I don’t wanna bog things down to a crazy degree either

sour island
#

Why can't you make them local exactly?

#

Like if you have an example - for the most part you can Add() local functions fine, and or module the rest. The only exception would be maybe recipe functions - which unfortunately need to be global afaik.

winter thunder
# sour island Like if you have an example - for the most part you can Add() local functions fi...

I have been having difficulties with it. I have my primary functions tied to the OnEat trigger on β€˜food’ items, and then the other functions are added to their respective event hooks with the Events.xyz.Add(Example)

If the latter can be local, that would save most of the hassle. (Like, 90+% of my concern would disappear lol)
I may have been missed something else that was tripping that up instead

strange sequoia
#

Hey hey, i'm having a problem with my mod i'm completely lost on what to do. I made a new crop with seed and seed packet but for some reason, the seed packet only appear when you are in debug mode. The whole thing works perfectly in debug mode, the seed packets spawn and can be opened to get seeds that can be planted and harvested. But for some reason that is beyond me the seed packets refuse to appear unless you set yourself in debug mode. Anyone know what could be causing this ??

sour island
#

But If I recall you remove functions don't you?

strange sequoia
#

Nope they just don't appear, no error :c

sour island
#

How do they appear in debug mode?

#

as loot?

strange sequoia
#

They appear in containers and such yes. I set them to appear in shops for example

sour island
#

do you have a 'if getDebug()' anywhere?

strange sequoia
#

Hm idk, i'm gonna look through the files

#

Looked at the LUA files and scripts and no i don't see it anywhere

sour island
#

And when you say debug mode you mean -debug?

strange sequoia
#

Yep

winter thunder
# sour island But If I recall you remove functions don't you?

Yes. It is inside that same function, so i don’t think it would be an issue?

Function A triggers OnEat, and does the Events.xyz.Add(Function B).

Function B repeats until a counter variable == 0, then removes itself with Events.xyz.Remove(Function B)

sour island
#

If there's a reference to the function it should be fine

strange sequoia
#

Only weird thing in an LUA file i found is this line, but i don't know what it refers to

if getCore():getVersionNumber() == "41.50 - IWBUMS" then Events.OnFillWorldObjectContextMenu.Add(FlaxMenu.doFlaxMenu);"

winter thunder
#

Ok, cool. Also, @strange sequoia

Are you certain you have the mod enabled on your non-debug version? I have made that mistake before… I would also make sure nothing else is enabled

strange sequoia
#

Yes i have. I did some test with someone on a server. Them in Debug mode and me in normal mode. They could spawn, use and see the seed packets but i couldn't.

#

If they dropped the packets they could see them but i couldn't

winter thunder
#

just so I understand as well. You are finding the seeds naturally spawning in debug mode, but not in a non-debug save?

strange sequoia
#

If i start a save in debug mode, find seed packets that spawned naturally in a shop and come back on the same save without the debug mode, the seed packets disappear

winter thunder
sour island
#

do you have checksum disabled?

strange sequoia
red tiger
#

Been working all morning / day on my transpiler for Lua to TypeScript.

local message = 'Hello, World!';
print(message);
/* FILE: ./assets/media/lua/test/hello_world.lua */

let message: string = 'Hello, World!';
print(message);

Baby-steps...

nova socket
# winter thunder Due to the way I am hooking onto events and things, I cannot use local functions...

I preserve non-local functions only for things that can go for sorts of internal API used anywhere, example:

function createObject(x, y, z, sprite, name, persistent)
    if not name then name = "None" end 
    local sq = getCell():getGridSquare(x, y, z);
    if not sq then return end
    local object = IsoObject.new(sq, sprite, name);
    if not object then return end
    object:setOutlineOnMouseover(true)
    sq:AddTileObject(object);

    if persistent then
      if isServer() then object:transmitCompleteItemToClients() end
      if isClient() then object:transmitCompleteItemToServer() end
      if getWorld():getGameMode() ~= "Multiplayer" then end
    end

    return object
end
#

or

function find(arr, val)
     for index, value in ipairs(arr) do
          if value == val then
                return index
          end
     end

     return -1
end
#

I use that almost in every function, why bother declaring it locally

bronze yoke
#

because local is faster

nova socket
#

faster by what, 0.01ms?

bronze yoke
#

and names like 'find' and 'createObject' are really prone to being overwritten by another modder with the same thought process as you

nova socket
#

Well just use interface then

winter thunder
#

@nova socket do you mean, as an example, if you made a function like this that you planned on using everywhere, you would just make it global?


local x = var1 * var2 

return x
end```
#

(I know how terrible it would be to actually use that function, it is just an example lol)

nova socket
winter thunder
sour island
#

Honestly performance is a secondary reason for using modules (if that's what you mean by interface) - just not dealing with naming issues is worth it

#
  • if you're using something across alot of files you'll have to probably use require at some point anyway to ensure its loaded first
winter thunder
#

Oh true. That is a good point, helps maintain load order too. That can be a real pain in the ass from everything I’ve seen/heard lol

sour island
#

Short of UI, recipes/script functions I don't think you have to make anything global

nova socket
red tiger
#

mmmmmm interfaces.

nova socket
#

Well yeah in Lua its just a table of things

red tiger
#

(Shuts up immediately to avoid the inevitable topic)

nova socket
#

KEK @red tiger

sour island
#

Oh I thought you meant using local returned tables of stuff

nova socket
#

You know where this is coming from right Jab

nova socket
red tiger
#

Am literally writing a Lua -> TS transpiler right now.

nova socket
#

unfortunately nothing besides just storage in this case

#

module, I suppose in Lua is something like class.

#

"mmmm classes"

red tiger
#

I've got to build compiler options too like force explicit types, inferred types for single-type variables with type-discovery in-place, etc.

#

Fun fun.

sour island
#
---"my_math.lua"
local mymath =  {}
function mymath.add(a,b) print(a+b) end
function mymath.sub(a,b) print(a-b) end
function mymath.mul(a,b) print(a*b)end
function mymath.div(a,b) print(a/b) end
return mymath    
``` ```lua
local mymathmodule = require("my_math")
mymathmodule.add(10,20)
mymathmodule.sub(30,20)
mymathmodule.mul(10,20)
mymathmodule.div(30,20)
nova socket
#

In TS you can literally interface a type btw with strict types

red tiger
#

Type joins.

#

Please do go on.

nova socket
red tiger
#

It'll be fun once full Lua files from PZ get properly translated to TS.

sour island
#

Someone mentioned if you pass an isoObject reference using commands that it will know which object it is on the other side?

golden sparrow
sour island
#

I figured it out eventually

golden sparrow
#

But I had the same problem and resolved it by using Kill comand

sour island
#

becomeCorpse wasn't firing cause shouldDoInventory wasn't valid - because they had no attacker

golden sparrow
#

Yeah

sour island
#
        if targetHostile:getHealth() <= 0 then
            targetHostile:changeState(ZombieOnGroundState.instance())
            targetHostile:setAttackedBy(getCell():getFakeZombieForHit())
            targetHostile:becomeCorpse()
        end
golden sparrow
#

Putting FakeZombieForHit solved it

sour island
#

yep

#

Noticed it's used in other calls

#

Kind of weird it's not called internally imo

#

but there's probably a good reason

atomic thunder
#

is there a way to get a single broadcast to play across all channels kinda Emergency alert style on the tv

bronze yoke
sour island
#

ah that's still useful to me

#

my flare code works on a dedicated machine, buyt not self hosted

#

trying to figure out what's going on - may just refactor it to use commands instead

bronze yoke
#

oh that's pretty odd

sour island
#

yeah

#

the code is in shared due to housing some recipe stuff

#

could be related

#

oh I think I see why lol

#

I added a client check for onTick

#

if recipes are called clientside why is it in shared?

#

just to checksum it from the server?

icy jackal
#

hi! sorry for bothering and I hope im using the correct channel
Does anybody know how can I make the weapon grip "lower"? I want the character to have the hands in that grip where the arrow is pointing.

sour island
#

You may have to change the model - if i'm not mistaken you can't really offset weapons in-hand

#

Unless I misunderstood that convo the other day @faint jewel ?

red tiger
#

A giant hunk of steel.

nova socket
#

Anyone knows any pathfinder to make character move close to square even if its occupied with something? Normal ISWalkToTimedAction stop immediately without trying to reach occupied square.

nova socket
faint jewel
#

edit moce > select all> move down

red tiger
#

Hi

pulsar heath
#

low

red tiger
#

Drunk coding

#

It's a thing

weak sierra
pulsar heath
#

hs playing... thats the only thing that gets easier wasted

weak sierra
#

and re-exporting it

#

e.g., relation to 0,0,0 in the modeller or its export settings

#

at least u can in wings3d, idk bout blender

red tiger
#

Oh mg

#

wings 3d

weak sierra
#

xD

red tiger
#

You have any idea how old that makes me feel????

pulsar heath
#

you feel old?

weak sierra
#

idk im probably a similar age

pulsar heath
#

....

weak sierra
#

if not older

#

i used it when it was newish too

#

lmao

faint jewel
#

rhinoceros.

pulsar heath
#

1st time i tried 3d crap it was with 3D Studio

#

and i was a kid...

#

1992 i think

weak sierra
#

first try for me was 3dsmax or gmax in like 98? 99?

#

you're a bit older than me, i was 2 in 1992, heh.

#

the first successful try was wings3d in like 2002-3, but people told me my models were too high poly

#

they were converting them from one format to another though, it was their own damn fault

#

i didn't know any better back then tho heh

#

i was trying to do stuff for.. let's see if their site still exists..

#

Crystal Space is an unmaintained framework for developing 3D applications written in C++ by Jorrit Tyberghein and others. The first public release was on August 26, 1997. It is typically used as a game engine but the framework is more general and can be used for any kind of 3D visualization. It is very portable and runs on Microsoft Windows, L...

#

it does but it's bork, for this

pulsar heath
weak sierra
#

i've done some 3d modelling in wings for PZ, picked it back up for that

#

im pretty good at it but wings doesn't do animation so im a bit limited lol

#

im a bit jack-of-all-trades (code, 2d art, 3d art) but code is my specialty

pulsar heath
#

yeah... im also a master of none, user of many

#

my specialty is actually non related with any of what we do here... music producing and composing...

weak sierra
#

i've dabbled in that too but not much

#

what kind of music?

red tiger
#

Jesus

#

WIngs3D tho

weak sierra
#

:)

pulsar heath
#

but atm im a "mercenary" who produces and remixes what the main public wants...

#

easier than doing something original and pays for the bills

pulsar heath
# weak sierra

whenever i see something like that i always think of windows 3.1 and early linux distros πŸ˜„

#

that GUI is so nostalgic...

weak sierra
#

this is a CDE theme on linux

#

heh

#

i love win3x/early linux

#

i had win95 theme before this

#

but with mac os 9 font

#

anyway we're like way off topic, i dont wanna clog channel

#

xD

pulsar heath
#

πŸ˜„

#

everyone is sleeping ...

#

how to you add animations to your models then? You make them in wings3d and import them to some other software?

red tiger
#

Not i

#

Although I am absolutely sloshed.

pulsar heath
#

i was yesterday... had to work for 3h

#

today im only cleaning up the code in the mod

red tiger
#

The best coding sessions are when you are completely sloshed.

pulsar heath
#

so boring stuff...

#

and i need to think about a standard for my pseudo json string the mod and the app use to communicate

#

dont want to make to much nested stuff

#

but ill have to do it... or it will be a humungous string with a lot of nill values

#

or a lot of checks in the mod side...

#

or i can just stop being an idiot and use a json lib for lua and use json period

#

anyone knows of a good json lib for lua?

weak sierra
#

so far i've just done guns and statics

#

guns/other items are all animated by the character and existing animations

#

though new animations would be nice for the guns.

weak sierra
pulsar heath
#

if it works fine its good πŸ˜„

#

which one are you using?

weak sierra
#

this one :p

pulsar heath
#

thank you

#

using this will actually save me a few lines of code... since i was "deserializing" a pseudo json string with gsub and stuff like that

#

@weak sierra thanks, it works pretty well, so now to update the code to use this lib

weak sierra
#

np :)

weak sierra
#

what does it do exactly

#

lol

#

draw grid and letter/numbers on axes?

#

i've been meaning to enable cell grid for players for ages, if it does that then bonus points heh

icy jackal
sour island
weak sierra
#

nice

sour island
#

I was going to look into a label system, but doesn't seem like it'd be isometric

weak sierra
#

toggleable?

sour island
#

No

weak sierra
#

damn

sour island
#

Why would you not want the ID?

#

If you're enabling the grid - seems like the ID would be beneficial

weak sierra
#

i take map screenshots where i'd want the grid off

sour island
#

hmm

weak sierra
#

and some players might prefer it off just because players can be weird.

#

u dont have to change it on my account xD

sour island
#

I don't think it'd be that hard to work something out

warm flame
#

thats fantastic

weak sierra
#

anyone confirm that SandboxOptions.SandboxOption.asConfigOption is nil?

quaint fiber
#

Ohhh, it seems like you can open .X files using Noesis

quaint fiber
#

hmm im not sure either

cosmic condor
#

no worry. I use another tool spiffo

quaint fiber
#

thank you

cosmic condor
frozen leaf
#

Hi guys, i m newbie to PZ. I wish to enlarge the capacity of personnal inventory. Any recommended mod may make it happen? Thanks.

ancient grail
#

anyone know how to make a recipe script using lua ?

void fractal
void fractal
#

fr

nova socket
#

eh time to figure out how in the world you draw on map with script using square xyz

ancient grail
rancid panther
#

my local mod.is working fine but for some reason the workshop folder version is borked.

#

it was working before i updated the mod and i have updated it before

#

i think i figured it out

#

im just dumb

manic parcel
#

Does anyone know where throttlekittys template is? cant seem to find it anywhere

rancid panther
#

how can i make someone start with an infected bite at the start of the game? or is there a mod that already does this?

slender socket
#

Hey guys, how would I go about making a mod? I want to make a repair recipe for an item that doesn't have one.

rancid panther
#

i recommend looking at other mods that do the same thing.

red tiger
#

Good morning.

thick karma
#

Maybe player:getBodyDamage():getBodyParts():get(3):SetBitten(true, true) would work.

#

3 is arbitrary, you have like 15+ body parts, but they say it's lucky so wtf

ancient grail
#

Weird its SetBitten ? Not camel case? stressed

red tiger
#

Wishing everything was cased consistently. =(

ancient grail
#

You can also setInfectedLevel

#

Or something like that

ancient grail
red tiger
#

I used snake_case in my early Lua days..

ancient grail
#

Too late for that now. Its gona break lots of mod if they do this now

ancient grail
red tiger
#

Oh, I've advocated for breaking legacy support for years.

#

Mods break during major updates anyway so with b42 coming in, this would be a perfect time to push all current mods to 41 support and break them all for 42.

ancient grail
#

Onlything ugly abt camel case if you have initials
TISVar
varTIS

red tiger
#

Nope. The rule is tisVar

#

and varTis if you want to be true to the format.

#

like getId()

ancient grail
#

But like i said initials

red tiger
#

Yeah you'd lowercase it.

nova socket
red tiger
nova socket
red tiger
#

Couldn't I alias that stuff?

#

Yeah I could..

nova socket
#

I think there is even tools for TS to convert stuff to specific formats

red tiger
#

Me over here, working on the new Lua transpiler and this modder over here telling me to fix my Java one. xD

nova socket
#

Haven't used one honestly.

red tiger
#

It might be doable. All TS code interfaces with a dictionary so yeah.

nova socket
#

Yeah, you can probably extend existing interfaces.

#

Not sure how painful that might be to sort, PZ is not that small

red tiger
#

That dictionary eliminates the issue of mod-loading order.

#

Formatting the interface calls would be needless work that would complicate things.

#

Apart from it being nicely and consistently formatted, It could break in certain situations.

golden sparrow
#

Anyone know if admin account as a player on a server ?

#

Like if I use getOnlinePlayers() will it contains the admin

red tiger
#

The admin account is like any other player when logged on.

red tiger
#

Always fun brushing up my complete understanding of a language.

#

(Lua 5.1)

thick karma
#

Got a recommendation on my Discord to replace:
player:playSound("Rifting")
with
getSoundManager():PlayWorldSound("Rifting", player:getCurrentSquare(), 1.0, 20.0, 1.0, true)
for multiplayer-friendly sound.

Can anyone confirm how right this looks?

Seems like "true" => ignoreOutside... anyone know what exactly ignoreOutside controls? Pretty hard to tell from the Java...

neon bronze
#

think it depends on what sound you wann play, there are like worldsounds and sounds only you can hear

quasi geode
red tiger
#

Useful info for modding tutorials / docs.

#

=)

#

Also probably good to put a JavaDoc there (If not already)

quasi geode
#

I actually started adding javadocs to some stuff last weekend. offtime side project πŸ™‚

red tiger
#

Good freaking work.

#

Rooting for you there. This is the most important stuff IMHO. Thanks for that.

#

BTW I eventually plan to bake the existing JavaDocs into PipeWrench.

#

I have an offline copy of the JavaDocs for 41.77 if anyone wants that for offline use.

#

πŸ‘

quasi geode
#

i like detailed documentation πŸ˜…

red tiger
#

Hahahah oh man

quasi geode
red tiger
#

Do you know about my TS / Lua documentation tool?

#

I plan to finish it so players like myself and others here can self-document.

quasi geode
#

only whats been mentioned here

red tiger
#

It was made with the assumption that docs wouldn't be updated in a long, long time.

#

The last time we had official JavaDocs was in 2015 so this coming out last year was a huge surprise.

quasi geode
#

also. i've decided i dont like javadoc lol. used to using luadoc, its much more flexable

red tiger
#

I like TSDoc / JSDoc. More options + markdown support.

quasi geode
#

the lack of markdown in javadoc is what really annoyed me. luadoc has it

quasi geode
#

ah ya saw that

red tiger
#

Also working on a Lua -> TS transpiler that will discover types.

#

So this tool wouldn't be as needed beyond additional human input.