#mod_development

1 messages ยท Page 102 of 1

red tiger
#

=(

fast galleon
#

this again, no.
you need to put if isClient() then return end at top. Server prints go to different file as well and don't appear in console.

sour island
#
LOG  :> TEST:    134    OnTick    getGameSpeed:0    isServer():true  isClient():false
LOG  :> TEST:    518    OnTickEvenPaused    getGameSpeed:0    isServer():true    isClient():false
weak sierra
#

a consequence i hit was just not being able to understand the damn zombie respawn system well enough

#

<_<

#

i had to do it by brute force and make a lot of guesses

red tiger
#

That used to be in ZombiePopulationManager.

weak sierra
#

well it's all a C++ module now

#

so all the java deadends

red tiger
#

Yup.

#

Same problem I had a ways back.

weak sierra
#

i didnt even plan to mod it i just wanted to set the settings and know what to expect

weak sierra
#

xD

red tiger
#

Save me the false hope and trim out the dead code. xD

sour island
#
local counter = {}
local function TEST(ID)
    counter[ID] = (counter[ID] or 0) + 1
    print("TEST:", counter[ID], ID, "getGameSpeed:"..getGameSpeed(), "isServer():"..tostring(isServer()), "isClient():"..tostring(isClient()))
       --sendServerCommand("MODULE_TEST", "COMMAND_TEST", {})
end
Events.OnTickEvenPaused.Add(function() TEST("OnTickEvenPaused") end)
Events.OnTick.Add(function() TEST("OnTick") end)
#

I'm running the code in /server/

#

gamespeed on a localhost (host from main menu) produces 0

golden sparrow
#

Because actually I use getGameSpeed in the server file to multiply damage and it seems to work zombie are damaged so the value is 1

#

Like it seems to work ?

sour island
#

If you're tying it to an event

pulsar heath
#

well ill just change the spawn loc function and settle myself with non moving to xy zombies in mp...

#

dont care anymore

sour island
#

even if it's on /server/ the client runs it too

pulsar heath
#

nothing works of what i've tried...

sour island
#

to clarify terminology

host (host) connection (player)
server-code client-code

#

my "client" as people would call it, is still running code in server

#

alongside my "server"

#

which is why I'm going to instead say my connection is still running server-code alongside my host

#

also depends on the type of event

golden sparrow
#

Soooo ?

pulsar heath
#

now chuck's mod is trolling me... air raid event ๐Ÿ˜„

golden sparrow
#

I'm still confused about what i'm supposed to do lol

pulsar heath
#

just what i needed ahahaha

#

that siren is anoying as hell

golden sparrow
#

Like whats the good way to implement server code ? It is a problem if it runs on everyone PC ?

sour island
#

you can use if isClient() to prevent server-code from running

#

depends on what you're trying to do

#

but if you want it to be on host's side you need to send a command

golden sparrow
#

Basically i'm damaging zombie when they thump on an object

sour island
#

which requires the code to sit in /server/

#

that shouldn't matter tbh

golden sparrow
#

Just running some code checking if a zombie is thumping on a object when a world sound event is triggered

sour island
#

zombie damage should occur clientside anyway

golden sparrow
#

And if it is damage the z

sour island
#

but I'm still struggling to get my zombies to sync and not get auto deleted

#

so I'll let you know if I run into somethin

golden sparrow
#

networking really is a nightmare lol

#

i had no idea

sour island
#

they're being knocked down and taking damage but I can't interact wit hthem and they poof

#

I think it's the overcorrectivness of the MP code

#

and I don't think it's been exposed much

#

alot of cheating going on

#

So to clarify, the host doesn't run client-code at all

#

my guess as to why connections run server-code may be to accommodate SP?

pulsar heath
#

my guess is that the devs enjoy watching us suffer ๐Ÿ˜„

#

trying to make sense of how things work

sour island
#

to make the image clearer

sour island
pulsar heath
#

in a way that makes sense the gametime0 on the server

red tiger
#

Break everything to clean up API? All for it.

#

=)

#

(Save the latest unbroken version in steam branches for the game)

sour island
#

they already do that for people griping about cars being added

#

the only branch that got scrubbed was the one that could have been used to use MP early

#

if I recall correctly

pulsar heath
#

since when no player is in the server ( dedicated ) the time freezes

#

i guess the server leeches the gametime from the connected clients

red tiger
#

There's a packet for MP involving syncing the clock

pulsar heath
#

but the clock is not the gametime per say

sour island
#

my guess would be the host's "connection" is paused :p

red tiger
#

It's to do with the random instance

#

Also game time IIRC.

sour island
#

this is gameSpeed

#
      @LuaMethod(
         name = "getGameSpeed",
         global = true
      )
      public static int getGameSpeed() {
         return UIManager.getSpeedControls() != null ? UIManager.getSpeedControls().getCurrentGameSpeed() : 0;
      }
#

It's the host's UI

#

but not talking about the host's connection but rather the actual machine

red tiger
#

Oh. I'm talking about something else entirely.

sour island
#

~=null : 0

#

that's why

#

host doesn't have a UIManager.getSpeedControls assigned to it

#

what ever the host IS doing, it's akin to a player sitting in the lobby

#

there but not really

pulsar heath
#

ok its done, just remade the random location spawn function work according to the game mode

#

if its sp, makes the zombies spawn further away and move to the player

#

if its mp, spawn closer to the player

sour island
#

that's nicer imo

pulsar heath
#

inside the line of sight

#

so they can be avoided, but still be a threat

sour island
#

not ideal but atleast you get the wanted behavior in SP

pulsar heath
#

yeah... for now not much else i can do without writing a wall of code

#

so sp the further away they can spawn adds or removes 85 to x or y

#

mp i reduced that to 40

#

perhaps 30 would be best...

sour island
#

I wonder what would break if I started just slapping if isClient return end on all my server code lol

pulsar heath
#

only one way to find out ๐Ÿ˜„

#

do it do it do it eheheh

sour island
#

I did add it to the event's i'm tying into

#

not the whole file tho

#

Trying to recall what I saw that made me write up this test

#

pretty sure I got isServer=true in my console.txt or isServer=false in my co-op

pulsar heath
#

40 is to little with max zoom

#

they spawn inside the players LOS

#

50 then

#

๐Ÿ˜„

#

or 45...

#

fine tunning is a pain

sour island
#

you could figure out the direction the player is facing

#

and grab the squares behind them ๐Ÿ˜›

pulsar heath
#

if i didnt use the mod myself i would be all over that idea ๐Ÿ˜„

fast galleon
#

there was a spawn function that picked the square that the player couldn't see as priority?

#

or you could find the nearest bathroom and put them there

pulsar heath
#

ok 55 is the best value

#

just outside the players LOS

fast galleon
#

is that including extended, dragged vision?

pulsar heath
#

wihtout dragged vision max zoom out

fast galleon
#

and max resolution?

pulsar heath
#

1920x1080

lunar robin
#

Is there a function to check whether a player is performing an emote?
I only found some info about this one, but can't figure out how it works:
PlayerEmoteState.isDoingActionThatCanBeCancelled()

pulsar heath
#

i think is the more common res

#

so ill just adjust for that

#

plus the minimun is 25

#

so they can spawn anywhere around the player from 25 to 55

fast galleon
#

hm, can you spawn them above ground? So it's like they fall from helicopter?

pulsar heath
#

im spawning them at z = 0

#

only the x and y are modified

#

dunno if they take fall damage

#

so ill leave it like that for now

fast galleon
#

yeah, makes sense.

pulsar heath
#

so 25 is close enough to scare the player and kill him if he doesnt react asap

#

and the chance is between 25 and 55 so, i think its well rounded

#

it can kill the streamer but only if he is distracted or something

#

that with the chat ganging up on the streamer and sending several zombie spawns in a short period of time

#

id say its 50/50 for the streamers death

#

or around that

#

plus i have to consider the zombie spawn and a jet event at the same time

#

which will for sure pull the zombies in the players direction

#

so that allows for combos via chat and makes things fun for everyone and not frustrating for the player

golden sparrow
zinc nexus
#

any idea why these recipes arent working. lua noob btw

golden sparrow
#

If i understood correctly

sour island
#

