#mod_development

1 messages · Page 81 of 1

pulsar heath
#

like said... obviously stupid...

wide oar
#

ZombiesZoneDefinition = ZombiesZoneDefinition or {};

--ZombiesZoneDefinition.Default = {};
table.insert(ZombiesZoneDefinition.Default,{name = "sUnknownTrenchcoatDown", chance=70.5});
table.insert(ZombiesZoneDefinition.Default,{name = "sUnknownTrenchcoat", chance=70.5});
table.insert(ZombiesZoneDefinition.Default,{name = "sUnknownBandana", chance=70.5});

#

i have it set to this but it isnt spawning

drifting ore
#

you are a literal fucking god

#

I love you so fucking much

#

I don't even know what Recurse means in english

#

I would have NEVER found that

pulsar heath
#

to many coding languages in my head... starting to mix everything up...

#

need a break... or ill keep doin' stupid crap like that.

calm depot
#

I don't know what language you use where the . operator is for function calls, and I don't think I want to 😛

pulsar heath
#

class classname
sub tonumber()
end sub
end class

classname.tonumber...

#

mixing non existing ways with existing ways to work with objects

#

to much crap in my head already

calm depot
#

the . still isn't being used for a function call

pulsar heath
#

yeah i know...

#

need to work on 1 thing at a time or ill be doing stupid shit like that again

#

also need to use intellij more... the addiction to notepad++ is obvious...

faint jewel
#

THIS MAKES NO DAMNED SENSE.

#

trying to make my mower work with 10yl on a server and it's just not saving that the grass was removed.

drifting ore
#

Bro thank you all in this chat for helping so much, I'm so glad I got at least a working prototype of my mod. I'm gonna expand so much on it now that I know how these commands work 😁😁

calm depot
#

@faint jewel does it save when you remove the grass the vanilla way?

faint jewel
#

my way? yes

#

but his way with all his extra stuff it does not.

calm depot
#

no, I mean does it save the grass removal when you do it the usual, unmodded way with a tool

faint jewel
#

but i am using the EXACT SAME REMOVAL METHOD and his hand removal and they come back.

calm depot
#

I would first verify that there are no bugs in 10yl itself with removing grass

faint jewel
#

his remove grass command works. i automate it b attaching it to a mower. it works until you relog and they are back.

drifting ore
#

Here's the mod in action btw. really barebone right now but will be expanded a lot 😁

ruby urchin
dark wedge
calm depot
#

I hear if you install enough mods, you can make the animations look like that anyway

#

cries in 5 FPS

dark wedge
#

made a new wrench animation for doing repairs on cars. i hate item-hand placements.

limber oar
#