I don't understand what you mean, sorry ๐Ÿ˜…

golden sparrow
#

Like any code written in server/ folder run one time on the host + on each client connected to the host if you don't add the if isClient return part on the top

nimble spoke
pulsar heath
#

and the mp bit of the mod is done

fast galleon
pulsar heath
#

everything else can be triggered on the client side so no need to change it

zinc nexus
pulsar heath
#

now time for a beer and to chill a bit... enough coding for the day...

polar thicket
#

Is there more we need for our generator mod?

sour island
#

I'm curious about shared

pulsar heath
#

in theory it would run in both?

golden sparrow
fast galleon
#

@polar thicket
good practice is to to not name your files the same as original or they will overwrite them.
Common suggestion is to add IS(indie stone) in start or make a folder IS and put them inside.

#

obviously change IS to something that fits your mod id.

polar thicket
#

Thanks for that info

#

We have gotten more into the coding part. Filestructure is stil finnicky

#

What is the main difference of client and server folders? Client is stuff that does not need to be communicated directly to every player. right?

#

While server stuff should be the main function of an object that affects everyone?

fast galleon
#

@polar thicket
load order and servers don't load client folder

polar thicket
#

And that means shared is loaded by both client and server?

#

oh wait

fringe ridge
#

Hey everyone, i've been messing around with my mod's code for a while now and i cannot seem to get what i am trying to do to work.
This is the code i use for the wooden log wall (code for the metal fences/gates and such is similar and those all work)

    ISBuildMenu.onLogWall = function(...)
        local M13LogWall = ISWoodenWall.new
        ISWoodenWall.new = function(...)
            local wall = M13LogWall(...)
            wall.isThumpable = false
            return wall
        end
        M13_onLogWall(...)
        ISWoodenWall.new = M13LogWall
    end

What i wanna know is if i can utilize this code to apply it to the Multistage Walls (Frame -> Lvl 1/2/3 wall)
I've tried several names and those all proofed fruitless.

Thanks in advance.

polar thicket
#

Starting to make sense now

polar thicket
#

while if you join a server and join someone else. You wont load server. And the server wont load client?

fast galleon
sour island
#

I wonder if this will be confusing

fringe ridge
#

This value multiplies the "normal" calorie rate ??

#

Maybe that's a bit easier to read

drifting ore
#

sometimes just a simple explainination of higher number = faster is good to know for us dum dums

sour island
#

(0.016)

polar thicket
golden sparrow
#

Anyone have a proper fix to getRadioText no working on MP servers ?

sour island
#

it's 1 * 0.016

#

Unfortunately has to be done this way due to how the vanilla fixes were implemented

#

I wonder if I can obfuscate it to be easier on the player

fringe ridge
#

can't you just leave the value out?

sour island
#
    if player:isRunning() and player:isPlayerMoving() then
        baseRate = 1.0
        thermoModifier = 1
        appliedCaloriesDecrease = caloriesDecrease.Exercise
    elseif player:isSprinting() and player:isPlayerMoving() then
        baseRate = 1.3
        thermoModifier = 1
        appliedCaloriesDecrease = caloriesDecrease.Exercise
    elseif player:isPlayerMoving() then
        baseRate = 0.6
        thermoModifier = 1
        appliedCaloriesDecrease = caloriesDecrease.Exercise
    elseif player:isAsleep() then
        appliedCaloriesDecrease = caloriesDecrease.Sleeping
    else
        appliedCaloriesDecrease = caloriesDecrease.Normal
    end
#

this is a lua translation of how the vanilla files handle it

#

they had rates for each state

#

baseRate is modified based on actions being conducted

#

they modified baseRate

fringe ridge
#

What i mean is: Do People really need to see the base value ? 2.0 = 2x Calorie burn no?

sour island
#

Not with how I currently do it

#

but if I change it to ```lua
baseRate = (SandboxVars.RebalancedCalorieBurning.SprintingMultiplier or 1) * 1.3

#

it will be

fringe ridge
#

Would it be possible that the game's base value get's turned into 1.0 so you can use your values as absolute multipliers?

sour island
#

what my mod does is calculate the vanilla values, calculate my own and add only the difference

#

I'd have to use a hook and replace alot more stuff otherwise

#

I think this should allow me to have 1's as default for the sandbox options

fringe ridge
#

In all honest oppinion: the base value doesn't need to be known imho
Bigger value means more calories get burned, lower values mean less?
Isn't that what is important to the end-user?

drifting ore
#

that's my input

#

if you just make it clear whats happening, noone needs to know the numbers

#

people are still gonna have to mess with the sandbox option to find what works for them, whether they know the math or not

golden sparrow
#

I need this

#

But it is trolling me

drifting ore
#

aiteron will have it finished lol they barely started getting deep
๐Ÿ˜„

sour island
#

direct multiplier 0.01 to 100

ancient grail
sour island
#

very carefully lol

#

you just need the direction and to grab the squares

#

there's probably an algorithm for a cone effect

fringe ridge
#

i give up on my mod for now, or at least the player build multistage wall stuff, i can't figure it out :S

sour island
#

are you sure those walls aren't identical to vanilla at that point?

fringe ridge
#

Well what i kinda want is that if a player makes a Metal wall, that zombies ignore it (the wooden walls will also be an option)

#

But i can't figure out where i have to inject the "isthumpable" stuff

#

My skills are just lacking mostlikely

sour island
# ancient grail how ? <@255358282862952449> need this code
    public Vector2 getForwardDirection() {
        return this.m_forwardDirection;
    }

    public void setForwardDirection(Vector2 var1) {
        if (var1 != null) {
            this.setForwardDirection(var1.x, var1.y);
        }
    }

    public void setForwardDirection(float var1, float var2) {
        this.m_forwardDirection.x = var1;
        this.m_forwardDirection.y = var2;
    }

    public void zeroForwardDirectionX() {
        this.setForwardDirection(0.0F, 1.0F);
    }

    public void zeroForwardDirectionY() {
        this.setForwardDirection(1.0F, 0.0F);
    }

    public float getDirectionAngle() {
        return 57.295776F * this.getForwardDirection().getDirection();
    }

    public void setDirectionAngle(float var1) {
        float var2 = 0.017453292F * var1;
        Vector2 var3 = this.getForwardDirection();
        var3.setDirection(var2);
    }
#

fun... vectors

#

getDirectionAngle should be useable to determine general directions though

#
    public String testDotSide(IsoMovingObject var1) {
        Vector2 var2 = this.getLookVector(IsoGameCharacter.l_testDotSide.v1);
        Vector2 var3 = IsoGameCharacter.l_testDotSide.v2.set(this.getX(), this.getY());
        Vector2 var4 = IsoGameCharacter.l_testDotSide.v3.set(var1.x - var3.x, var1.y - var3.y);
        var4.normalize();
        float var5 = Vector2.dot(var4.x, var4.y, var2.x, var2.y);
        if ((double)var5 > 0.7) {
            return "FRONT";
        } else if (var5 < 0.0F && (double)var5 < -0.5) {
            return "BEHIND";
        } else {
            float var6 = var1.x;
            float var7 = var1.y;
            float var8 = var3.x;
            float var9 = var3.y;
            float var10 = var3.x + var2.x;
            float var11 = var3.y + var2.y;
            float var12 = (var6 - var8) * (var11 - var9) - (var7 - var9) * (var10 - var8);
            return var12 > 0.0F ? "RIGHT" : "LEFT";
        }
    }
finite radish
#

Not really a guide, just some documentation or some way to see the source. Certain functions call the libraries natively, and Lua can call the functions that contain those native calls. If we don't know what they actually do, we're entirely in the dark. There are hints that let you kinda assume their usage, but that only goes so far. Again, any sensitive stuff could be excluded, or anything that's used by the game's executable on a technical level, but stuff like the PopMan library and maybe some of the others would be incredibly helpful.

sour island
#

they use this to determine front and back

dark wedge
#

I currently just use self.character:isFacingObject(self.item, -0.65)
Which does tell me if the item is behind my character or not (-0.65 was tested and found to be pretty reliable for what i needed at least).
I was trying to find if an object was to the back left, back right, or just back, of the character, but the isFacingObject returns -1 if the object is behind you, 1 if it is in front, and 0 if perpendicular. I was trying to do it with all math and using the vectors, but its been years since my last math class. I'll look at what was posted

sour island
#

seems like you can use the player's angle and get the vector between the player and the object like you did

#

if the angle is with in a certain range it'd be back left

#

so I think you'd need to check two angles

dark wedge
#

yea, i was trying to just mathematically figure it out with the direction vectors. trying to be smart, spent about 3 days on a solution that got nowhere. drunk

drifting ore
#

if you can explain it correctly. it's an exact usecase for ai chat bot if you aren't super against

#

since you are just having it do complex math

#

you just need to give the exact explanation of your goal and what the product of outcome is expected and then you can fine tune it from there to work for you

#

not normally a fan of using in any scenario except for figuring out complex math stuff because it's my worst field

dark wedge
#

yea, i might do that. haven't really messed with the chat bots, so i'll see what it says. good suggestion

drifting ore
#

just an example of a response with it assumie you are in 3d space(which you arent sso doesn't apply, but if you are specific it will consider it)

dark wedge
#

i should be able to specify 2d vectors, as that is what i have

drifting ore
#

You can use the dot product of two vectors to determine the angle between them and determine if an object is to the left, right, or behind your character. Here's a high-level explanation of how it could be done: 1 Calculate the forward vector of your character: you can use the character's rotation or orientation in 3D space to determine their forward direction. 2 Calculate the direction vector from your character to the object: you can use the difference between the character's position and the object's position to get this vector. 3 Calculate the dot product of the forward vector and the direction vector: this will give you a scalar value that represents the cosine of the angle between the two vectors. 4 Check the sign of the dot product: if it's positive, the object is in front of your character, if it's negative, the object is behind your character. If it's zero, the object is perpendicular to your character.

#

keep in mind this is for something more like dayz where you are char in 3d space but you can alter that so it knows

dark wedge
#

that's more or less what I'm doing now.

drifting ore
#

it will do the specific math tho

#

if you feed it the examples

#

it needs to know exactly how you are utilizing so it can go from there

pulsar heath
#

i taught it to make mods in pz ๐Ÿ˜„

#

its a good tool to check for "errors"

#

it takes time, it will spew out a lot of wrong crap

drifting ore
#

it will give you a halfassed decent way to get to where you can make sure its good. you will have to correct stuff

pulsar heath
#

but after a while it will start making sense and actually helping you out detecting what you are doing wrong

drifting ore
#

yea it learns on the fly haha

sour island
#

I have to confess, I'm actually ChatGPT

drifting ore
#

LOL

#

i knew it!

#

๐Ÿ˜„

pulsar heath
#

thats why you made so many mods!

dark wedge
#

"ChuckGPT"

drifting ore
#

lmao

pulsar heath
#

Ai is a good tool but not a replacement for human "work" as many think it is

#

plus i dont consider it AI per say

#

its close to be AI but still not there

#

it just has processing power to the point of iterating everything in the data set and follow code logic

drifting ore
#

chatgpt is like a really informative infant that knows a ton but doesn't know what to do with it ๐Ÿ˜„

pulsar heath
#

kinda like a dicionary... the info is there... but youre the one who has to figure out what to use and how to use it

#

it basicly making a query to a very large DB

#

but in "human language"

#

at least thats how i see it as is now

drifting ore
#

thats exactly it. you just have to teach it how to utilize that data in a way which makes sense for you, which is why it starts to "get it" after a little bit

#

i hope it helps you in this case dhert. the stuff you are working on is what i'd consider a much needed enhancement

#

just like those radials lol... those literally make the game playable for people who havent played before (in my opinion) between recipes and radial you can figure out most of the game lol

dark wedge
#

Thanks! I was trying to use this as an improvement for Fancy Handwork so the rear animation plays with the correct hand. RIght now, it just detects if its behind you and picks a hand. But it doesn't make sense to flick a lightswitch or something with your right hand if the object is on your back-left side. ha

sour island
#

the code I found mentions determining right or left

#

perhaps that can help

#

What do you have so far? @dark wedge

dark wedge
# sour island What do you have so far? <@255358282862952449>

Oh, i got rid of everything i was trying and just replaced it with: character:isFacingObject(self.item, -0.65)
I rage quit on it a few days ago, with plans to go back to it.
The bit that you posted might lead me to a solution, especially the last bit where it determines left or right. I copied that as a comment so i have it as a note for later.

sour island
#

ah ok

#

did they finally remove the vector2 file breaking vector2 useage in Lua?

#

๐Ÿ˜ฎ looks like they did - I feel like I learned this earlier in the year

#

oh it was literally last month drunk

#

post-covid time is just all a blur

pulsar heath
#

for me is the other way around

#

covid time is a blur

#

๐Ÿ˜„

#

i went from a job that made me have a very active social life to "hibernating" home

#

i broke my shell years ago... or i would be unemployed ๐Ÿ˜„

sour island
#

this is year 3 P.C.

pulsar heath
#

i consider PC after the confinement ended

#

for 2 years i almost went mad...

#

i went from going out every night from 22h to 4h to vegetating at home

#

not easy for someone who has the same work schedule and routine for 20 years to go from busy all the time to ... i have nothing to do

sour island
#

is there an event when you click on something in the world?

#

I've never tried this lol

#

oh wait yes I have

ancient grail
#

@dark wedge was it helpful? Thnx @sour island

dark wedge
polar thicket
#

what exactly is this "derive" function?

#

We have some ideas but we want to be clear

#

does it mean it takes code from that original file. Then adds the new functions you write bellow?

golden sparrow
sour island
#

@dark wedge @ancient grail

#

I translated the dot test code into Lua

#

not sure why the left right is inverted lol

polar thicket
golden sparrow
sour island
#

ah... the angle is 45 degrees off....

polar thicket
# golden sparrow Yeah pretty much

So basically it is like you are adding functions to that code during loadup? So basically this code adds its own functions to timedactions when game loads?

sour island
#

I wonder if this has implications in vanilla

#

also not sure how to fix this lol

#

I can invert left / right easily enough

#

but the angles are assuming the map isn't isometric

ancient grail
sour island
#

the left and right, yes it's just a print out

#

Im more concerned with the angles thing

ancient grail
#

What abt the code for neck bite or the knife backstab killshot thing

sour island
#

I'm hoping it's not using this math lol

ancient grail
#

Dont u think theres a code that detects stuff behind

sour island
#

this is labeled as a test function

dark wedge
#

those use character:isFacingObject

sour island
ancient grail
#

This is when chatgpt would become super useful

fast galleon
dark wedge
#

I don't think it matters too much if the angles are off slightly, as the main thing that they seems to be checking for is if the object is behind or in front of the player. and that works

sour island
#
---Brought to you by ChuckGPT
---@param char IsoGameCharacter|IsoMovingObject|IsoObject
---@param obj IsoObject
local function getDotSide(char,obj)

    ---@type Vector2
    local lookVector = char:getLookVector(Vector2.new())
    local lookVX, lookVY = lookVector:getX(), lookVector:getY()

    ---@type Vector2
    local charVector = Vector2.new(char:getX(),char:getY())
    local charVX, charVY = charVector:getX(), charVector:getY()

    local objX = obj:getX()
    local objY = obj:getY()

    ---@type Vector2
    local objVector = Vector2.new(objX-charVX,objY-charVY)
    objVector:normalize()

    local dot = Vector2.dot(objVector:getX(), objVector:getY(), lookVX, lookVY)

    if dot > 0.7 then
        return "FRONT"

    elseif (dot < 0.0 and dot < -0.5) then
        return "BEHIND"

    else
        local lcVX = charVX + lookVX
        local lcVY = charVY + lookVY

        local dotSide = (objX - charVX) * (lcVY - charVY) - (objY - charVY) * (lcVX - charVX)

        return dotSide > 0.0 and "LEFT" or "RIGHT"
    end

    return "WHAT DID YOU DO!?"
end
polar thicket
dark wedge
sour island
#

you should be able to adjust the values to change the angles too

#

probably can change it up to check only for left right as well

#

as it gets weird close up

dark wedge
#

yea, what you have is very close to what i did. I would run into issues with some objects (especially lightswitches where they just add a 0.5), and taking a step forward would just completely break the calculation.

#

yup, you're seeing what i saw, and why i raged. ha

sour island
#

player's use floating x/ys

#

maybe that's causing the issue

dark wedge
#

i was thinking the same, however, you need some of that floating point precision

#
    -- This game is weird man
    ---- I tried to get the angle between the player and the object but its fucking inconsistent because large numbers, AND fucking light switches
    ---- isFacingObject returns a value of 1,-1 and 0 represents it being perpendicular (left OR right)
    ---- This is also SUPER picky, in that moving a step in the same direction can go from 0.4 to -0.1 and below, or in the opposite direction, who knows man.
    ---- So already off, not the best function.  I will revisit this, I am way to tired to do the math right now and don't give a shit.
    ---- This function itself has lost me like 3 days. fuck this for now.
    return not (self.character:isFacingObject(self.item, -0.65))
end```
Is what ended up happening. ![drunk](https://cdn.discordapp.com/emojis/721361533271146537.webp?size=128 "drunk")
pulsar heath
#

well youre not the only one raging with this game while modding

#

i spent the last 2 days trying to figure out what was wrong with my code

#

to be informed that my code is right... what im trying to do only half works in mp

#

half the function im calling works, the other half doesnt... 2 in 1

#

so awesome ๐Ÿ˜„

nova socket
pulsar heath
#

i wish that was my case

#

it would be easily solved :\

nova socket
#

Thank god to people who made PipeWrench, that saved me a lot of time.

drifting ore
#

lolol i was going to tell you last night after i saw you knew TS

pulsar heath
#

that would be @red tiger i think

drifting ore
#

yep

#

i passed the eff out

sour island
#

I got a fix

pulsar heath
#

for what problem of the many we are ragin' about?

red tiger
#

PipeWrench has a discord (my org of projects) btw

sour island
#

for the same tile causing direction issues

red tiger
dark wedge
pulsar heath
#

ChuckGPT to the rescue ๐Ÿ˜„

sour island
#

just testing it some

nova socket
#

Java-related manuals out there does not seem to be visually friendly unfortunately.

drifting ore
#

i'm interested as i just explained this entire thing to codegpt and it came up with a (solution) based on chucks original code

#
local function getDotSide(char,obj)
    ---@type Vector2
    local charVector = Vector2.new(char:getX(),char:getY())
    local charVX, charVY = charVector:getX(), charVector:getY()

    local objX = obj:getX()
    local objY = obj:getY()

    ---@type Vector2
    local objVector = Vector2.new(objX-charVX,objY-charVY)
    objVector:normalize()

    ---@type Vector2
    local lookVector = char:getLookVector(Vector2.new())
    lookVector:normalize()

    local dot = Vector2.dot(objVector:getX(), objVector:getY(), lookVector:getX(), lookVector:getY())

    if dot > 0.7 then
        return "FRONT"
    elseif (dot < 0.0 and dot < -0.5) then
        return "BEHIND"
    else
        local cross = Vector2.cross(objVector:getX(), objVector:getY(), lookVector:getX(), lookVector:getY())

        return cross > 0.0 and "LEFT" or "RIGHT"
    end

    return "WHAT DID YOU DO!?"
end
#

tell me how bad it is

#

This code normalizes the look and object vectors, so that their length does not affect the dot product and cross product calculations. The cross product is used to determine the side of the character that the object is on, as opposed to using the previous code which used the dot product of the sum of the character and look vectors.

#

i'm genuinely interested to know

#

it mat have not written the code itself perfect also

dark wedge
sour island
#

what would cross here even mean?

dark wedge
#

the cross product would give you the answer though

drifting ore
#

ahhh

#

you may not be able to then without that unless chuck has soem worka round

dark wedge
sour island
#
---Brought to you by ChuckGPT
---@param char IsoGameCharacter|IsoMovingObject|IsoObject
---@param obj IsoObject
local function getDotSide(char,obj)

    ---@type Vector2
    local lookVector = char:getLookVector(Vector2.new())
    local lookVX, lookVY = lookVector:getX(), lookVector:getY()

    local charX = char:getX()
    local charY = char:getY()

    ---@type Vector2
    local charVector = Vector2.new(charX,charY)
    local charVX, charVY = charVector:getX(), charVector:getY()

    local objX = obj:getX()
    local objY = obj:getY()

    local notSameSpace = objX~=math.floor(charX) and objY~=math.floor(charY)

    ---@type Vector2
    local objVector = Vector2.new(objX-charVX,objY-charVY)
    objVector:normalize()

    local dot = Vector2.dot(objVector:getX(), objVector:getY(), lookVX, lookVY)

    if dot > 0.7 then
        return notSameSpace and "FRONT" or "BEHIND"

    elseif (dot < 0.0 and dot < -0.5) then
        return notSameSpace and "BEHIND" or "FRONT"

    else
        local lcVX = charVX + lookVX
        local lcVY = charVY + lookVY

        local dotSide = (objX - charVX) * (lcVY - charVY) - (objY - charVY) * (lcVX - charVX)

        if dotSide > 0.0 then
            return notSameSpace and "LEFT" or "RIGHT"

        else
            return notSameSpace and "RIGHT" or "LEFT"
        end
    end

    return "WHAT DID YOU DO!?"
end
#

My solution: if its the same tile - reverse the direction

drifting ore
#

ahaha

#

chuckgpt

sour island
#

the angle is still bugging me

dark wedge
#

vector2.cross is this, actually: local dotSide = (objX - charVX) * (lcVY - charVY) - (objY - charVY) * (lcVX - charVX)

sour island
#

it's very slightly off

#

so it didn't do anything lol

fringe ridge
drifting ore
#

lua converted to typescript essentially

#

then it compiles back to lua

nova socket
#

^ this

drifting ore
#

jab could probably explain WAY more in depth lolol

sour island
#

the fix doesn't work on the different directins ๐Ÿ˜ฆ

dark wedge
pulsar heath
#

im guessing that not all objects are created equal ๐Ÿ˜›

#

so the front for one might be the back for another one

#

and in the code front and back are refered as the model of the object and not the object placement in the world?

#

dunno if im translating it to english right... makes sense in portuguese ๐Ÿ˜„

sour island
#

it's using x/y s

#

this shouldn't be occuring

nova socket
# fringe ridge Consider me uninformed but what is Pipewrench?

Since Lua has no typings you cannot understand what type that or another argument should be. So if there is no working example and you have to pioneer some stuff, you need to go and read source based on Java exports. PipeWrench utilizes one of the core features of TypeScript - type declarations in one, you can call it a "tree" that some of IDE's like WebStorm or VSCode utilize like own trees. So having that you can understand what exactly that argument type is and how to construct it (in case its more complex type, as IsoSomething) with just few clicks away.

pulsar heath
#

so its relative to the map... it should be the same for all of them then

pulsar heath
#

not to keen in something that converts the code for me

#

i rather rage and learn how to do it properly

nova socket
#

Well I'm just 3 days into this game engine and I already messing with a bunch of Iso objects thanks to PipeWrench giving me a light to what they are and some devs here.

pulsar heath
#

plus the fault is not lua's

drifting ore
#

i dont think that's what they are saying though

#

more that its got some parameters to follow lol

#

where lua just is just like GOGOGO do whatever you can find

red tiger
#

I'm back

#

Was on the icy road here.

nova socket
#

As I said you don't really need to even compile Lua on PipeWrench, you can use it as guidance.

pulsar heath
#

@nova socket im happy you got what you wanted sorted out but honestly, no matter how good it is, ill stick to lua

golden sparrow
pulsar heath
#

er... i prefer lua to python

#

and i hate lua

golden sparrow
#

lmao

pulsar heath
#

so guess how i feel about python ๐Ÿ˜„

golden sparrow
#

i'm used to python

#

so i keep mixing both now that i do both

red tiger
#

Everything exposed.

pulsar heath
#

not saying its not a good tool to use, just saying that it depends on your good will to keep updating it everytime something changes in the games "api"

nova socket
#

Lua's only fault is not having switch do

#

any more takes? KEK

drifting stump
red tiger
#

@pulsar heath You may be grumpy sometimes but you weren't the grumpy guy yesterday who assumed people don't have fun with something like PipeWrench.

red tiger
drifting stump
#

it has switch

pulsar heath
#

not being grumpy, just stating my personal opinion

golden sparrow
drifting stump
#

just make a table

pulsar heath
#

you have a lot work done there

#

and you cant say youll be updating it as long as the game goes on

red tiger
#

I've been grumpy lately lol

red tiger
pulsar heath
#

to use as a learning tool since your documentation is a lot more complete than the oficial ( oficial lol )

#

yeah 100% ill use and abuse it

#

but i rather type the code in lua myself

red tiger
#

Please do. It like that.

pulsar heath
#

thats all im saying

red tiger
#

My documentation is generated and compiles all usages of the same method signatures.

pulsar heath
#

not trying to undermine the value of your project

red tiger
pulsar heath
#

good, sometimes thinking in 1 language and typing in another can lead to... lost in translation meanings

#

๐Ÿ˜„

red tiger
#

I probably wrote somewhere between 20-30k lines of Lua for PZ.

#

I know TS way better than Lua.

pulsar heath
#

even pascal is better than lua

#

and thats been obsolete for about 30 years or more

#

๐Ÿ˜›

red tiger
#

I have this.. problem right now.

#

This problem.. is that my brain won't stop thinking about to code a transpiler from Lua to full-blown TS implemented code.

pulsar heath
#

mine keeps naggin' me about not being able to make the zombies act like a wandering horde in mp

#

still thinking about it... and all the solutions that come to mind = writing a huge wall of code...

red tiger
#

It's not impractical to convert the Lua codebase into full Typescript.

#

.. and that's why I'm slightly bothered lol.

#

I can't explain it to myself in a way that says it's not.

#

Because I wrote PipeWrench, I know how to do it.

pulsar heath
#

hmm i think i have a possible solution... gonna test it out

red tiger
#

This is how PipeWrench literally started as a project.. I couldn't unjustify it. God damnit..

pulsar heath
#

nop doesnt work

#

was hoping i could move them to a square instead of the player

dark wedge
#

hooray. first pass of another offhand animation is done. needs more tweaks (like the item's rotation in swing), but forward progress is always good:

pulsar heath
#

hmmm

#

gratz

#

i wonder if ```local function ZombieToPlayer(zombie)
local targetsq = player:getCurrentSquare();
if targetsq == nil then return; end
local x,y,z = targetsq:getX(), targetsq:getY() , targetsq:getZ();
zombie:pathToLocationF(x, y ,z);
end

#

this might work

#

or not...

#

im even afraid to try and start ragin' again ๐Ÿ˜

#

or i could just use the player x y directly...

#

it sound to simple to work...

#

gonna try it anyway

sour island
#

question @dark wedge does mouse x/y matter in your case for animations?

#

rather than using the object's xy

#

unless you're supporting using E to hit lights

dark wedge
sour island
#

E doesnt work on lights?

pulsar heath
#

in vanilla nop

dark wedge
#

nope. i thought about adding support for that and the other objects (like ovens) with "E".

#

but with a mouse its not as important, so didn't

golden sparrow
pulsar heath
#

so i can get a zombie list on the player cell like so
ZedList = player:getCell():getZombieList() right?

golden sparrow
#

Oh that's really cool

#

I thought it was hardcoded in java or smthing

ancient grail
#

Try to check type()

#

Using debug

dark wedge
pulsar heath
#
        local zombie = ZedList:get(i);
            if (zombie:isDead()) then
                zombie:pathToLocation(x, y ,z)
            end
  end
    ```
#

something like this i guess

sour island
#

I refactored the code a bit, and got left/right somewhat reliable but lost front/back lol

golden sparrow
ancient grail
#

Lol last one bit me
Anyways
I used xml

golden sparrow
#

I do this IRL too

ancient grail
#

Nodified xml

#

Modified

golden sparrow
#

Casually one shoting everything around

ancient grail
#

No im punching

ancient grail
#

Good one

#

You woukd have nodify the properties or ag of thay tile you mentioned

pulsar heath
#

i thought the player object add isdead in it

ancient grail
#

You can either do it by lua

or by tiledef.
upload a modified tiledef with that tile as its own thing its redefining

pulsar heath
#

but it doesnt dang it

ancient grail
#

For lua you probably need a listener for your swing and equiped knife
Then it will change the tile in front of you by editing its properties

ancient grail
sour island
#

I've been slowly pulling apart the called functions

#

seems like you can mess around with angles and stuff - setlength and such

#

should be able to solve the front/behind/left/right problem

#

the angle it thinks the player is looking is ever so slightly off tho

pulsar heath
#

im being dumb

ancient grail
#

Based on characters faced direction

pulsar heath
#

this local ZedList = player:getCell():getZombieList() already gets the zombies

sour island
#

it's grabbing the clicked on mapobject

ancient grail
pulsar heath
#

and its all zombie.characters.IsoZombie

ancient grail
#

Wizardry

pulsar heath
#

while the player is zombie.characters.IsoPlayer

#

right?

ancient grail
#

zombie idk abt that why do you need to know this

#

All i known to use is by checking instanceof

bronze yoke
#

that's right

ancient grail
#

if instanceof(something, "IsoPlayer") then blahblan end

pulsar heath
#

so something like this

for i=0, ZedList:size()-1 do
    local zombie = ZedList:get(i);
    local x,y,z = player:getX(), player:getY() , player:getZ();
    zombie:pathToLocationF(x, y ,z);
end
``` might work
ancient grail
#

I theres a function to get the closteet zed

pulsar heath
#

and if i use the zombiesinoutfit and dressed them all the same

#

i can probably use that to only send the zombies spawned... i think

ancient grail
#

Pathtolocation wi make them walk there

#

Will^

#

??

pulsar heath
#

thats what i hope it will happen dunno

#

gonna try it out

ancient grail
nova socket
#

Or is it out of your scope?

pulsar heath
#

ZedList...

#

contains all the zombies in the ceel

#

cell

#

where the player is

nova socket
#

I mean if you spawn some of them manually..

#

If its in generic pool then yes.

red tiger
#

mmm.. generics in Lua.

#

Haha

pulsar heath
#

er...

ancient grail
#

He has a point

pulsar heath
#

ill probably will just go with spawn zombies in a square

ancient grail
#

His saying you spawn em then you can capture its id as you spawn them

pulsar heath
#

get that square zombies list and send them to the player xyz

ancient grail
#

Have you seen how the horde event does it

#

It has a github

pulsar heath
#

dont think that works in mp

ancient grail
#

Horde event? It does

#

We used thos before for our server before making the server pure pvp

#

It even sends each player a say command containing the direction of where the zed is going to spawn

pulsar heath
#

hmmm link pls

ancient grail
#

Ok sure hold on

pulsar heath
#

is it the horde night mod?

#

it was broken last time i tried it

wet sandal
#

Anyone know what i need to do to connect with debug mode on to a server?

ancient grail
#

you have access to rcon? @wet sandal

wet sandal
#

rcon?

ancient grail
#

If you do
Even if your player isnt born yet
You can just setaccesslevel that username

wet sandal
#

Its a local server

ancient grail
#

RCON yes

#

Ahh

#

I never had a problem for local host

#

Idk ehy that is happening to you

pulsar heath
#

but if its a local dedicated you still need the rcon access

nova socket
#

Networking question: Does sendObjectChange send mod data too?

wet sandal
#

local dedicated, yes

pulsar heath
#

you have to set your login account on the server as admin

#

so youll need the rcon to do that

ancient grail
ancient grail
wet sandal
#

Ah, I just nuked the DB and restarting the server prompted setup again

#

That'll probably do it

#

Yea its working now

#

That DB was probably sitting there since build 40 tbh

ancient grail
#

Wizzardry

pulsar heath
#

yeah this mod is spawning the zombies and sending them the way i was thinking about doing

#

dresses them all the same

#

and sends all the zombies in a location to the player xyz

ancient grail
#

U just need 1 inventory item

#

Im curous to see if this work

pulsar heath
#

it spawns 1 by 1...

#

hmm i see why

drifting ore
#

you can use clothes also they said

ancient grail
#

U gona spawn em with a logo on their forehead that looks liks barcode
Then sheep herd them into into one table then send em running to the player

drifting ore
#

outfits

pulsar heath
#

thats what im trying to do

drifting ore
#

oh hell yea

ancient grail
#

Ye

drifting ore
#

you are killin it with that dude

pulsar heath
#

im gonna make a horde of thong zombies atack the streamer

drifting ore
#

slappin away most of the day

pulsar heath
#

๐Ÿ˜„

ancient grail
#

Do it!!!!!!!!

#

And his spawning it to attack himself lol

#

Does the square:Explode() work?

golden sparrow
#

No idea

#

square:StartFire don't

ancient grail
#
local function OnZombieDeath(zed)
zed:getSquare():explode()
end

Events.OnZombieDeath.Add(OnZombieDeath)```
#

You are doomed i tell ya if that works and you add it

Suicide bombers lol

fast galleon
#
        IsoFireManager.StartFire(square:getCell(), square, true, 100, 0)
        IsoFireManager.explode(square:getCell(), square, 10)
#

best called on server side

drifting ore
#

if i'm trying to target an object in the world (lightswitch) do i have to do it by sprite? or can i use CustomName? i tried using getProperties.Val("CustomName = ".."Switch") which is the custom name of the tile itself

sudden wing
#

Hi guys, quick question, am I allowed to upload a mod I just uploaded to this chat? or where should I post it?

sour island
#

anyone know how to determine mouse pos x/y with in a square?

#

I tried looking through the placeitem cursor thing

fast galleon
#

steam preferable, link here

sour island
#

the cursor ui makes reference to joypad position

fast galleon
#

if you put a rar, obout 99% people won't touch it

sudden wing
fast galleon
sudden wing
pulsar heath
#

yeah hes doing it kind of the way i was thinking

fast galleon
#

looks interesting

pulsar heath
#

but in a smarter way

#

dang

drifting ore
#

do you use a seperate hotkey for activating the lightsabers?

#

or do they come out when you pull out

pulsar heath
#

he even makes the zombies dress according to the area where they spawn

sudden wing
drifting ore
#

sweet. just wanted to be sure. i use a mod from someone here that also has them and they work exactly the same. nice job btw. when done right, these look really good in the game. kudos

ancient grail
sudden wing
sacred matrix
#

I coded Anthro Survivors. Anthro Survivors defines a custom body location, but Zeds don't render that. To get around this when you die I swap out a 'Fur' body part clothing for a 'Bandage' body part clothing. (I personally didn't create an Anthro Zeds mod because trying to get zombies to spawn with bandages (and only one of them) is a nightmare, and I have very high QA standards)

ancient grail
pulsar heath
#

????

sudden wing
#

Oh, mb, I thought you said that to me

ancient grail
#

Whats true, 10, 0)
And
10)