Also, before worrying about whether it spawns on zombies or not, just make sure the outfit was correctly added by checking in the outfits list on the character clothing menu in sandbox. (Not insulting your competence, it's just good to eliminate obvious points of error first.)

ruby urchin
ruby urchin
dark wedge
wide oar
#

PUBG_ZombiesZoneDefinition.lua

#

?

mortal widget
dark wedge
mortal widget
sudden depot
#

you know an idea just came to mind dead rising melee weapons no one has made them for this game yet

mortal widget
#

like traffics cones benches and shit? lmao

pulsar heath
#

so one simple question...
i know i used addZombiesInOutfit(wx,wy,wz,value, nil, nil) in the past and also sencommandtoserver with /createhorde2 etc etc for the mp version of the trigger
the thing is... i vaguely recal someons talking about a function to add zombies that made them roam to a coordinate in the map. Anyone recalls what it is? Been digging and trying to find it but no luck so far

limber oar
sudden depot
#

@pulsar heath is that really a thing? like what they did in fallout 3 sandbox setting were something can follow you from one end of the map to another?

pulsar heath
#

i had an old version of the mod before the mp that i used a function and im almost sure it was part of the game code to create a horde with X zombies and make them roam to a point in the map

sudden depot
#

or is it just go to point A

pulsar heath
#

dont recall which

sudden depot
#

oh ok

pulsar heath
#

i need to find my backups...

#

also trying to make it so that i can create a zombie with the viewer name using
createZombie(float x, float y, float z, SurvivorDesc desc, int palette, IsoDirections dir)

sudden depot
#

i had that idea today as well a mod that made all zombies from all over the map work there way over to louisville kind of like there being drawn to were ther food is

#

i mean think about it any zombie moive that has a wall with a gate there always huge hordes just sitting out side it trying to get out

wide oar
#

made my outfits and assigned them in the table, should be good now

pulsar heath
#

found it

#

static void
createHordeFromTo(float spawnX, float spawnY, float targetX, float targetY, int count)

wide oar
#

If i spawn my clothes in ingame its fine, but when i load the outfit with the items GUIDS only the underneath clothes spawns (like a tshirt and stuff that i set) but the jacket and bandana dont

pulsar heath
#

bad joke: maybe it has a nudist trait?

sour island
#

testing a new idea on EHE's workshop page:

#

I'll let you guys know how it goes

limber oar
pulsar heath
#

@sour island just one thing... is the -debug still available on EHE ?

limber oar
sour island
pulsar heath
#

my brain is melted

pulsar heath
#

can i still trigger events mannualy is what i meant

sour island
#

Yes it's in the debug panel - just a bit hard to find -- I put them under general debuggers

#

The page is test

pulsar heath
#

thats why i couldnt see it

#

thx 🙂

sour island
#

With my redux of AUD I'm hoping to make the debug menu clearer to use

#

Haven't had a chance to merge the two yet

pulsar heath
#

it aint broken dont fix it 🙂 still amazed how your mod is not part of the base game already

#

one of the few that since i got it, cant play without it

wide oar
sour island
#

The plans for helicopters will involve NPCs (from what I heard)

#

Probably a totally different experience to what EHE provides

pulsar heath
#

im trying to add survivor npc spawning to my mod as well... but its ... laggy as hell no matter how i try it

limber oar
wide oar
#

does the probability line in clothing.xml mean, if you set it to 100, 100% of zombies will spawn with it? or its the chance that all of those items will be in the outfit if a zombie spawns with it?

limber oar
#

The latter

wide oar
#

phew

limber oar
#

By default everything is assumed to have a prob of 100

#

So, every time that outfit is loaded, that item will be present

wide oar
#

btw should my bandana.xml have the same guid as it does in fileguidtable?

limber oar
#

You can use probability to add dynamism without needing to make a billion outfits, e.g. have a 30% chance for zombies wearing that outfit to be wearing a wristwatch, or glasses, or randomly choose from a bunch of different styles of socks/stockings/etc. for them to wear

limber oar
#

So:
clothing.xml - GUID1
fileGuidTable - GUID1
bandana.xml - GUID2

wide oar
#

okay, makes sense ^.^

#

<!--Hoodie-->
<m_items>
<probability>0.3</probability>
<itemGUID>30503c5d-b833-4b4d-af33-d46bf67e9186</itemGUID>
<!--Hoodie Up-->
<subItems>
<itemGUID>b8610c9f-d53c-4217-901b-1d26fae6c9d1</itemGUID>
</subItems>
</m_items>
<!--T-Shirt-->
<m_items>
<itemGUID>d16201b6-43e4-405c-b990-1d36ce901b94</itemGUID>
</m_items>
<!--Bandana-->
<m_items>
<itemGUID>081d4e0f-d4ee-4fd6-bc84-74b87c27b3cf</itemGUID>
</m_items>

#

clothing.xml

plucky sluice
#

Hi guys, is there a way to rotate an UIElement like drawRect or scale the DrawTextureAngle one?

I'm trying to replicate the arrow that show up when you forage and there something around, the addPlayerHomingPoint one.

I tried using the same system. But the issue is that it doesn't accept a Z axis and only work right on the first floor. Once you climb some stair it always point to the bottom of the stair.

I tried drawRect which I can scale, so I can make it smaller when you zoom out. But I can't find a way to rotate it.

I can rotate the DrawTextureAngle one, but I can't scale it down when you zoom out so it look giant when zoomed out. Can probably use this anyway but wondering if there's a way to fix either problem lol

wide oar
#

<fileGuidTable>
<files>
<path>media/clothing/clothingItems/sUnknownTrenchcoat.xml</path>
<guid>b8610c9f-d53c-4217-901b-1d26fae6c9d1</guid>
</files>

<files>
    <path>media/clothing/clothingItems/sUnknownTrenchcoatDown.xml</path>
    <guid>30503c5d-b833-4b4d-af33-d46bf67e9186</guid>
</files>

<files>
    <path>media/clothing/clothingItems/sUnknownBandana.xml</path>
    <guid>081d4e0f-d4ee-4fd6-bc84-74b87c27b3cf</guid>
</files>
#

in those two files they share the same GUID but the bandana wont spawn in outfits, i wonder if its due to rng

limber oar
wide oar
#

Yeah

limber oar
#

It shouldn't be RNG because the bandana has no probability set, which means it has a 100% chance of appearing

wide oar
#

hmm

#

oh well

#

at least the trenchcoat spawns in

#

how would i make a crafting recipe for the bandana, so someone could craft it?

#

lets say the recipe calls for one bandana (mask), and tailoring level 1

limber oar
#

I haven't done recipes myself but the zomboid modding guide has a good overview IIRC

wide oar
#

oh shit

#

ty

dull moss
#

Pls someone help me with tables bullshit

#
local function ThinOutCellList(lastCheckedKey)
    local player = getPlayer();
    player:getModData().ExplorerTrait = player:getModData().ExplorerTrait or {};
    local ExplorerTraitData = player:getModData().ExplorerTrait;
    local lowestExplored = lastCheckedKey;
    for key in pairs(ExplorerTraitData.Cell) do
        if #ExplorerTraitData.Cell[key].ExploredTiles < #ExplorerTraitData.Cell[lowestExplored].ExploredTiles then
            lowestExplored = key;
        end
    end
    print("DET: Lowest explored cells are in cell with key "..lowestExplored..", cells in it: "..#ExplorerTraitData.Cell[lowestExplored].ExploredTiles);
    table.remove(ExplorerTraitData.Cell, table.indexOf(ExplorerTraitData.Cell, lowestExplored));
end
#

im trying to remove an entry in table

#

ExplorerTraitData.Cell[lowestExplored] = nil didnt work

calm depot
#

what kind of table is it

#

is it sequential from 1 to N, or just arbitrary keys?

dull moss
#
    player:getModData().ExplorerTrait = player:getModData().ExplorerTrait or {};
    local ExplorerTraitData = player:getModData().ExplorerTrait;
    ExplorerTraitData.Cell[cellKey] = {};
    ExplorerTraitData.Cell[cellKey].ExploredTiles = {};
    ExplorerTraitData.Cell[cellKey].IsExplored = false;```
#

not sequential

calm depot
#

then t[k] = nil is the only way

dull moss
#

key is generated by using math stuff so each key is unique

#

well i tried

calm depot
#

you'll need to elaborate as to what "didn't work" means

dull moss
#

1sec

calm depot
#

if you set a key to nil in a table, you absolutely will not see it when iterating the table with pairs()

#

this is a behaviour that's fundamental to lua

dull moss
#
local function ThinOutCellList(lastCheckedKey)
    local player = getPlayer();
    player:getModData().ExplorerTrait = player:getModData().ExplorerTrait or {};
    local ExplorerTraitData = player:getModData().ExplorerTrait;
    local lowestExplored = lastCheckedKey;
    for key in pairs(ExplorerTraitData.Cell) do
        if #ExplorerTraitData.Cell[key].ExploredTiles < #ExplorerTraitData.Cell[lowestExplored].ExploredTiles then
            lowestExplored = key;
        end
    end
    print("DET: Lowest explored cells are in cell with key "..lowestExplored..", cells in it: "..#ExplorerTraitData.Cell[lowestExplored].ExploredTiles);
    ExplorerTraitData.Cell[lowestExplored] = nil
end

local function ETDataDump()
    local player = getPlayer();
    player:getModData().ExplorerTrait = player:getModData().ExplorerTrait or {};
    local ExplorerTraitData = player:getModData().ExplorerTrait;
    local totalCells = 0;
    local totalTiles = 0;
    local lastCheckedKey = 0;
    for key in pairs(ExplorerTraitData.Cell) do
        totalCells = totalCells + 1;
        totalTiles = totalTiles + #ExplorerTraitData.Cell[key].ExploredTiles;
        lastCheckedKey = key;
        --print("Cell #"..key.." has "..#ExplorerTraitData.Cell[key].ExploredTiles.." explored tiles");
    end
    print("DET: Data has total of "..totalCells.." cells that contain in total "..totalTiles.." explored tiles");
    if totalCells > 10 then ThinOutCellList(lastCheckedKey) end
end

bot func is run every 10 min, even after i got printout that "DET: Lowest explored cells are in cell with key ...",
print("DET: Data has total of "..totalCells.." cells that contain in total "..totalTiles.." explored tiles"); kept returning that I still have 12 cells

vast nacelle
#

for key in pairs(ExplorerTraitData.Cell) do
Does this work if you don't define an actual set of pairs?
I've only ever seen "key, _" used when you only care about one of the items in a pair.

calm depot
#

yes, it works

dull moss
#

with code provided higher up

#

as you see it runs print before ExplorerTraitData.Cell[lowestExplored] = nil

#

but on next print it still says it got 12 cells

calm depot
#

@dull moss print() both the ExplorerTraitData and ExplorerTraitData.Cell

#

you will get a string that looks something like table-0x12345678

#

across multiple calls, that number should remain the same

#

if it doesn't you are receiving a copy of the table

#

(and consequently, things don't work because you're modifying a copy)

#

the only other thing that springs to mind is that the table has a metamethod that handles indexing

dull moss
#
LOG  : General     , 1673493578434> ExplorerTraitData.Cell in ETDataDump: table 0x1818656612
LOG  : General     , 1673493578434> DET: Data has total of 12 cells that contain in total 23506 explored tiles
LOG  : General     , 1673493578435> ExplorerTraitData in ThinOutCellList: table 0x710572715
LOG  : General     , 1673493578435> ExplorerTraitData.Cell in ThinOutCellList: table 0x1818656612
LOG  : General     , 1673493578435> DET: Lowest explored cells are in cell with key 2961, cells in it: 504```
#

same numbers

#

god i fucking hate tables

#

with every fiber of my soul

#

OH

#

WAIT

#

I might be r-word

calm depot
#

are you sure that lowestExplored is actually being set to something inside that for loop and it's not just failing to match anything at all so it always sets exactly the same thing to nil every time?

dull moss
#

yea i was r-word

#

I was sitting on the edge of the cell

#

and i was adding it back to the list

#

so it kept showing that its 12

calm depot
#

heh

dull moss
#

cuz it kept adding it back

#

^ me irl

calm depot
#

solved in 10 minutes, worth.

dull moss
#

finally i am free to sleep

#

also nice pfp

#

pd2 gut

calm depot
#

heh

#

it's actually me

dull moss
#

looking very sexy, 10/10

#

anywya i go slep

calm depot
#

it's from a promo shot with Almir

#

g'nite

dull moss
calm depot
#

old timers will remember Crimefest

pulsar heath
#

TrollTheStreamer = { "Base.Generator", "Base.LogStacks4", "Base.CorpseMale", "Base.CorpseFemale" }
anyone has any suggestion to what other item i can add to troll the streamer?

#

maybe filling the inventory with toilet paper would be a good way to troll someone

undone elbow
#

Seems I fixed it

calm depot
#

a generator and logs have uses, spawn useless stuff

#

of course, if you really want to troll them, intercept door interactions and make them randomly do nothing

#

and occasionally, instantly interact with the door twice

pulsar heath
#

that would make killing the streamer to easy

#

im picking stuff that just makes the char heavy so a well placed generator in the invetnory or log stack = death

#

with the right timming, but due to the delay in the streaem plus the app and game... its not 100% sure the streamer will die

#

plus i dont have the know how

#

to use those kind of things

pulsar heath
#

i do want to add events to stall the car etc

#

so ill keep that in mind olipro... its a good idea to make the door of the car not open or something like that

#

dhert thats pretty good

dull moss
pulsar heath
#

its working already

#

just cleaning up the code

#

and then to read the EHE code and figure out a way to use those events without breaking the game

dull moss
#

Of it was jamming options together it wasn't fully working, wasn't it

pulsar heath
#

gonna "leech" from the EHE twitch events mod 😛

#

amazing... spawned 9999 zombies and the game didnt crashed...

#

turned into a slideshow but still working 😄

calm depot
#

I assume you're already making users spend their channel points to use the abilities

pulsar heath
#

yup

#

not saying its not a good idea.,.. ive thought about... but thats way way above what i can do in zomboid

#

it will take me a lot of time to figure those things out

#

flat tires, events like that would be nice but i have no idea how to implement them

calm depot
#

I did a Twitch trolls PAYDAY2 many years ago, lessons were learned 🙂

#

inverting controls is also a very mean, but not too bad one

#

doing anything that messes with the camera is evil

pulsar heath
#

the 1st version of the mod, when i tried it for the first time live on stream... i died over 80 times in a 6h stream

wide oar
#

so

#

tested on insane population

#

i found a zombie, roughly going past 500 zombies

#

with the trenchcoat and bandana ^.^

#

given that the stats are military jacket+ pretty much (with leather jacket material stuff) im hapyp with that, its supposed to be rare!

calm depot
#

sounds like we need a ZombZed (ZedZed?) to complement LootZed

pulsar heath
#

@calm depot thats way more than evil

#

😄

calm depot
#

temporary hearing loss would be a good one

#

play an explosion noise, then apply Deaf trait for X minutes

pulsar heath
#

taking notes

#

a basic one i did ( the 1st thing i got working )

calm depot
#

the explosion noise is just for the viewers, of course

pulsar heath
#

make the char scream

#

😄

#

there i was all stealthy... when someone spends 10k points to make me yell

#

dead in 10s 😄

calm depot
#

you can actually get quite a good amount of trolling mileage out of applying the negative traits temporarily

pulsar heath
#

hmmm thats something i would like to have

calm depot
#

silently gaining clumsy can easily cause you an injury

pulsar heath
#

can you give help me with that?

#

just point me in the right direction if you can with some example code and i can take it from there

calm depot
#

sure, but it'll have to be tomorrow because it's 4am here and I'm turning in 🙂

pulsar heath
#

4am here as well

calm depot
#

I'd also recommend the More Traits mod

pulsar heath
#

no hurry with that... take your time

#

im using the more traits mod 🙂

#

cant play without it... it adds a lot more diversity to the game

calm depot
#

ah, lots of opportunity then

#

also, having some "nice" modifiers are fun; not all of your viewers will want to hinder

pulsar heath
#

yeah thats why i have both the good gift ( food, items, etc, all random )

#

and the trojan one ( heavy crap )

#

also with ehe i have the really bad heli or a less bad with the airdrops

#

less bad since it still calls a shit ton of zombies due to the noise

calm depot
#

cinderella pumpkin: a humvee spawns, but you can only use it for 20 minutes before it despawns again

vast nacelle
#

Is there anything I need to do to get
"FireMode = Auto,
FireModePossibilities = Auto/Single,"
to work on a new type of gun? Does it only work on Rifle-type guns?
I added the FIreMode properties to a pistol I intend to be capable of full-auto but both modes fire at the same rate.
Edit: Bleh. Guess I need my own anim xmls to support fire select on handguns

pulsar heath
#

youre full of good ideas, still taking notes 😄

calm depot
#

Guns: X minutes of unlimited ammo

#

And the corollary... Guns jam more regularly

pulsar heath
#

that i already have an idea of how to do

#

simple code... the interactions with doors and stuff no clue what so ever

calm depot
#

Ping me tomorrow, I need to sleep before the cogs in my brain start spinning too fast thinking about this 😄

pulsar heath
#

ok, cya tomorrow then. Ill give you a "shout out"

ancient grail
humble oriole
#

Getting close hyperkitty dancingduck hyperkitty CatJam horseAlert

pulsar heath
#

it works time to bed... will add some more stuff tomorrow
https://youtu.be/haDaU1TD_nI

The base core of the mod is done. Now need to add the Air Events and the alpha will be ready for public release and testing. Hopefully i will be able to add more events ( car events: flat tire, stall engine, etc ) before the release. And after that keep adding more diversity to the events, both positive and negative. Thanks for watching.

▶ Play video
tranquil reef
#

Also goodnight

tawdry moss
drifting ore
#

Someone make naked zombie mod pls

dark wedge
ancient grail
#

how can i remove inventory context menu of stome items for players with certain traits... like for example totally remove the drink function for all alcohol

#

do i need to use scriptmanager or do i overwrite something on the onfillinventory?

vast nacelle
#

You'll probably want to add a function to "Events.OnFillInventoryObjectContextMenu" that does a check for your items and then call "context:removeOptionByName"

#

Or maybe, better yet, context:getOptionFromName, then set the option as unavailable so it can't be clicked and a tooltip explaining why it is unavailable (i.e. your trait)

high cloak
#

question, are these radio entries written by hand..? it's this same sequence of messages pasted again one after another for different times, and that seems so tedious i'm suspicious maybe there's some tool used for editing these files? idk, i'm only just taking an interest in modding so idk if this is major noob question or not lol

drifting ore
#

trying to use getPlayerFaction("username") to return what the faction is but every time I type a command either that one or similar in the lua console in game, I get the error:

Object tried to call nil in console
file: objects.lua line 1#

Looked online to see what causes this, even in discord, only someone saying they love this kind of error since it's easy 🤣

fast galleon
dark wedge
drifting ore
rain shard
#

Hey question, is there a function out there that could output to the chat box text from an object like a CD from a CD player? So whatever script was playing on the CD would also out put to the chat box? I assume it would utilize processSayMessage

fast galleon
#

@ "whatever that is"
seems like a fault in design
it should be in this order

a. what is X
b. how to use X

not in reverse

drifting ore
#

I have no idea what the purpose of self. is and I gotta admit am a bit ashmed of that

#

Is it to avoid putting large amount of code inside a lua file?

#

So you just use self. to make it simpler?

#

When referencing I mean

dark wedge
#

idk if you're familiar with other programming languages, but in others it is the same as: this

wide oar
#

question

#

would it be possible to make a mod where your screen blacks out when you die? like after a certain amount of seconds

#

it occurred to me with the tlou death sound mod i made i could also figure out how to black out the screen after a certain interval (after the sound ends, ig, black out instantly)

#

but keep the ui and stuff obv

tardy wren
#

Probably, yeah

#

All the UI is done with lua so it's modifiable

kindred current
#

hmm

#

seems the require condition didn't work to add the traits to the modded profession

drifting ore
#
function showMoney:prerender()
ISPanel.prerender(self);
self:drawText("Player has 

In this case, is self: used basically like you could use showMoney:drawText? Or am I missing something? Was reading on the OOP but got confused lol

feral cave
#

Project zomboid is lua?

kindred current
#

and java too

feral cave
#

Ah idk java.

fast galleon
drifting ore
#

I'm trying to work out how to get an element from the UI and I think learning this self thing is key

fast galleon
#

it's an instance of showMoney

drifting ore
#

I might have confused myself as to what an "instance" actually is, I figured it was whatever command is put after the :

fast galleon
drifting ore
#

Yes

#
    self:addChild(self.name);
#

If that's what you're asking

fast galleon
#

there must something like self.box = ... ?

drifting ore
#

hang on lemme check this tutorial I was following, might've missed something

#
    self.name = ISTextEntryBox:new("", 25, 60, 150, btnHgt);
    self.name:initialise();
    self.name:instantiate();
    self:addChild(self.name);

This is how it looks like in the tutorial

fast galleon
#

I don't remember exactly how addChild works

drifting ore
#

Gotcha

fast galleon
#

should have figured that out, myself

drifting ore
#

So whenever I want to reference this textbox, I use self.name:getText() if I'm getting it right?

#

Nice! Thank you 🙂

#

So these objects if I can call them that, they transfer all around the entire code in that lua file? I can reference self.name from wherever?

#

In the UI.lua that is

#

As long as the main function is for example the one it was created in

#

or an extension of that function

#

If I can word it better...

Can I use it in this function

function showMoney:onOptionMouseDown(button, x, y)

As well as in the function it was created in which is

function showMoney:create()
sour island
#

UI elements are globals that are also template objects. UI.instance is a variable to the original template object - an infinite number of UI elements can be created from the template using new()-- if you don't want that to happen you set the instance to one and clear it before creating/setting a new one.

ancient grail
#

Idk if my terminologies are correct but its something like that

sour island
#

Children are other UI elements that can be attached visually

#

They also change how they behave too - as you can't interact with something being rendered beyond the parent

drifting ore
#

So buttons and alike are children

sour island
#

They don't have to be, but generally yes

#

It's just more convenient to attach buttons and backgrounds to 1 IS-Panel (window) and the hide/close that one window

drifting ore
#

Looks like the code I added crashed the entire thing, which is disappointing. Must've missed something yall said. I think my issue is that I still don't understand how exactly to call it from within other instances of the UI that are being currently enabled

sour island
#

Instances are not tracked inherently

drifting ore
#

Sorry, bad wording

#
function showMoney:onOptionMouseDown(button, x, y)
    if button.internal == "CANCEL" then
    self:setVisible(false);
        self:removeFromUIManager();
    end
    if button.internal == "FINE" then
        if not self.infoRichText then
            -- when clicked
            local uponClickedAmountIs = self.name:ISTextEntryBox:getText()
            print("The text we've put in is " .. uponClickedAmountIs)

Here's what I mean. There's other selfs in here so I assume I cannot use self.name as well

sour island
#

When you add children you can define variables to the parent

drifting ore
#

namely self.infoRichText

sour island
#

Everything in Lua is a table - even these

drifting ore
#

Oh so infoRichText and "name" are the keys that hold the information?

sour island
#

ParentUI.myButton = button:new()
ParentUI.addChild(ParentUI.myButton)

#

Now you can get the button whenever you want

#

And use button's functions

#

Self in this case is the parent UI element

#

I'm not sure what inforichtext is

drifting ore
#
function showMoney:create()
self:addChild(self.cancel);

Copied the relevant information to what you're saying. So in this case, the only difference I see is that in this code they're using : instead of . to addChild

sour island
#

You have to use : in most cases

drifting ore
#

self.cancel translates to ParentUI.cancel I think

sour island
#

You use ParentUI.button in the create portion

#

And anytime referring to an instanced' children as those are variables tied to the instance

#

Talking about "." Specifically

drifting ore
#

so let me see if I got it right this time, how I would go about making a button for example

#

I create the ParentUI
create the button via ParentUI.button = ISButton:new aka self.button = ISButton:new
add that button as a child element using self:addChild(self.button)

sour island
#

You use : for functions as you don't want the original UI element but it's copy you've created instead

#

That is how you create a button

drifting ore
#

So you're copying the base of the original UI element that created everything, modify it and define what it now is

#

So it's originally the panel, then you get it copy it and turn it into a button?

sour island
#

Anytime new() is used it's copying the type of object and creating a new instance

#

You can change stuff using the functions provided -- you can also define new types with special behaviors using old types

#

UI can be a bit tedious to get used to -- but it's all copying tables/templates at the end of the day

fast galleon
#

something else to keep in mind, all those functions don't call themselves. Here it will be UIManager calling them, for the object you give it.

sour island
#

You don't have to call UI manager, unless I'm misunderstanding

fast galleon
#

which is where the self comes from

fast galleon
sour island
#

Oh those

drifting ore
#

I think, after reading all this I might have discovered what my problem is.

I'm using

local uponClickedAmountIs = self.name:ISTextEntryBox:getText()

This gives me in translation "istextentryboxnew:isTextentrybox:getText()

So that is the error. I should use uponClickedAmountIs = self.name:getText()

#

I apologize if I cost ya'll some brain cells reading that 😂

sour island
#
function storeWindow:initialise() 
     ISPanelJoypad.initialise(self) 
     local btnWid = 100 
     local btnHgt = 25 
     local padBottom = 10 
     local listWidh = (self.width / 2)-15 
     local listHeight = (self.height*0.6) 
  
     local storeName = "new store" 
     if self.storeObj then storeName = self.storeObj.name end 
  
     self.manageStoreName = ISTextEntryBox:new(storeName, 1010self.width-20, btnHgt) 
     self.manageStoreName:initialise() 
     self.manageStoreName:instantiate() 
     self.manageStoreName.font = UIFont.Medium 
     self.manageStoreName.borderColor = { r = 1, g = 0, b = 0, a = 0.7 } 
     self:addChild(self.manageStoreName)
#

This is a snippet from my shops code - the shop window is a customized ISpanel object

#

You have to call initialize and instantiate for each child too

#

At least that's what everyone seems to be doing

fast galleon
#

Let me try rephrase
self is the table you use the command on

obj:addToUIManager()
sour island
#
    local manageStockButtonsX = (self.storeStockData.x+self.storeStockData.width) 
     local manageStockButtonsY = self.storeStockData.y+self.storeStockData.height 
     self.addStockBtn = ISButton:new(manageStockButtonsX-22, manageStockButtonsY+5, btnHgt-3, btnHgt-3"+"self, storeWindow.onClick) 
     self.addStockBtn.internal = "ADDSTOCK" 
     self.addStockBtn:initialise() 
     self.addStockBtn:instantiate() 
     self:addChild(self.addStockBtn```
drifting ore
#

Ooo I got it now, on the tutorial they added a section on how to use the command to get the text. So it is, like I painfully discovered with yalls help, self.name.getInternalText() and not self.name:ISTextEntryBox:getText()

#

I'm gonna spend some quality time studying this now and re-reading what yall posted, thank you very much ❤️

#

edited

sour island
#
function storeWindow:onBrowse(storeObj, mapObj) 
     if storeWindow.instance and storeWindow.instance:isVisible() then 
         storeWindow.instance:setVisible(false) 
         storeWindow.instance:removeFromUIManager() 
     end

    local ui = storeWindow:new(50,50,555,555, getPlayer(), storeObj, mapObj) 
     ui:initialise() 
     ui:addToUIManager() 
 end
#

This is for opening the window

#

And what polt was mentioning

#

The only time I've used the main windows' instance is when I needed to catch the old one and close it first or close it when they get too far away etc

sour island
#

Self.childKey:function()

#

Inside the function self refers to the child

#

You have to set the childKey to self in create -- self in create would be a copy of the template

#
function storeWindow:new(x, y, width, height, player, storeObj, mapObj) 
     local o = {} 
     x = getCore():getScreenWidth() / 2 - (width / 2) 
     y = getCore():getScreenHeight() / 2 - (height / 2) 
     o = ISPanelJoypad:new(x, y, width, height) 
     setmetatable(o, self) 
     self.__index = self 
     player:StopAllActionQueue() 
     o.borderColor = {r=0.4, g=0.4, b=0.4, a=1} 
     o.backgroundColor = {r=0, g=0, b=0, a=0.8} 
     o.listHeaderColor = {r=0.4, g=0.4, b=0.4, a=0.3} 
     o.width = width 
     o.height = height 
     o.player = player 
     o.mapObject = mapObj 
     o.storeObj = storeObj 
     o.moveWithMouse = true 
     o.selectedItem = nil 
     o.pendingRequest = false 
     storeWindow.instance = o 
     return o 
 end
#

One last snippet of the windows' new

#

Where I set instance

#

UI is something I think could use an ingame editor

#

Luckily using AUD (a mod) you can reload Lua in game - not really functional in most cases - but works great for UI if you write it with that in mind

#

Rebooting the game everytime sucks

#

I recommend trying AUD out and using the Lua reloader

#

You can even close the error screen and reload

#

To keep trying stuff

drifting ore
#

Will keep it in mind, still struggling to get this text out of the box 😅

sour island
#

I mean for this purpose - reloading Lua would usually be a nightmare depending on the situation -- creating new instances of UI would be ideal

#

If you're trying to test stuff out get it so you don't have to keep rebooting the game

drifting ore
#

Yooo I got it working!

#

😄

sour island
#

Just click the button with the little [ >_ ] - select your file and click reload

drifting ore
#

The problem was I was using 2 self. inside of a button action onMouseDown or w/e it's called

#

one for the self.name and there was another self.richtextbox or something

pulsar heath
#

just got here and my brain already hurts just by reading the chat in the last 10m...

#

was thinking of having no configs for my mod ingame... but i guess i should at least add a way to change the items it can send to the streamer...

drifting ore
#

😮

pulsar heath
#

now the question is... and i want an opinion
should just allow them to write the item name in a text box in the config or think everyone is lazy and just thrown in a combo box for each option that auto populates with the objects it can use?

drifting ore
#

as a "programmer" I would use an item text bot and type in the name

#

as a "person" I would use a combo box

#

😂

#

but I'm more of the former

pulsar heath
#

yeah... but if i use a combobox the dm's will keep coming asking to add this or that... if i use a textbox to input the item name "base.something" format nobody will ask me to add this item or that item bla bla bla

#

so its kinda... like... wtf should i do...

drifting ore
#

I'd go with the latter in that case 😄

#

for now at least

#

maybe add it down the line if you feel generous 😄

pulsar heath
#

or just both ... a combobox with the existing items by default and a text input to add the ones you want to the dictionary?!

#

hmmm

#

i hate working with UI ...

drifting ore
#

lol yeah tell me about it this is worse than the sendclient thing I was doing 🤣

#

I can do it faster but it's more frustrating for some reason

#

also speaking of typos m3ss, I just looked for so long why my code wasn't working then realized I used => instead of >=

#

🤣

pulsar heath
#

..........

#

thats almost at my level of typos almost...

#

my brain was so melted yesterday that i tried to convert a string to number by doing tonumber.VARNAME

#

and was raging wtf why doesnt this work...

drifting ore
#

bro what the f

#

I literally just typed that in

#

that doesn't work???

pulsar heath
#

no its a function

drifting ore
#

you are stalking me fr

pulsar heath
#

so it has to be tonumber(var)

drifting ore
#

what's the diff between var and varname

pulsar heath
#

none...

#

just a placeholder for the var itself

#

i tend to called them something that indicates what they hold or what they are for

drifting ore
#

god damn I love this shit it's so hilarious 🤣

pulsar heath
#

to call*

#
local player = getSpecificPlayer(0)
local inv = player:getInventory()
    if whatkind == 1 then
        Helpmeitem = ZombRand(1,13)
        inv:AddItem(HelpTheStreamer[Helpmeitem])
    elseif whatkind == 2 then
-----trojan
        Helpmeitem = ZombRand(1,4)
        inv:AddItem(TrollTheStreamer[Helpmeitem])
    elseif whatkind == 3 then
        Helpmeitem = ZombRand(1,4)
        inv:AddItem(TrollTheStreamer[Helpmeitem])
        Helpmeitem = ZombRand(1,13)
        inv:AddItem(HelpTheStreamer[Helpmeitem])
        end
end
#

easier to read that way and to follow the code logic

#

also i always spam a lot of prints when developing the mod

    if EventsTable then     
        if EventsTable["zombies"] and EventsTable["zombies"] == "true" then
            print("print("------------=Twitch Events: alpha v0.0.1=------------"")
            print("------------=zombies from twitch=------------")
            getPlayer():Say(EventsTable["viewer"] .. " sent " ..EventsTable["zedquant"] .. " zombies")
            local wx, wy, wz = SpawnLoc();
            createHordeFromTo(wx, wy, getPlayer():getX(), getPlayer():getY(), tonumber(EventsTable["zedquant"]))
        end
        if EventsTable["gifts"] and tonumber(EventsTable["gifts"]) > 0 then
           print("print("------------=Twitch Events: alpha v0.0.1=------------"")
           print("------------=gift from twitch=------------")
           getPlayer():Say(EventsTable["viewer"] .. " sent me a gift")
           GiftItems(tonumber(EventsTable["gifts"]))
        end
        if EventsTable["helicopter"] and tonumber(EventsTable["helicopter"]) > 0 then
           print("print("------------=Twitch Events: alpha v0.0.1=------------"")
           print("------------=heli from twitch=------------")
           getPlayer():Say(EventsTable["viewer"] .. " sent heli code " ..EventsTable["helicopter"])
        end
    else
        print("print("------------=Twitch Events: alpha v0.0.1=------------"")
           print("------------=Event Table not defined=------------")
    end
end
drifting ore
#

so if I do local textReceived = ---value how we obtained it

I need to put tonumber(textReceived) and not directly how we got the value in the first place?

pulsar heath
#

its up to you how you call it, anything that makes it easier to read is a win on my book

#

or what you call it i meant

drifting ore
#

Oh I just realized what you meant

#

you used tonumber. instead of tonumber()

pulsar heath
#

yup

#

was working on vbnet at the same time and got mixed with adding classes and call to those classes in the app

#

and kinda called the sub in the class i have in the app in lua...

#

like... hello... wrong place...

fast galleon
#

a filter box that grab the item from scriptmanager?

#

autoloot uses UI with all items btw.

#

@pulsar heath

pulsar heath
#

hmmm

#

thats a pretty good way of doing things tbh

#

ill just get the item list and allow the user to pick what they want to in both "rewards"

ancient grail
zinc pilot
#

Hello, is there a way to share modData between clients?

molten cobalt
#

Hey all, is there anyway I can do an if to check if the player is in a vehicle or not, and then do X if true?

drifting ore
#

Oh yeah, I found that thing in a timedaction lua file online

#
if self.character:isSeatedInVehicle() then
#

Hi guys, any articles that can help me with Distribution for new items?

#

Just replace this self.character with what you need, the main thing you need probably is isSeatedInVehicle()

pulsar heath
zinc pilot
drifting ore
pulsar heath
#

ill have to agree with you on that one 🙂

ancient grail
#

unless you use global moddata

zinc pilot
thick karma
zinc pilot
#

Client 1 asks Client 2 for some stuff in getModData().MyMod
Client 1 will get an UI with some data from Client2

thick karma
#

You could in theory send the whole table, yes. That would work

zinc pilot
#

is there any decent documentation about server commands?

#

I haven't been able to find anything useful other than other mods

thick karma
#

Send player:getModData().MyModTable as the arguments field

#

@zinc pilot

zinc pilot
#

I got that, but I'm not sure how I would actually receive that data

drifting ore
#

I can try and help you with server commands

thick karma
#

Clients send client commands and listen for server commands. Servers do the opposite.

drifting ore
#

I spent 3-4 days learning them and a good amount of hours

#

Blood sweat and tears just to get one working 😂

ancient grail
drifting ore
#

Obtain another players inventory item count (money) and send it to the original player

zinc pilot
#

if you could share some of your code you'd be a livesaver

dull moss
#

Yo if i got an existing table i can add new values to them, right? What I mean is i got this table

    local player = getPlayer();
    player:getModData().ExplorerTrait = player:getModData().ExplorerTrait or {};
    local ExplorerTraitData = player:getModData().ExplorerTrait;
    ExplorerTraitData.Cell[cellKey] = {};
    ExplorerTraitData.Cell[cellKey].ExploredTiles = {};
    ExplorerTraitData.Cell[cellKey].IsExplored = false;

and I want to add new entry

ExplorerTraitData.Cell[cellKey].VisitedOrder = ExplorerTraitData.VisitedOrder;

I can do it with something like this, right?

        ExplorerTraitData.VisitedOrder = ExplorerTraitData.VisitedOrder or 1;
        if ExplorerTraitData.VisitedOrder = 1 then -- applying visited order through out existing moddata
            for key in pairs(ExplorerTraitData.Cell) do
                if ExplorerTraitData.Cell[key].VisitedOrder == nil then
                    ExplorerTraitData.Cell[key].VisitedOrder = ExplorerTraitData.VisitedOrder
                    ExplorerTraitData.VisitedOrder = ExplorerTraitData.VisitedOrder + 1;
                    print("Cell #"..key.." didnt have visited order field, now has "..ExplorerTraitData.Cell[key].VisitedOrder);
                end
            end
        end
zinc pilot
#

just to know if I'm on the right track

ancient grail
#

Damn
Pingpong

ClientA asks server
Server asks clientB
Server answers clientA

drifting ore
thick karma
#

You need this function in server file

drifting ore
#

It's mostly for personal use so I can go back and look what I missed

#

I added a SHIT TON of comments inside to explain everything I did so apologies in advance if it looks crowded

zinc pilot
#

don't worry, it's a big help

thick karma
pulsar heath
#

im gonna yonk that link 😄

#

after what you've been through making that stuff work... i rather read than suffer what went through

drifting ore
#

lol

pulsar heath
#

what you*

thick karma
#

@zinc pilot

zinc pilot
#

correct me if I'm wrong (kinda new to lua), but isn't a bit risky having OnClientCommand as a function name?

thick karma
#

If it's local no

zinc pilot
#

it's declared as Local though

#

alright, gotcha

ancient grail
drifting ore
#

Oh yeah I forgot to edit that

zinc pilot
#

I thought that wouldn't count to functions

drifting ore
#

Sorry my bad

#

But yeah someone told me as well to rename them

zinc pilot
#

it's not an error, it's a local function

#

it would work

drifting ore
#

So other mods don't overwrite it

zinc pilot
#

even if other mods have that same name

thick karma
#

I would personally never name any function with PascalCase like that... But to each their own haha

#

It does work

drifting ore
drifting ore
#

gonna add you as a friend so I don't forget

ancient grail
#

Nice

drifting ore
# thick karma It does work

I had no intention of keeping it that way, since I was using it as the only mod I was just like, yknow, just gonna fkin test it and see what happens 🤣

#

oh shit, pascal case is something else

#

nvm

#

🤣

thick karma
#

Haha not judging your code at all, just talking about wiki style. Zomboid does it sometimes too... I feel like someone whose language does not have capital letters coded a lot of PZ

drifting ore
#

Ooooh

#

Never thought about that tbh 😄

thick karma
#

I am only speculating but it really makes no sense why the capitalization conventions for functions vs classes / objects seem to be non-existent.

#

Unless maybe some of the devs are bilingual or something

zinc pilot
#

probably because of the old codebase

#

shit like that happens all the time

drifting ore
#

oh and Pao, just to explain that mod in a nutshell. Player right clicks other player (context file), that file sends the ID to server (only server file), server sends the player with that ID a request for his items (policeToolsClient file receives this command), that file sends it back to server (the item count), server sends it back to the client file (the result so the original player can have the values)

#

There's a lot of stuff mixed in between that code and I've been meaning to clean it up but I've been up till 2AM making it yesterday and had no time 🤣

zinc pilot
#

don't worry man, I think I've already got what I needed

drifting ore
#

Nice! 🙂

zinc pilot
#

I just suck at server\client stuff and needed a boost

thick karma
#

Good luck!

thick karma
#

Riiight lol they just only work when you want to capitalize a word unnecessarily?

#

And "unhappyness" (real game variable spelling to the new people) was because of a broken "i", I guess? 😂

ancient grail
calm depot
#

code formatting and linting should be part of your build pipeline

#

someone violates it? refuse to build.

thick karma
#

Exactly how I feel... But I think sometimes you take the people you have when you're indy and trying to make things happen on a budget.

drifting ore
thick karma
#

But yeah I personally wouldn't want to push code with inconsistent function naming into a game I made from scratch

#

Just a recipe for disaster.

calm depot
#

"build pipeline" is just a fancy phrase for "some script that validates, builds and packages your project"

ancient grail
#

Yeh so use Unhappyness like you are ment to

drifting ore
#

ahhh

#

what is linting?

calm depot
#

a programming language linter is something that runs basic style checks or tells you if you're using something deprecated

#

depending on the language, a linter might be relatively simple, or integrate a large amount of checking functionality

drifting ore
#

oh, that's cool, is it mostly uhh how do I say it

#

visual things it checks

#

or things that actually break functionality?

calm depot
#

that's more like code formatting, a linter will do stuff like tell you about vars you declared but never used

drifting ore
#

OH I LOVE THAT
I love that so much in other languages

#

I can clean up the code so easily when it greys out things

#

that I don't need 😂

calm depot
#

it also has an accompanying VSCode extension, if you happen to use that as your editor

drifting ore
#

I do in fact!

#

Gonna save that link, yoink

#

Hey while ya'll are here

#

If I do player:addItems(--item---, -50)

calm depot
#

oh, if you're already using vscode-lua then you have it

drifting ore
#

will it subtract those items or?

#

I can't figure out how to remove items by type (for example Money or Base.Money)

thick karma
#

Unlikely

calm depot
#

isn't there something like removeAllTypeRecurse

drifting ore
#

Was trying to find an extension of player: online to do it with but only found one I think

calm depot
#

pulls up IntelliJ

#

oh wait, you want to remove a specific quantity, not all, right?

drifting ore
#

Yeah

#

I mean I guess I could give it a variable and loop the remove command as many times as I need and just use removeItem

#

but I was wondering if there's a specific thing like there already is AddItems(item, int)

#

Just the wording I cannot figure out to actually find it, like what would they put as the opposite of Add

#

Even what you said before, recurse, I still have to google what that actually means 😂

calm depot
#

so, there is RemoveOneOf which takes a string

#

calling it in a loop 50 times will of course do the job 🙂

drifting ore
#

Yeah, gonna use that for now, seems like the best option

#

Ty for your help 🙂

calm depot
#

by default it will recurse

#

pass false as the second argument if you don't want that

drifting ore
#

oh removeOneOf will recurse by default?

#

Need that as well, since I'm checking the entire inventory so snakes can't hide their money from me >:)

#

It takes only one argument tho 😮

#

String, I can still pass in false?

calm depot
#

there are 2 overloads

#

you are looking at the single argument overload

#

which is just a wrapper for the other

fast galleon
#

would getting all items of a type and then doing something like inventory:remove(item) be faster or not?

calm depot
#

it would be faster, yes, but that is going to nuke everything, which he doesn't want to do

drifting ore
#

lmao "nuke"

#

😄

calm depot
#

well, for some value of faster - the true answer is "it depends"

fast galleon
#

obviously you'd do a loop with a set number, not all the items

calm depot
#

letting java do the heavy lifting is generally faster, but of course, there is a point where, if the user had many items, removing a few of them in lua is going to be faster than removing all of them in java

#

oh, sorry, I misread it as removeall

fast galleon
#

he's talking about money, that can become a lot of items I imagine.

calm depot
#

he needs to recurse so removeoneof is optimal

fast galleon
#

👍

calm depot
#

in actuality though, the code for both is the same in Java

#

TIS should really clean it up so RemoveOneOf just calls Remove and recurses 🙂

kindred current
#

hmm I really can't seem to get my traits mod to work and apply to the profession

#

Im starting to feel like I have to make an edit which is not at all what I want to do

#

here's the code

calm depot
#

some people have sight problems and use a screen reader. don't post text as a screenshot, use something like pastebin.com

#

also, even if you don't have sight problems, it literally makes everything harder when you have posted text as a screenshot

kindred current
#

alright

#

I'll be right back and send it as a pastebin link

drifting ore
#

good shout, I'll start doing that as well in case I have to send big chunks of code

#

thanks 👍

kindred current
vast nacelle
drifting ore
#

I am so close to finishing my mod, just have to make the player receive the money he fines the other player and am done. Also gotta bug in the for loop, it's supposed to go to a min value of 40 say but it goes 1 more down

#

Just gonna put +1 in the minValue and be done with that 🤣

sour island
#

You'd probably have to tackle commands then - if you haven't already

#

Your mod touches on some difficult/tedious aspects 😅

drifting ore
#

if I declare a variable at the very top of my lua file, then a local function in that lua file edits that variable, will the global variable at the top be updated?

sour island
#

Yes unless you've declared a local with the same name ofcourse

#

If you use an IDE or anything with syntax coloring it should appear differently

drifting ore
#

using visual studio code rn

#

doesn't seem to change the color but I am colorblind so

sour island
#

You could probably rig it to Lua

drifting ore
#

ye someone posted a link that I was gonna check out

#

just was busy with this

sour island
#

I would've assumed it could identify the .Lua and do what it needed to - but you might have to download a plugin

#

I got my first bug report on GitHub post wile-e-coyote'ing EHE's workshop page's comments

#

Guess it works 👍

#

For context:

#

This is a hyperlinked image

calm depot
#

hahahaha, I love it

sour island
#

I don't expect steam to add more features for workshop stuff and it was getting pretty awful.

#

I wonder if I can rig an image generation for updates

fast galleon
#

lol, now I see. Comments off, github on.

sour island
#

Like a visual changelog I can include above the comments or as an additional fake comment 🤔

#

GitHub has templates and issue tracking - by far better than endless comments and duplicate discussion pages

#
  • idk what they did but I get alerts for week old comments I've already seen
drifting stump
#

me open modding channel me like what me see

#

github for anything mod related is so much better than the workshop

sour island
#

Hello, real and smart user

drifting stump
#

been think thonking real hard in a way to make creating simpler without having to overwrite the new function and still integrate with documentation

sour island
#

You could make a soft create/new

#

ala ItemTweaker

drifting stump
#

what i want is to be able to document the parameters but at the same time not overwrite the function for every single ui

#

may have arrived at the solution

#

make ui specs

#

have a "class" defining the spec containing all the parameters and simply have the super class as the parameter for new

zinc pilot
#

@drifting ore thanks again, you saved me a lot of time. It works 😄

drifting ore
#

no worries chief, glad to help, lots of cigs smoked until I finally learnt it 😂

zinc pilot
#

been fixing The Only Cure since I started playing again and server side stuff was pretty much broken

drifting ore
#

I finally managed to edit the original mod to add a fine button, removing a set amount of items (money in this case) based on the input of the original client

#

All I have left to do now is give that money to the primary player and this mod is working as I intended.

pulsar heath
#

well was about to rage about creating a simple ui panel in the game, so i thought... i should go and chill and play a game or something for a bit... chose the wrong game now im ragin' about rng in hs 😄 and still no panel hahahahaha

drifting ore
#

lmaooo

#

haven't played hearthstone in a hot minute

pulsar heath
#

its still rng based not skill based so you didnt miss much

#

😄

drifting ore
#
playerInv:addItem("Money")

The one above is an error.
The one below is correct apparently.

playerInv:AddItem("Money")
#

I love this so much 😂

#

ladies and gentlemen, it is with great pleasure I can inform you that the mod is now working 😎

pulsar heath
#

myPanel = ISPanel:derive("myPanel")

local myPanel = ISPanel:new(10, 10, 300, 300)
myPanel:noBackground()

-- Create an image object
local myImage = ISButton:new(0, 0, 32, 32)
myImage:initialise()
myImage:setImage("path/to/image.png")
myPanel:addChild(myImage)

-- Create a text object
local myText = ISLabel:new(0, 40, 300, 20)
myText:initialise()
myText:setText("Some text")
myPanel:addChild(myText)

this should work right?

#

the path would be media\ui right?

#

nope... doesnt work

#

gonna read the docs again...

ruby urchin
pulsar heath
#

so to call an image... i forgot the gettexture bit

#

thanks 😄

ruby urchin
#

also you can see all usable functions here:
../media/lua/client/ISUI/ISButton.lua (for button)
and
../media/lua/client/ISUI/ISLabel.lua (for label text)

pulsar heath
#

thanks

drifting ore
#

if you define player = getPlayer() as local, does everything you use player for next also become local only? Like... player:getForname() --- will it also be local?

#

or is it its own thing

#

I once got the firstname_lastname of the player but have forgotten in the meantime, forname surname doesn't seem to cut it unfortunately

#

and there's so much to choose from, display name, username for example

#

thought those 2 would be the same thing lol

ruby urchin
#

yep, unless you assign it to a variable not local, also depend in what block of code are you using it

astral dune
#

locality is not transfered

local player = getPlayer() -- player is local
name = player:getForname() -- name is global
drifting ore
#

I think I found it, getFullName instead of getForname/Surname

pulsar heath
#

UI is not my thing... trully... im dumb as nail when it comes to this kind of thing...

require "ISUI/ISLabel"

local myPanel = ISPanel:new(10, 10, 300, 300)
myPanel:noBackground()

-- Create an image object
local myImage = ISButton:new(0, 0, 32, 32)
myImage:initialise()
myImage:setImage(getTexture("media/ui/cal80.png"))
myPanel:addChild(myImage)

-- Create a text object
local myText = ISLabel:new(0, 40, 300, 20)
myText:initialise()
myText:setName("Some text")
myPanel:addChild(myText)
myPanel:addToUIManager()```
drifting ore
#

I'd love to help you with the UI but I only know one guide I was using to make mine

#

maybe it could help you?

pulsar heath
#

sure, link please 🙂

drifting ore
pulsar heath
#

thank you

drifting ore
#

no prob : )

#

damn, this range on right clicking is huge I didn't even notice

#

I can click 2 players away and it'll find this man

#

lmfao

#

magic, fixed itself

#

gucci

dull moss
#

@undone elbow you're absolute GigaChad, thanks

#

can someone explain to me why this only works in game after i reload this lua file from debug?

local original_oneat_cigarettes = OnEat_Cigarettes;
function OnEat_Cigarettes(food, character, percent)
    print("ETW Logger: detected smoking");
    local modData = character:getModData().EvolvingTraitsWorld.SmokeSystem; -- SmokingAddiction MinutesSinceLastSmoke
    local timeSinceLastSmoke = character:getTimeSinceLastSmoke() * 60;
    --print("ETW Logger: timeSinceLastSmoke: "..timeSinceLastSmoke);
    --print("ETW Logger: modData.MinutesSinceLastSmoke: "..modData.MinutesSinceLastSmoke);
    local stress = character:getStats():getStress(); -- stress is 0-1
    local panic = character:getStats():getPanic(); -- 0-100
    local addictionGain = SBvars.SmokingAddictionMultiplier * 1 * (1 + stress) * (1 + panic / 100) * 1000 / (math.max(timeSinceLastSmoke, modData.MinutesSinceLastSmoke) + 100);
    modData.SmokingAddiction = math.min(SBvars.SmokerCounter * 2, modData.SmokingAddiction + addictionGain);
    --print("ETW Logger: addictionGain: "..addictionGain);
    --print("ETW Logger: modData.SmokingAddiction: "..modData.SmokingAddiction);
    modData.MinutesSinceLastSmoke = 0;
    original_oneat_cigarettes(food, character, percent);
end
fast galleon
dull moss
#

oh that'd explain it

#

um do I need to adjust anything besides moving this to server folder?

#

like what does getPlayer() retrun for example if its called in server lua

#

i dont have it in here but in general

#

cuz havent done a single server lua yet

#

works like a charm, thanks

drifting ore
dull moss
#

very crispy voice

pulsar heath
#

i give up

#

i hate ui so much

dull moss
pulsar heath
#

it stays as is the damn mod... if anyone wants something changed just code it

#

i only use the txt file anyway not my problem

#

it works as intended for myself

pulsar heath
#

gonna steal all the money from everyone on the server ahahahaha

#

well gonna work on the integration mod and ***k the stats mod, it will be updated when its broken

dull moss
#

Typical rogue player

pulsar heath
#

that mod could be used to make a police and criminals mod

#

and add pickpocketing

drifting ore
#

It's intended for a server I'm playing on that has police

pulsar heath
#

and stuff like that

drifting ore
#

They have literally no power over criminals and I wanted to change that

#

that's why I pulled all my hair out learning serversendclientwhatever

pulsar heath
#

if they have a gun and bullets they have power over them 😄

drifting ore
#

you'd be surprised

fast galleon
#

steal bottle caps, -reputation

pulsar heath
#

fallout 😄

#

dude... if feels so good when i actually am able to do what i want in the damn mod without going crazy... added air events, it works... at least the random bit

#

2 m typing... trying to do a damn customizable stats window the whole day... it works... i add something... it breaks... i correct it... it works... than i add something or change something it breaks... damn loop of errors and cursing... one step forward 2 steps back. aaaaaaaaaaaaah

vapid fox
#

That's programming for you lol

pulsar heath
#

no, thats coding in lua

vapid fox
#

Fulfilling but frustrating are the terms I use.

pulsar heath
#

it was faster to code a lib with full support to the twitch api in vbnet and c#

#

thant it was to make the original stats mod

#

the only coding language that really annoys me is lua...

#

and believe me... i even coded in pascal and delphi and those two... are really bad and limited

astral dune
#

lol, I can't imagine what is possibly so bad about Lua, the syntax is straightforward, first class functions are really handy, and it largely does anything anyone could need. Missing switches and a continue keyword is a bit frustrating at times, I guess

tardy wren
#

It's less Lua and more Zomboid

#

But if you only use a language for one thing, then you associate them together into one

pulsar heath
#

so make me a websocket connection in lua without using libraries created with c#

tardy wren
#

Well, you ca

#

Socket library

pulsar heath
#

without a library

tardy wren
#

It's built-in

pulsar heath
#

no its not

astral dune
#

socket library is not in kahlua

tardy wren
#

Not in Zomboid, yeah

pulsar heath
#

and lua uses a lib from c#

#

its not native coded

tardy wren
#

Half of c# runs off of c++

pulsar heath
#

yes it does

tardy wren
#

But I digress

#

For me both are pain

pulsar heath
#

i've surrendered to vbnet...

tardy wren
#

And I need to make a web-api and Xamarin app combo to handle file transfer

#

Which isn't for Zomboid, for Zomboid I need to extend my anxiety-inducing mod

pulsar heath
#

dont work much with xamarin... only when the client needs something that works in mobile

astral dune
#

in the end, PZ/Kahlua not exposing certain functionality isn't really a Lua problem, so "it's less Lua and more Zomboid" is probably the best way to put it

pulsar heath
#

but im not saying that, im sayng that lua itself is limited as hell

astral dune
#

lol

pulsar heath
#

it makes sense that its even more limited in pz with kahlua for security reasons

fast galleon
#

js / java is an alternative (DeltaMango)

tardy wren
#

which you can cirvumvent woth java mods

pulsar heath
#

i have no opinion on java, personally i dont like to code in it

#

but cant say its bad...

sour island
#

What about Lua in its own right is limited? Not to say you're wrong, but I feel like if anything it's too open ended - and I wish more utility functions were built-in.

pulsar heath
#

well to start off is a lot error prone than other languages

#

i dont find the code as easy to read as other languages, but nobody is obligated to agree with me, its my opinion and as such anyone is free to say otherwise

#

doin' simple logic stuff like a switch or a case ends up being a pain in the behind

#

to embed in other apps like in games... yeah... prolly the best choice

#

but that doesnt mean my opinion is gonna change

astral dune
#

error prone?

pulsar heath
#

a undefined variable or class member (table entry) is not an error (it returns nil)

#

for example

#

lacks proper tooling

#

Variables can be assigned without being declared

#

thats kind of a mixed feelings for me

#

no validation on the fucntion parameters

#

im forgeting something

astral dune
#

pretty typical of untyped languages tbh. I used to prefer strongly typed languages like Java but I've learned to appreciate this style

pulsar heath
#

is not that i dont apreciate the "freedom"

#

but there are somethings that are needed to make the coding process more fluid

#

if i code something in lua today, a year from now i prolly wont remember wtf i did on that code... so i have to spend time figuring out what i did previously...

#

time that could be used expanding and improving the code, either to add new funcionality or to update the code itself

#

another point, but that happens in python and java as well i think is no data hiding

#

im gonna stop my rant there b4 i annoy everyone even more

calm depot
#

Lua is freeform by default, however, you can setup metamethods that throw errors to prevent most of what you're complaining about

#

for example: setmetatable(_G, { __newindex = function() error("NO IMPLICIT GLOBALS, DUMMY") end)

Will prevent you from setting globals

pulsar heath
#

yes i can, but once again... spending time on something that i shoudnt

astral dune
#

consider it boilerplate. Every language has it

pulsar heath
#

usually i enjoy coding... but not with lua, thats the main point for me. The only language i have less fun coding and thak god i dont have to use it anymore is tcl

#

but im just a idiot ranting about something he shouldnt

astral dune
#

my only real complaint about Lua is that a language that was made specifically to limit scope should give everything a local scope by default, not global

calm depot
#

but lua is such a simple language

dull moss
bronze yoke
#

my only real complaint about lua is indices start from 1

calm depot
#

@astral dune again, you can achieve the same effect by setting metamethods on _G

dull moss
#

thats 2 complains and I agree with both

calm depot
#

lua doesn't dictate to you whether to allow implicit globals or not. you decide that for yourself

astral dune
calm depot
#

I'm obviously not suggesting you do that in the context of a PZ mod

ancient grail
astral dune
pulsar heath
#

index starting at 1 or 0... doesnt bug me that much

astral dune
calm depot
#

indexes in Lua only start at 1

#

any code you see in PZ that is starting from 0 is a marshalled java array

pulsar heath
#

not saying that lua starts at 0 or 1, im saying that doesnt bug me at all... that lua start indexing at 1

#

it that was the only bad thing about lua i would be a lua fan boy

calm depot
#

for what it is - a simple and very accessible language, I like it, it provides a broad reach that even a newbie can get their head around. Would I choose it if everyone on my team was an experienced dev with knowledge of languages like C++? No. but most of the time you can't afford to only hire high-experience staff

pulsar heath
#

like i said, for what its being used in pz is more that enough

#

and i doubt theres a better choice than lua for that purpose... does that mean i have to like it? Nop

astral dune
#

liking Lua is in the ToS, sorry

calm depot
#

well, I would argue that Mruby would be a decent choice these days

pulsar heath
#

have no experience with mruby so i cant say i agree or disagree on that one, from the ones i know and have worked it, even if i hate working with it, its still the best choice

calm depot
#

it's an embedded implementation of Ruby

pulsar heath
#

my experience with ruby is almost 0... never had the need to work with it, or the curiosity

calm depot
#

it's like Python, but better 😛

astral dune
#

not a high bar

pulsar heath
#

i do know that many of my friends are fanboys of ruby

#

but they work with more web related stuff

calm depot
#

any language that assigns meaning to whitespace should go in the bin

#

#HotTakes2023

pulsar heath
#

any language that i dont have fun coding should go in the bin 😄

#

but i do have to say that lua makes me use my brain more

#

ill give it at least that good point

calm depot
#

uh, what other language(s) do you use?

pulsar heath
#

mainly c++, c# and vbnet... and php for crap websites

calm depot
#

you do C++ and you're telling me that Lua makes you think more

thick karma
#

Lmfao

#

Sorry don't mind me

pulsar heath
#

been working with c++ since i was a teenager

#

so lua makes me think more

#

dont use it that much

calm depot
#

having written multi-threaded apps in C++, there is absolutely no comparison

pulsar heath
#

started with pascal, then c, then c++

#

and in the present i use vbnet more than anything else

calm depot
#

oh, VB... shudder

pulsar heath
#

i used to think that vbnet was for lame dumb lazy ppl

#

till i started using it because i had to

calm depot
#

I first used VB back in the days of VB6

pulsar heath
#

and after a while... it became my main coding language

calm depot
#

C# is a far better .net language

pulsar heath
#

i do agree on that

#

but most of the work i do its faster with vbnet

#

as in faster to develop

#

since most of the ppl i work with only know vbnet and c# for them is the devil

#

i kinda get why since is more "user friendly"

pulsar heath
calm depot
#

VB6 predates the existence of .NET 🙂

pulsar heath
#

i know

#

the net bit started at 2001

#

or something like that

#

with vb7 i think?!

#

dunno to old to remember that

ancient grail
#

Mod Learning Materials

``
PzWiki:
https://pzwiki.net/wiki/Modding

Lua events:
https://pzwiki.net/wiki/Modding:Lua_Events

Mod permissions:
https://theindiestone.com/forums/index.php?/topic/2530-mod-permissions/

Fenris guide:
https://github.com/FWolfe/Zomboid-Modding-Guide

Dislaiks guide:
https://steamcommunity.com/id/Dislaik/myworkshopfiles/?section=guides

https://projectzomboid.com/modding/index-files/index-1.html

Konijimas guide:
https://gist.github.com/Konijima/7e6bd1adb6f69444e7b620965a611b74

Konijima library guide:
https://github.com/Konijima/PZ-Libraries

Mr bounty guide:
https://github.com/MrBounty/PZ-Mod---Doc

Recipe and item variables:
https://theindiestone.com/forums/index.php?/topic/15188-item-and-recipe-script-variables-brief-description/

Lua:
https://www.lua.org/pil/contents.html

Server client commands:
https://github.com/RangerSimple/ProjZomb-Guides

Mapping and tiles:
https://youtube.com/@daddydirkiedirk119

Loot distrib:
#mapping message

Clothing masks:
#modeling message

DoParam:
#mod_development message

Item full type:
#mod_development message

Mod Testing:
#mod_development message

Startup Param:
https://pzwiki.net/wiki/Startup_parameters

Vehicle modding:
https://theindiestone.com/forums/index.php?/topic/24408-how-to-create-new-vehicle-mods/

Clothing mod:
https://steamlists.com/project-zomboid-how-create-a-clothing-mod-41-60/

Authentic peach guide:
https://theindiestone.com/forums/index.php?/topic/49385-do-not-delete-luascript-files-from-your-mod-some-modding-guidelines/#comment-342943

tag system:
https://theindiestone.com/forums/index.php?/topic/53019-details-on-the-improved-modding-tag-system-in-4169/
``

calm depot
#

there's no VB7 really, it was the first VB.NET

ancient grail
#

This is a list of guides to share to people who is asking abt modding

#

Im gonna keep the msg link and update it whenever needed

pulsar heath
calm depot
#

that's not really how naming works

#

otherwise, Windows 10 is Windows 9

pulsar heath
#

it actually is 🙂

calm depot
#

but Windows 10 is Windows 10

pulsar heath
#

but yeah youre right since it was incompatible with the previous vb

#

so it cant be called vb7

#

my bad

calm depot
#

@dark wedge quick question: Does your SpiffUI Inventory mod make any changes to the code of Loot All/Transfer All, or are you changing the code at a higher level so that they just receive a table of all items collected together?

fast galleon
astral dune
#

MrBounty has the UI guides right? quite good imo

calm depot
ancient grail
#

O dont have the forum links tho. Ill look for useful stuff posted here on the channel

Im also looking for the item tag link

fast galleon
dark wedge
# calm depot <@255358282862952449> quick question: Does your SpiffUI Inventory mod make any c...

For the "Loot All" I simply hide when one of my containers is open, and block other transfer attempts to go into that inventory elsewhere (dragging, double click, etc., just mark it not-valid). For "Transfer All", or transferring to my loot container, I hooked into the ISTransferAction:waitToStart (unused) and check if the transfer is going to one of my loot containers and redirect the transfer to the first actually available container.

calm depot
#

I initiate the transfer through ISInventoryPaneContextMenu.transferItems

#

will that still go through your hook? the Grab [one/half/all] options use that

ancient grail
#

Any guides for sandbox?
Moddata?

#

Buffy thought me how to use moddata but it was via dm

calm depot
#

oh, I use ISInventoryPane.transferItemsByWeight for doing All

#

so, as long as your UI is still going to see it, everything should Just Work(TM)

dark wedge
calm depot
#

based

pulsar heath
#

@sour island to properly use your EHE mod from another mod, i should use the eHeliEvent_new(startDay, startTime, preset) right?

ancient grail
#

Ow shit i need to nitro for me to do a longer list
I might need to do this externally 😮‍💨

calm depot
#

counts his blessings

dark wedge
# calm depot based

Cool. Tried out your mod rq just to be sure I didn't put my foot in my mouth. ha. The only thing that doesn't seem to work is the "Dedupe All" button from the player to my merged containers. Took a peek, looks like your dedupeAll function doesn't like my "virtual" container so just does nothing for that one. Otherwise, the context menu definitely works

calm depot
#

hm, I see, I'll have a poke tomorrow, I think I'm done with coding for the day 😄

fiery pecan
#

honest question: Why is it that when a mod that inserts into the "Default" zombie zone, is present alongside my mod, it causes the "Default" zombie zone to go oof and spawn ALL outfits? Including my mod's outfits?

wide oar
#

question, im struggling trying to understand how i'd start with the myers zombie mod. so far i have this understood: I'd need to do what i did for my trenchcoat and make outfits and stuff for the actual outfit, which would then spawn on a zombie. But how would i say "only one zombie gets this outfit per world, and he will spawn with different stats than the other zombie"? i'd want him to just be a shambler, but with much higher health than just "superhuman", very high damage, the ability to open doors, insanely keen hearing, and obv the music.

#

so like, i have the outfit part down, but idk how i'd make a unique zombie with unique stats ._.

#

and i'd need to figure out how to silence the zombie moans for that particular zombie too >.<

calm depot
#

take a look at They Knew or AuthenticZ

wide oar
#

authenticz does unique zombies?

calm depot
#

ah, actually, those might just be RNG limited outfits

fair frost
#

idk is it a bug

#

or something

#

dunno

fiery pecan
#

had to remove the sandbox option

#

it'll probably return in the future

dull moss
#

anyone knows why moved weight and items transferred added twice?

local original_transfer_perform = ISInventoryTransferAction.perform;
function ISInventoryTransferAction:perform() -- confirmed working
    if self.character == getPlayer() and self.character:getModData().EvolvingTraitsWorld ~= nil then
        local player = self.character;
        local item = self.item;
        local itemWeight = item:getWeight();
        local modData = player:getModData().EvolvingTraitsWorld.TransferSystem;
        modData.ItemsTransferred = modData.ItemsTransferred + 1;
        modData.WeightTransferred = modData.WeightTransferred + itemWeight;
        --print("ETW Logger: Moving an item with weight of "..itemWeight);
        print("ETW Logger: Moved weight: "..modData.WeightTransferred..", Moved Items: "..modData.ItemsTransferred);
        original_transfer_perform(self);
    else
        original_transfer_perform(self);
    end
end```
```LOG  : General     , 1673554394799> ETW Logger: Moved weight: 42.43999991565943, Moved Items: 1611
<here i move 1 can of some food>
LOG  : General     , 1673554446782> ETW Logger: Moved weight: 44.039999939501286, Moved Items: 1613```
finite radish
#

you may actually have a better time using something like Superb Survivors to create a unique NPC of sorts, and manipulate it as a player object

wide oar
#

hmm

#

can the superb survivors attack you with weapons?

fair frost
# fiery pecan that was because of a game limitation

aha i see
frankly
finding it mildly annoying cuz it sometimes fucks with other car mods i use

maybe
have you considered packing vehicles as seperate addon within the addon
or just straight up as standalone mod ?

#

idk

wide oar
#

if so, and they have bandits, i could use that, then change the outfit/spawn items to just be a knife, have them only walk, mute sounds, play music?

calm depot
dull moss
#

hm

#

not sure

#

lemme try from main menu

fiery pecan
calm depot
#

if you reloaded it while in game, it's going to override your override

dull moss
#

oh that'd explain it

fiery pecan
dull moss
calm depot
#

I hate that they call it "reload", they should call it "re-execute"

fiery pecan
#

not even sure what's causing my issue, other than the fact it only happens when I enable a mod like AuthZ or something else that uses table.insert on the default zombie zone

calm depot
#

people, such as yourself, get the idea that it's resetting the lua state in some way, which it isn't

fair frost
fiery pecan
jaunty marten
#

anyway to get instance of InventoryItem without actual one?
I need it to localize method calls but single way I found is InventoryItem.new("", "", "", "")
it's working well but will good to know better way

dark wedge
calm depot
#

what do you mean by "localize method calls"

fair frost
#

thats cool

#

could you sent me the link in dms
if you don't mind ofc

fiery pecan
#

it's public too, found on the steam page.

fair frost
#

must have missed it

fiery pecan
#

well anyways

#

modding things

jaunty marten
tardy wren
#

I have a recipe that makes a drainable that isn't full. It is often done in bulk. How can I make the recipe try to combine the created thing with other items of its type in the player's inventory? Is there some pre-existing method?

jaunty marten
calm depot
#

@jaunty marten is getFullType not accessible directly from InventoryItem ?

vast nacelle
calm depot
#

InventoryItem is just a marshalled java object

calm depot
#

no, that's not my point

jaunty marten
#

no meta calls > better performance

jaunty marten
calm depot
#

local getFullType = InventoryItem.getFullType

jaunty marten
#

nope

#

doesn't work

#

only instance have methods like this

#

at least on lua side

#

in common things almost no reason to use it but in render the localization is a good thing

high cloak
#

what version of lua does pz use

astral dune
#

getFullType is an instanced variable and takes no inputs, so I'm either missing something or this isn't doing what you think it is

astral dune
calm depot
#

@high cloak it's Kahlua which is 5.1

high cloak
#

the dark ages

calm depot
#

@jaunty marten seems odd, the class is exposed by exposeLikeJavaByClass in LuaJavaClassExposer.java and it doesn't seem to do anything special for instance methods

jaunty marten
#

even no bit module :(

jaunty marten
#

u can't call localizated method as method

fast galleon
#

@jaunty marten

print(__classmetatables[InventoryItem.class].__index.getFullType)
jaunty marten
#

😮

#

sec, need to test

astral dune
#

hmm, thats a peculiarity of kahlua I hadn't considered. Must be some reflection going on in the background to allow you to switch objects the method is called on

finite radish
#

kahlua is dead af

#

i think the last commit to their repo was like actually 10 years ago

#

hopefully devs upgrade to something more modern at some point

calm depot
#

it is, LuaJ is the cutting edge

high cloak
#

lord

high cloak
astral dune
fast galleon
#

wow, Fenris on the team

finite radish
#

are you guys trying to actually get the members, or are you using this in a conditional? because typeOf(<type>) is way easier if it's the latter

calm depot
#

he wants to get the instance method to avoid metamethod calls

astral dune
calm depot
#

there is no difference because Kahlua interprets lua bytecode

high cloak
#

ohh okay i see

calm depot
#

and the lua bytecode of those two versions of syntax is the same

jaunty marten
#

but if to cache method function u will get happiness drunk

calm depot
#

you know what else is funny, Kahlua uses LuaJ's source compiler

fast galleon
calm depot
#

_G._G._G._G._G._G._G.zombie.inventory.InventoryItem 😏

astral dune
high cloak
#

yeah that's true

calm depot
#

it does, but there is the small matter of LuaJ generating code that the Java VM can JIT

jaunty marten
high cloak
#

but i see people localizing methods for speed and it makes me think there must be faster implementations 10 years later

astral dune
#

I'm sure there are better options now than when PZ started development

calm depot
#

it'll come

#

the game had no 3D models, until it did

fast galleon
#

oh @quasi geode of the woodz, what is your wisdom?

sour island
jagged ingot
pulsar heath
# sour island I'd have to check to be honest - the twitch integration is busted in MP and I ne...

i tried using it and it works, still need to see how you send the heli to a specific player its all im missing since it checks if its only twitchintegration and i want the mod to work in both modes
so i can just use eHeliEvent_new(10, 8, "military") for example

then i tried to see if the events were added

local scheduledEvents = globalModData.EventsOnSchedule
for i, event in ipairs(scheduledEvents) do
  print("Event " .. i .. ":")
  print("Start Day: " .. event.startDay)
  print("Start Time: " .. event.startTime)
  print("Preset: " .. event.preset)
  print("Triggered: " .. tostring(event.triggered))
end

and it shows up there, and triggered on the set day and time... wasnt working because i thought it was hour and minutes ( was using 800 and not 8 ) so i just checked the table you use to see if it was there and saw my mistake

sour island
#

Twitch integration overrides the vanilla events to add more parameters

#

I might be refactoring all of it though - so I'll give you a heads up

pulsar heath
#

so the normal scheduller works ( randomly adding events ) even with twitchintegration set to true, but it gives more options? Is that what you mean?

#

will give it a try later on, and thanks

calm depot
#

@sour island when you do touch EHE, do you think you could make a small refactor to the AEBS script so that adding the heli lines lives in a globally callable function?

#

(it'd be nice to leverage that to be able to call it from Save Our Station)

sour island
#

Sure - I can package the function to be returnable if that'd also work

calm depot
#

even better

astral dune
#

oh neat, they went and hired Fenris_Wolf

elfin rapids
#

If my buddy changed lua of specific mod then what else does he need to change if he wants to make coop work? Every time he tried to launch game with that he was getting error with "path" of lua file he has edited

pulsar heath
#

you need to be a bit more specific

drifting stump