#

@fast galleon

last flax
#

Greetings dear people, I wrote this message with the intention of hiring the services of a modder, I need to create a script to add another pair of rear wheels to a vehicle, a truck specifically, for more information you can write to me in DM and so we can also talk on price.
Thanks.

fast galleon
ancient grail
#

explode(IsoCell cell, IsoGridSquare gridSquare, int power)

Wtf is power? Ahh probably the duration of the fire cuz it eventually dies
Can think of it as hp

I hope

sour island
#

@dark wedge - got it accurate to within the same tile

drifting ore
#

wow

#

you are literally chuckgpt for real

pulsar heath
#

lol

ancient grail
#

Would probably be a good effect if i add nozzle flare code
And make the ground burnt but will revert after a few seconds
Wait what am i saying . Lol just got the idea of doing this mod ๐Ÿ˜‚ nooooooo

sour island
#

I have a tendency to get fixated, I decided to just focus on directing that fixation

ancient grail
dark wedge
pulsar heath
#

i tend to rage...

#

a lot

faint jewel
#

when does something pass from comedy into blasphemy?

drifting ore
#

when it hurts ๐Ÿ˜„

fast galleon
sour island
#
---Brought to you by ChuckGPT
---@param char IsoPlayer|IsoGameCharacter|IsoMovingObject|IsoObject
local function getDotSide(char,mouseX,mouseY)

    ---@type Vector2
    local lookVector = char:getLookVector(Vector2.new())
    local lookVX, lookVY = lookVector:getX(), lookVector:getY()
    
    local charX, charY, charZ, charNum = char:getX(), char:getY(), char:getZ(), char:getPlayerNum()
    
    ---@type Vector2
    local charVector = Vector2.new(charX,charY)
    local charVX, charVY = charVector:getX(), charVector:getY()

    local objX = screenToIsoX(charNum, mouseX, mouseY, charZ)
    local objY = screenToIsoY(charNum, mouseX, mouseY, charZ)

    ---@type Vector2
    local objVector = Vector2.new(objX-charVX,objY-charVY)
    objVector:normalize()

    local dot = Vector2.dot(objVector:getX(), objVector:getY(), lookVX, lookVY)

    local results = ""

    if dot > 0.0 then
        results = results.. "FRONT"
    else--if (dot < 0.0 and dot < -0.5) then
        results = results.. "BEHIND"
    end

    results = results.."|"

    local lcVX, lcVY = charVX + lookVX, charVY + lookVY
    local dotSide = (objX - charVX) * (lcVY - charVY) - (objY - charVY) * (lcVX - charVX)

    if dotSide > 0.0 then
        results = results.. "LEFT"
    else
        results = results.. "RIGHT"
    end

    return results, ""..dot.."|"..dotSide
end
#
require "ISObjectClickHandler"
local ISObjectClickHandler_doClick = ISObjectClickHandler.doClick
function ISObjectClickHandler.doClick(object, x, y)

    ---@type IsoPlayer|IsoGameCharacter
    local player = getPlayer()
    local results, dotText = getDotSide(player, x, y)

    player:Say(getMapObjectName(object))
    player:Say(results)
    player:Say(dotText)
    player:Say(" pXY:"..player:getX()..", "..player:getY())
    player:Say(" oXY:"..object:getX()..", "..object:getY())

    ISObjectClickHandler_doClick(object, x, y)
end
#

Weirdly ISObjectClickHandler is in server

#

I had previously separated the front / side

#

but that can be re-merged with the old math

faint jewel
#

soooo blasphemy or no?

sour island
#

doesn't actually use the object btw - uses the mouseX/Y

#

in order to use the isoObject directly you'd have to determine where its visually located which... would be tedious as all hell

ancient grail
sour island
#

light switches for example would have to be given a X/Y that is adjusted depending on their direction - so not really recommended - unless you can easily identify what's on a wall or not - but even smaller stuff like mailboxes would cause issues too

dark wedge
sour island
#

this should already get controllers if I'm not wrong

dark wedge
#

oh? does the click handler work for that?

sour island
#

the x/y fed into it should match joypad's x/y is all

#

you don't need the click handler code at all

#

just need to feed it the right information

faint jewel
dark wedge
#

oh. misread it, forgive me. am at work so using the phone. ha

ancient grail
#

Or isnt religous

sour island
#

no worries - click handler would be ok for lightswitches but the crux of the code just needs the interacted x/y mouse or joypad

#

the issue was math wise it needs a float

#

using whole numbers for that breaks the math with angles

#

you'd have to I guess subtract 0.5 for x/y to get the center of the tile

#

but that doesn't work for lightswitches and differently sized items

#

so I'm hoping you'll just need cursor x/y

pulsar heath
#

my brain... it hurts

#

at least whats left of it

#

๐Ÿ˜„

dark wedge
sour island
#

np

#

I liked your animation work ๐Ÿ˜‰

pulsar heath
#

im even gonna stop messing around with my mod before i break it...

#

gonna mess around in the app... i feel more at home there...

ancient grail
pulsar heath
#

time to pimp up the UI

nova socket
#

Is there a way to set world IsoObject not being able to picked up?

ancient grail
#

You gave up?! Cuz of the math?

#

Ow wait thats diffeent

ancient grail
#

Hahaha

pulsar heath
#

just stoping for a bit and working with some code that i actually know what im doing

nova socket
#

I mean I see setNoPicking(arg0: boolean): void; in IsoObject but how reliable that is?

sour island
#

I'm by no means a smart guy, just patient ๐Ÿ˜…

ancient grail
#

Whe. They pick up stuff they get injured lol

sour island
#

still have no clue how the math works

nova socket
ancient grail
#

Hahaha

pulsar heath
ancient grail
#

Anyways one of the nethod people use is settitng the wweight to 1k

#

But if that doesnt work then maybe once you pick it up just have em drop it again

nova socket
#

So it cannot fit a priory I see.

#

Yeah, I'll check out that method IsoObject has and see if it has any reliability.

ancient grail
#

Theres no event to catch items that are picked up

You could however try your luck looking at looting related lua and the containers related lua

#

Long files tho

#

โ˜•

#

Here you get the biggest coffee you will need this

sour island
#

you're making me want coffee

ancient grail
#

Its 6am here lol

sour island
#

5pm here

dark wedge
# faint jewel soooo blasphemy or no?

I think this is absolutely hilarious, and personally have 0 problems with it. However, maybe "KFZ" would be better? Z for zombie. i don't want you to be downvoted to oblivion because of some religious nuts who can't take a joke....

ancient grail
#

Or use spiffo

#

SFC

nova socket
#

nope unfortunately IsoObject:setNoPicking(true) or false doesn't stop from players being able to pick up world objects.

ancient grail
#

Worldobjects! Ithought inventory

#

Ye you have to mess with he vanilla code and look for that pickup context menu block it into a state uselessness

#

And smile as you watch players go nuts

#

If they craft a crate and accidentally trap thenselves
Send a servermsg this is how you died

nova socket
#

Played a few servers where people screamed about wipes due to players grabbing some loot world containers away like military boxes.. thought to make a minor mod just for that.

ancient grail
#

Just delete the bin

#

It will recover

#

Or use lockcontainers api by the great chuckgpt

nova socket
#

I mean why not try to find a countermeasure, rather than doing a measure

ancient grail
#

And add a nosledge cant be disabbled and canpickup not sure if thats a thing tho

ancient grail
drifting ore
#

it's already been done before from bikini i believe

ancient grail
#

Iment my syntax

drifting ore
#

ahh

ancient grail
#

Im afk so couldnt check

tawdry moss
#

how do you get a single zombie in a horde spawned with addZombiesInOutfit()? It spawns the zombie just fine but returns an arraylist of the zombies in the horde and I can't figure out how to get a single zombie entity from it

bronze wing
#

Hey uh

faint jewel
bronze wing
#

Anyone here a good modeler?

faint jewel
#

who would eat friend zombie??

bronze wing
#

Specifically zombie models

#

Maybe somebody here could help with a passion server

ancient grail
faint jewel
#

XD

nova socket
#

So..

faint jewel
#

i think it looks good.

ancient grail
nova socket
#
local function OnObjectAboutToBeRemoved(object)
    print(object);
end

Events.OnObjectAboutToBeRemoved.Add(OnObjectAboutToBeRemoved)

^ This triggers on every cursor movement when you hover with anything like Pick Up
And..

function ISMoveableCursor.exitCursorKey( _key )
    if getCell() and getCell():getDrag(0) and getCell():getDrag(0).Type and getCell():getDrag(0).Type == "ISMoveableCursor" then
        local disable = false;
        if not _key then
            disable = true;
        else
            if getCore():getKey("Run") == _key then
                disable = true;
            elseif getCore():getKey("Interact") == _key then
                disable = true;
            end
        end

        if disable then
            getCell():setDrag(nil, 0);
        end
    end
end

Guess how you can use both?

ancient grail
#

Did that work i thought it was obsolete

nova socket
#

Not sure.

#

Thats only theory about to be tested

#

But anyways there should be something actual that does that Pick Up tool cancellation.

ancient grail
#

getCell():setDrag()
?

I mean im not sure if this is possible
Or if its ever a good idea

nova socket
#

Doesn't stop from disassembling thou

#

Since its in a context too and works on proximity

ancient grail
#

Look for the disable code

fast galleon
#

"^ This triggers on every cursor movement when you hover with anything like Pick Up
And.."
what?

nova socket
#

ill see if thats it getCell():setDrag(nil, 0);

nova socket
fast galleon
#

yes, after you select object to remove.

#

not before

ancient grail
#

Can you paste your reference here

drifting ore
#

holy shit am i way behinde

#

yes i am

ancient grail
#

Ow why did you remove it

drifting ore
#

oh ais it still relevent

#

is it

#
-- supply player, square of object, isoobject, ISMoveableSpriteProps
-- if valid returns ISMoveableSpriteProps otherwise nil
function ISMoveableTools.canPlayerPickUpMoveable( _char, _square, _object, _moveProps )
    if _square and _char and _object and _moveProps then
        if _moveProps and _moveProps:canPickUpMoveable( _char, _square, _object ) then
            return _moveProps;
        end
    end
    return nil;
end
#

pretty much the same for object

ancient grail
#

Ye you forgot to reference the vanilla and made a new function called old

drifting ore
#

i thought he mentioned ways to cancel pickup

#

i'm pretty sure it's in the ismoveabletools

ancient grail
#

Ah this is the vanila

#

Ok ok lol

drifting ore
#

yes

fast galleon
#

I believe it's as simple as ~ getSpriteManager():getSprite("..."):getProperties():UnSet("Moveable") not exact command

ancient grail
#

I dont see the check function thats where u want to hook

#

Like as it validates if it can be picked up
Just put false on the true

#

Im sure this will work ๐Ÿ’ฏ

zinc pilot
#

hey, is the workshop having problems? I'm not able to push an update

drifting ore
#

I was trying to find the best way to find the lightswitch and i think if i make a table of the sprites this will work

zinc pilot
#
function: updateWhenVisible -- file: WorkshopSubmitScreen.lua line # 1125 | Vanilla
function: render -- file: WorkshopSubmitScreen.lua line # 1164 | Vanilla```
Getting this error too
ancient grail
fast galleon
drifting ore
zinc pilot
#

lua, tiledef were no use after all

zinc pilot
fast galleon
ancient grail
#

So what did you do instead if not one of those

sour island
#

testing out EHE on a mp server - I'm so sorry everyone

#

this is what I put you guys through

zinc pilot
#

Basically used MOTrap as a base

#

replaced instances of that tile with mine

#

during world gen

#

or chunk generation or whatever you wanna call it

tawdry moss
#

Is it possible to apply postprocessing/filters to the screen? Like temporarily make everything more saturated/vibrant or slowly fade to black&white?

azure rivet
#

Hello, I want to remove the option of a weapon that can be equipped in the main hand, I just want to leave the option for it to be equipped in the second hand.
I donยดt make it.

ancient grail
#

Wow this is amazing @zinc pilot congrats

zinc pilot
#

just had a hunch and it worked, got lucky

#

also someone suggested to take a look at it

ancient grail
#

This is game changing man

fast galleon
#

prob me, it's part of global object system

zinc pilot
ancient grail
#

Probably polt ye.

zinc pilot
#

I don't remember if I already said thanks ๐Ÿ˜„

fast galleon
ancient grail
zinc pilot
ancient grail
fast galleon
#

yeah can't find it, how did you type it

nova socket
ancient grail
#

Found it

#

Albions msg

zinc pilot
#

I miss searching in forums

ancient grail
fast galleon
#

here

ancient grail
zinc pilot
#

not the first time something like this happened

ancient grail
#

Ow yeaaah

azure rivet
#

I am informed that a last update added to the context "removeOptionByName"

#

I've tried to implement it, but I can't find much information about it.

drifting ore
ancient grail
#

It sounds like you want to remove cuz what we did was substitute in reality but it looks like we just disabled it

Reason for doing that is so that people wont think theres a bug and ask question wht theycant drink
Or cigarettes are broken or e
Whatetver

azure rivet
nova socket
fast galleon
#

da net

tawdry moss
#

how do you get the zombie entity of a single zombie in a horde spawned with addZombiesInOutfit()? It spawns the zombie just fine but returns an arraylist of the zombies in the horde and I can't figure out how to get a single zombie entity from the arraylist

nova socket
# fast galleon da net
local function OnObjectAboutToBeRemoved(object)
    print(object);
end

Events.OnObjectAboutToBeRemoved.Add(OnObjectAboutToBeRemoved)

prints object before any action is applied. So "Yes, no"

#

Not after

ancient grail
fast galleon
humble oriole
#

Does anyone know what controls the order the of the tabs in the crafting menu? I thought they'd be alphabetical, but it doesn't seem like it. It seems to be just kinda random.

tawdry moss
ancient grail
#

According to what loads first im guessing
Why is it relevant? Whatcha building ?
@humble oriole

tawdry moss
humble oriole
#

seems like they're just thrown in there

nova socket
#

@ancient grail getCell():setDrag(nil, 0); cancels the Pick Up or any similar panel action, however it somehow doesn't fire from within an event function.

sour island
#

could be a pairs() in the UI

#

that'd have no order though

ancient grail
#

Cuz it loads slow?
Hmmm...

fast galleon
#

you can check ISCraftingUI ?, panel for how it makes the tabs

sour island
#

k15 might also be inserting it after a specific tab

ancient grail
#

OnMouseMove?

fast galleon
ancient grail
#

He needs something else

sour island
#

o..o

fast galleon
#

^_^

ancient grail
#

Omg threads! Nice

sour island
#

when was that added and how do they work

nova socket
# ancient grail Thats what he is using now
local function OnObjectAboutToBeRemoved(object)
    getCell():setDrag(nil, 0);
end

Events.OnObjectAboutToBeRemoved.Add(OnObjectAboutToBeRemoved)

This somehow doesn't fire at all. I'll figure out why. Might have to set some bool and route it outside to cancel action.

fast galleon
sour island
#

from here?

ancient grail
#

Threads a thing!! Quick lets make guides and topics with references

sour island
#

You should thread your giant wall of stuff

ancient grail
#

And snippets!

#

Sure

sour island
#

can you delete threads though

fast galleon
#

yes

ancient grail
#

Aw theres expiration to threads

#

Bummer

sour island
#

aw?

ancient grail
fast galleon
#

@ancient grail for annotated maps there's map editor in-game

ancient grail
#

Ahh

#

How do you use that

#

Lol

#

Link for the community api pls @sour island

#

Useful Utils, Helpers, Api, frameworks

sour island
nova socket
#

Can sandbox option be string?

red tiger
ancient grail
#

Yes im looking for jt

red tiger
#

Kind of hard to uhh link only one thing for it lol

ancient grail
#

It i added your server command
What abt sledgehammer

red tiger
#

that's not operational so it wouldn't work out of the box.

#

I'd need to finish the rewrite for it.

#

I don't know if people would want a plugin-framework for Java modding PZ servers in 2023.

ancient grail
#

I posted the template

ancient grail
#

Ye kets just keep it there if anyones interested they will ask you

red tiger
#

As is tradition.

nova socket
#

Should I post a non-mod function to debug sprites with context menu?

red tiger
#

The damn thing is growing to be like Apache Commons for PZ at this point.

ancient grail
#

Ahhh o yeah why not

nova socket
#

k

ancient grail
#

try to catch the sprite

#

You can use AuD too

sour island
#

AuD?

ancient grail
#

Ye aiteron tho you need to modify it to show the names

sour island
#

what about debug tools ๐Ÿ˜ฆ

ancient grail
#

Is the debug mod ur doing the community api or something else

sour island
#

yes

ancient grail
#

I thought you arent done with that lol makes sense now

#

I didnt know it was the same cuz community sounded like a colab proj

sour island
#

it's an on-going thing

#

it is a colab but the tools can be used as is

ancient grail
#

Ow yeah remembered another useful thing the ui samples

sour island
#

ui samples?

ancient grail
nova socket
#

Wiki is editable as is isn't it?

sour island
#

My next goal is to allow linking to objects listed

#

so you can jump around

bronze yoke
#

you can't edit the event pages, everything else should be fine

red tiger
#

I kinda want to work on the wiki.

sour island
#

Some of it can be automated, and they need the help

red tiger
#

I don't know who automates as much as I do when it comes to modding hahaha

bronze yoke
#

i've got a pr for the mistakes i've noticed but i don't think the github is monitored anymore

sour island
#

There was a guy touting he could help them so much by extracting data from the game's files for on the fly updating - but then he dipped ๐Ÿ˜ฆ

red tiger
#

PW checks daily for updates to PZ and then pushes those changes. My transpilers generates docs. That info might be useful.

ancient grail
#

Bummer that could have been super useful

red tiger
#

I also have a JSON format / app for 3rd-party documentation of PZ API.

ancient grail
sour island
#

no, like click the object line in the UI and it loads that object

ancient grail
#

Without the obj just coordinates

#

Ahhh

drifting stump
#

ooooo threads happened while i was gone

ancient grail
red tiger
#

I am revising the original schema / version of it but here's my example of partially documenting UIElement:

drifting stump
#

thats going to get merged into the community framework

#

with some changes and improvements

sour island
#

๐Ÿ˜ฎ

#

radialAPI?

drifting stump
#

i mean yeah already did it mostly a copy paste into the framework

ancient grail
#

Ye i feel like everythings mucheasier for those who plans to start modding

red tiger
#

My format needs to support both Java and Lua documentation.

#

Soooo yeah.

ancient grail
#

What abt the css mod

drifting stump
#

but remove globals make the api for custom radials and finish the slice interactions

red tiger
drifting stump
#

like efficient remove without entirely unregistering

#

and ordering

#

say for example i want my slice to ideally be 3rd

ancient grail
#

Anyone knows the sqlite tool for db management

sour island
#

Oh i know one

red tiger
#

HeidiSQL is my fav.

red tiger
#

DB something is another one I used.

#

Yeah that one.

sour island
#

this lets you run scripts

drifting stump
#

the dbs arent really usable

red tiger
#

I use HeidiSQL at my work even though they use MySQL Workbench.

dark wedge
#

$ sqlite3 /path/to/sqlite.db ๐Ÿ˜†

sour island
#

helped djackz with his hardcore escape server

drifting stump
#

they dump serialized java objects into collumns

ancient grail
#

What abt that ssr java . Anyone tried that

#

Not sure how it works

red tiger
#

As someone who sometimes designs db stuff.. uhhhhhhhhhhhhhhhhhhhhhhhhhhhh...

#

(runs away)

drifting stump
#

hi there fellow db user

#

currently learning db2

sour island
#

you can make commands to run purges

red tiger
#

I once modded the server to run on MongoDB.. because can.

#

A buddy of mine has a full SQL server running for his community.

nova socket
#

For what purpose?

red tiger
#

Removing the drag on IO among other things..

#

A very promising experiment.

#

I also have private repos for managing the protocol layer documentation and file formats in markdown.

#

(It's nice to know what's going on with how the game communicates and read/writes)

nova socket
#

You didn't waste your time I see))

red tiger
rain shard
#

Hey guys, anyone know where the ZombRand function is defined? I'm trying to figure out why it's spitting out more than 1 entry in the array so I gotta check I'm actually using the params right.

red tiger
sour island
#

ZombRand starts at 0 and is exclusive of n

rain shard
#

so my assumption was correct...

sour island
#

ZombRand(n) where n = number of digits, so (3) = 0,1,2

rain shard
#

so it behaves like a regular rand(), got it. back to figuring out what went wrong with this array then

#

ty all

sour island
#

ZombRand can also have 2 params, but that just adjusts the min

red tiger
#

Gib Medium quality PRNG pls.

#

ZombRand still uses a high-quality PRNG atm IIRC.

rain shard
sour island
sour island
rain shard
#

hrmm okay

nova socket
#

hehe

rain shard
#

Thank you for the quick explanation Chuckleberry!

nova socket
#

gonna call that mod "Cant touch this"
Anyone hearing music already?

red tiger
#

Time to build another Lua transpiler.. :D

ancient grail
#

How are they going to transfer stuff if canttouchthis then return end

sour island
#

๐Ÿ˜ฎ

#

I done did it

#

got the inspect UI to link references

#

breaking a bit trying to load non existent modData tho

#

this should let you hop around by references

#

eventually I want to add an editor

#

not sure how bad that'd break stuff but it's for debugging so