#mod_development

1 messages ยท Page 2 of 1

fiery pecan
#

cya fam

craggy furnace
#

have fun

thin hornet
#

Good success into your mod let me know if you get it working ๐Ÿ˜„

#

thanks dad

craggy furnace
#

no problem son

thin hornet
#

xD stop right there criminal scum

sour island
#

was that from his adult swim show?

thin hornet
#

look like the black version of the skyrim guards

craggy furnace
sour island
#

didn't zoom in, the lighting for the armor is overhead and lines up well lol

craggy furnace
#

i love it so much lol

autumn sparrow
#

Nevermind, I figured it out.

dusk saddle
#

Howdy folks, anybody know much about the evolved recipes? Trying to get an ingredient to offer three uses

steel locust
#

You can use my crayon edit for reference:
item Crayons
{
DisplayCategory = Food,
Weight = 0.1,
Type = Food,
DisplayName = Crayons,
Icon = Crayons,
CantBeFrozen = TRUE,
EvolvedRecipe = Soup:1;Stew:1;Pie:1;Stir fry Griddle Pan:1;Stir fry:1;Burger:1;Salad:1;Roasted Vegetables:1;RicePot:1;RicePan:1;PastaPot:1;PastaPan:1;Sandwich:1;Sandwich Baguette:1;Taco:1;Burrito:1,
Spice = true,
HungerChange = -10,
ThirstChange = 20,
UnhappyChange = 20,
WorldStaticModel = Crayons,
}

#

With this edit, I made crayons give 10 hunger, and each time it's used as a spice, it consumes 1 hunger's worth of crayon. So, it has 10 uses in evolved recipes.

#

But if I changed it to 5 instead of 1, it would use 5 hunger's worth of crayon, giving me two uses.

#

Also, does anyone know if there's any existing code floating around that templates removing knowledge of certain recipes? I've been trying to figure out how to do such a thing but (at least for someone like me) it's not coming together the way I was hoping.

dusk saddle
#

Ah, sweet! I was thinking that the EvolvedRecipe = number was the uses. But that's good to know! I had the hunger set to 3 and the evolved recipe to 3. I very much appreciate it!

#

Been trying to figure that out for a bit, I again very much am thankful

steel locust
dusk saddle
#

I shall let ya' know!

#

Heck yeah, it works! Got the little Lunchable pizza sauce to work fully now! Thank you very much!

steel locust
random finch
#

Aside from translations, is there a way to change or revert the display name of a base vanilla item that's been altered by another mod? I'm working on an add-on mod.

pulsar rock
#

@thin hornet I once again come with a question.

I'm listening to the LevelPerk event, and if I find the level is higher than the skill cap (which is properly calculated elsewhere), I limit it like this:

        character:getXp():setXPToLevel(perk, max_skill)
        character:setPerkLevelDebug(perk, max_skill)
#

Issue is, it seems this infinitely loops.

#

Works fine if I debug set the perk level using the admin menu

#

Not so much when it's properly levelled with XP though

#

Any clue what might be the issue?

pulsar rock
#

Update: So, setXPToLevel works, but trying to reduce a skill level using setPerkLevelDebug in conjunction with setXPToLevel seems to not work

#

Results in this, and unless I add a killswitch after the first run, it infinitely triggers

#

I want to level 1 level down, and set XP to that level so it doesn't immediately / repeatedly level back up.

pulsar rock
#

@jagged ingot Sorry for the ping, but I figured I'd ask since you were helpful last time.

jagged ingot
pulsar rock
#

As far as I can tell, it's not a bug

jagged ingot
#

In general for every development project, when something goes wrong, it's best to assume it's your issue first. ๐Ÿ™‚

#

Ok then the next step would be digging.

pulsar rock
#

My main lead is the LevelPerk event triggering potentially too often

#

Though, I haven't the faintest what's causing that.

jagged ingot
#

Oh. You could set a flag and then check for in on that update.

#

It's too bad that event functions can't return true/false to tell the event manager to cancel.

pulsar rock
#

Triggering a levelup using the admin menu works fine and gets the skill levelled back.

Levelling up using exp on the other hand, causes an infinite LevelPerk trigger.

#

Even when I explicitly set the experience below the cap (as can be seen in the above screenshot)

#

It's as if the XP set doesn't go through properly / the Levelling takes precedence - infinitely?

autumn temple
#

I have a debug question. How do I edit the weather? I am trying to look at a model I have been working on ingame, but its just been a thick fog for like 5 ingame days straight

pulsar rock
#

Though, if I make it so my function can only be called once (through a global var), it stops fine. Albeit without actually de-levelling the skill. Only the XP is set "properly" (negative)

jagged ingot
#

Sometimes altering values are handled as proxy variables in the engine.

#

A thought for if you go digging further.

pulsar rock
#

The relevant bits of code are this, for reference:

    if level > max_skill then
        -- Cap the skill level.
        character:getXp():setXPToLevel(perk, max_skill)
        character:setPerkLevelDebug(perk, max_skill)
    end

With level the level that is passed by the event, as the level the skill is raised to.
With max_skill the skill level cap I calculate. I have verified this calculates fine.
With perk the perk that is being levelled up.
With character the character that is levelling up a perk.

This works properly if the skill isn't levelled with XP, but rather set explicitly using the admin panel skill "add level" button.

jagged ingot
#

If you need a batch file to run the game in debug mode, I can provide one. I don't know the policies about uploading it here.

#

Oh wait nvm

#
To enable the debug mode, hold LShift while the game is booting, or for a more permanent option, add -debug to the game launch parameters prior to booting the game.
#

I'm too oldschool haha. (Still types mspaint in the start menu or start + r)

jagged ingot
pulsar rock
#

It sets the xp explicitly to the level's minimum xp

#

Which is why I'm confused as to why my implementation isn't working

jagged ingot
#

Did you walk the code?

pulsar rock
#

The XP is being set, and the setPerkLevelDebug function works fine at setting the level. Issue is something (presumably something to do with the xp) keeps triggering the LevelPerk event

jagged ingot
#

Maybe there's other code that stops that cycle from occurring.

#

I would suspect that it's somewhere either in the debug Lua code or somewhere else. Walk that code backwards and if you don't find it, take a search tool and look for the LevelPerk event in the entire Lua codebase.

#

That debug Lua code section gave me a hell of a headache when writing code to analyze the PZ Lua stuff.

#

It's not meant for the general playerbase to mess with so it's not written like the other areas of the Lua codebase.

pulsar rock
#

Can't seem to find anything tbh

jagged ingot
#

For all I know code stopping the LevelPerk event from firing is likely in another folder.

pulsar rock
#

Discord is preventing me from posting a code snippet?

#

Anyway

#

This is what I could find in XpUpdate.lua

#

Doesn't seem particularly interesting for my case though

jagged ingot
#

Well it gave me a thought. Would another perk or status cancel out your change?

pulsar rock
#

It shouldn't

jagged ingot
#

I can't alter the pain moodle in debug mode. It's due to BodyDamage.

jagged ingot
pulsar rock
#

No, like, I can verify it works if there's no XP gain involved

#

It seems to be specifically something about levelling skills through XP

jagged ingot
#

Ok. I'll trust you on that. This is me guiding you about how to approach the problem step-by-step.

#

This is something I don't know myself however this is how I'd begin to investigate it.

pulsar rock
#

Like, I've gone through the javadoc, but that thing has very little documentation.

People seem to have done the same thing I have, but for actually levelling up skills.

#

I'm assuming something weird is happening because I'm trying to level it down

jagged ingot
#

The docs are only as good as telling you the names and methods of classes.

pulsar rock
#

This is the closest I could find, for example.

#

But that doesn't deal explicitly with the LevelPerk event

pulsar rock
jagged ingot
pulsar rock
#

I tried a search through it with my IDE. It couldn't find it though

#

Might have been a me issue, however.

#

It picked up fine on similarly named but unrelated entries in the Lua Zdoc though

#

Do you have any clue where Events are defined?

jagged ingot
#
public void LoseLevel(PerkFactory.Perk var1) {
      PerkInfo var2 = this.getPerkInfo(var1);
      if (var2 != null) {
         --var2.level;
         if (var2.level < 0) {
            var2.level = 0;
         }

         LuaEventManager.triggerEvent("LevelPerk", this, var1, var2.level, false);
         if (var1 == PerkFactory.Perks.Sneak && GameClient.bClient && this instanceof IsoPlayer) {
            GameClient.sendPerks((IsoPlayer)this);
         }
      } else {
         LuaEventManager.triggerEvent("LevelPerk", this, var1, 0, false);
      }

   }
#
PerkInfo var2 = this.getPerkInfo(var1);
      if (var2 != null) {
         --var2.level;
         if (var2.level < 0) {
            var2.level = 0;
         }
pulsar rock
#
   public void LevelPerk(PerkFactory.Perk var1, boolean var2) {
      Objects.requireNonNull(var1, "perk is null");
      if (var1 == PerkFactory.Perks.MAX) {
         throw new IllegalArgumentException("perk == Perks.MAX");
      } else {
         IsoPlayer var3 = (IsoPlayer)Type.tryCastTo(this, IsoPlayer.class);
         IsoGameCharacter.PerkInfo var4 = this.getPerkInfo(var1);
         if (var4 != null) {
            ++var4.level;
            if (var3 != null && !"Tutorial".equals(Core.GameMode) && this.getHoursSurvived() > 0.016666666666666666D) {
               HaloTextHelper.addTextWithArrow(var3, "+1 " + var1.getName(), true, HaloTextHelper.getColorGreen());
            }

            if (var4.level > 10) {
               var4.level = 10;
            }

            if (GameClient.bClient && var3 != null) {
               GameClient.instance.sendSyncXp(var3);
            }

            LuaEventManager.triggerEventGarbage("LevelPerk", this, var1, var4.level, true);
            if (GameClient.bClient && var3 != null) {
               GameClient.sendPerks(var3);
            }

         } else {
            var4 = new IsoGameCharacter.PerkInfo();
            var4.perk = var1;
            var4.level = 1;
            this.PerkList.add(var4);
            if (var3 != null && !"Tutorial".equals(Core.GameMode) && this.getHoursSurvived() > 0.016666666666666666D) {
               HaloTextHelper.addTextWithArrow(var3, "+1 " + var1.getName(), true, HaloTextHelper.getColorGreen());
            }

            if (GameClient.bClient && this instanceof IsoPlayer) {
               GameClient.instance.sendSyncXp(var3);
            }

            LuaEventManager.triggerEvent("LevelPerk", this, var1, var4.level, true);
         }
      }
   }
#

This is what I believe is the relevant Java method

#

Not sure if it translates exactly to the Event though

jagged ingot
#

Check my reference above yours.

#

I think this might be relevant.

#

What I do know is that the engine takes xp and level stuff differently in certain API calls.

#

So that's now a known.

pulsar rock
#
local function limitSkill(character, perk, level, levelUp)
    -- If not levelUp, then we do not need to check whether or not we should cap the skill.
    -- This also prevents some infinite loops, since this function can cause a LevelPerk event to be fired.
    if not levelUp then
        return
    end

    (...)
#

Top of my function :/

jagged ingot
#

Oh. Let me see.. I don't know if it's exposed.

#

Oh it's in your player object.

pulsar rock
#

Hm, I see

jagged ingot
#

player:LoseLevel(..)

#

PerkFactory.Perk which is an enum.

pulsar rock
#

It doesn't seem to be doing anything about experience though

jagged ingot
#

I know. I didn't say it's the solution.

pulsar rock
#

Just an observation

jagged ingot
#

The whole point was to show you that there are negative clamps applied here.

#

This could be for xp as well as levels.

pulsar rock
#

XP doesn't seem to be clamped

#

From the earlier screenshot

jagged ingot
#

When you add a level to a player, the engine converts this into XP value.

pulsar rock
pulsar rock
jagged ingot
#

Ah well I guess I might be out of date with what I probably read, if even correctly.

pulsar rock
#

XP & Skill level are separate

jagged ingot
#

I recall a level-to-xp conversion table in the Java side.

#

Might be for networking though.

pulsar rock
#

iirc it checks XP on XP gain

#

Perks have functions specifically to get the required XP for each level

#

^

jagged ingot
#

I apologize. Most of my experience is with multiplayer and rendering.

pulsar rock
#

No worries

pulsar rock
#

I appreciate any help at this point

autumn temple
#

also I do the same

jagged ingot
#

I hope that my approach to problem solving may help you when you do find something out.

autumn temple
#

I manually search for Paint in the start menu instead of the shortcut keys

jagged ingot
#

๐Ÿ™‚

autumn temple
#

ya I know

jagged ingot
#

Back in the kid-pix era of MacOS.

autumn temple
#

I have a windows XP pc next to me

jagged ingot
#

I used to have a Dell Workstation from 2000 next to me. Got it from a friend who got it from some work place.

#

Spiders love those barren, cheap and hollow tower builds.

autumn temple
#

I made the pc just so I can play one of my favorite old MMO's on it lol

pulsar rock
#
      public void setXPToLevel(PerkFactory.Perk var1, int var2) {
         PerkFactory.Perk var3 = null;

         for(int var4 = 0; var4 < PerkFactory.PerkList.size(); ++var4) {
            PerkFactory.Perk var5 = (PerkFactory.Perk)PerkFactory.PerkList.get(var4);
            if (var5.getType() == var1) {
               var3 = var5;
               break;
            }
         }

         if (var3 != null) {
            this.XPMap.put(var1, var3.getTotalXpForLevel(var2));
         }

      }

Seems like the setXPToLevel function is also not calling anything related to the LevelPerk event hmm

#

So, that's not the issue

#

And setPerkLevelDebug is simply not found in the java sources, beyond a declaration.

#

Hm

#

Can you disable events temporarily somehow, I wonder hmm

jagged ingot
#

This is not elegant, however it is an option should you want to explore that approach.

#

If it works, then you have successfully narrowed down where the issue is.

pulsar rock
#

At this point I'm not sure if it's just some weird edge case / buggy behaviour, or an issue with my code tbh

#

I can't think of any reason why it's firing off level ups repeatedly even after I set the XP to 0 / below the level up threshold

jagged ingot
#

All bugs are just like sore muscles.

smoky meadow
#

any guides for creating. UI mods?

wraith root
jagged ingot
jagged ingot
wraith root
#

By auto fill I mean in the IDE

jagged ingot
#

Oh my apologies. Do you mean like say actual code?

wraith root
#

Yeah

jagged ingot
#

I know some people here use something along with Emmi Lua, however I write my code using TypeScript.

sour island
wraith root
#

I want to do both Java and Lua, Java is direct in the code which means I'm not guessing what goes where and how to access it, with Lua it's through an API? How do you find calls to functions and which imports are used?

You use typescript and convert it to Lua?

jagged ingot
#

@thin hornet has a guide on his github

jagged ingot
wraith root
#

As for Lua vs Java, why do you still use Lua if you're a Java primary

jagged ingot
jagged ingot
sour island
#

You'd have to distribute modified code to use a java mod afaik which is potentially a no-no?

jagged ingot
#

It's fine. It's with workshop mods that compilable code is againt their (Steam)'s ToS.

wraith root
#

Compatible?

sour island
#

ah

wraith root
#

Lua counts then

jagged ingot
#

Compiled code, not compatible.

#

If I put .class files or .dll or .exe on the Workshop, I'd violate those terms.

wraith root
#

I actually know Java better than Lua personally, so I'm looking to see if I should just mod without sharing in mind (Java) versus making mods for others. If I'm just looking to mod my own server I feel Java is best to focus on since I'm looking to do some wacky stuff

jagged ingot
#

I also have over 13 years' experience with Java. I know your feels haha.

wraith root
#

Yeah fair enough, for people wanting to play my server how does the auto installer function with Java based mods?

#

With workshop items they auto install, would they have to manually install the modifications

jagged ingot
sour island
#

As two people that know java - how difficult would it be to create a general getter/setter for any public variables?

#

Like a blanket getter/setter

sour island
#

Just wondering cause the java code is full of setters/getters for modders but a few objects have setvariable/getvariable using strings as IDs

wraith root
jagged ingot
#

The problem with PZ specifically is that only static fields are exposed.

jagged ingot
#

PZ has hardcore and committed players on communities.

wraith root
#

For sure... But I guess my balance here is ease of access

#

Want to shoot for great mods and gameplay, but not alienate those who are not technically savvy as they outnumber those who are willing to go through the hastle

jagged ingot
#

Do you know Bukkit for Minecraft by chance?

wraith root
#

Possibly in the future then if I run into more Java needs I'll make an auto installer

#

I do

jagged ingot
#

Well I will tell you that there is a Kotlin flavor of a like-bukkit approach for PZ that is being worked on. A revival project a friend is working on for his older version.

#

Java modding servers is the most pragmatic approach. Do all you can with Lua on the client side.

pulsar rock
#

Say

#

There's no way to reload LUA quickly while a server is running by any chance?

jagged ingot
#

You can use reloadlua <filename>.lua

pulsar rock
#

That also reloads it clientside?

sour island
#

There is but depending on what the lua does it wouldn't be wise

pulsar rock
#

It's just an event listener to do some skill level limiting

jagged ingot
wraith root
#

๐Ÿง‘โ€๐Ÿš€

thin hornet
jagged ingot
#

The pain of using that command more than a thousand times.

wraith root
#

If you guys are primarily Java, how are you distributing access to your mods easily for a smooth experience? Other than the kotlin-bukkit-like interface that is WIP

jagged ingot
#

I will say that if your client mod is powerful and convenient enough for people to install trustingly, you can make a client mod work.

#

There are examples of this in the past.

#

Take a search to 'ModelLoader'. It's ancient. It enabled custom weapon models for mods to use without breaking a thing if it wasn't installed.

#

Long gone and 41 now gives more options than that mod ever did.

wraith root
#

I feel a Java based client mod is a bad idea unless the class is just not accessible via Lua

#

Server side what sort of projects did you work on, like ingame logging ? I have some plans to make a logging bot for discord to track trades, items, chats, etc for administrative monitoring

jagged ingot
#

Memory leaks, frameworks, IRC bots, etc.

wraith root
#

IRC? And uh oh, I hope mem leaks arent the norm in PZ especially considering Java is supposed to be a memory-trash-handling language

jagged ingot
#

There were also some serioues security vulnerabilities I patched.

jagged ingot
fiery pecan
#

am alive

wraith root
#

So these server facing mods didn't require clients to match them ?

#

As in install them so the server is happy, if not that makes sense

jagged ingot
#

Not at all.

#

There's a server mod out right now for adding custom server commands in both Java and Lua, built for Twitch streamers to use. Clients don't need anything.

fiery pecan
# fiery pecan am alive

so...
A. The car's direction isn't being changed for some reason.
B. The blasted keyID isn't changing either.

#

(continued from yesterday)

wraith root
#

In order to use the mod would you have to match it, or does it pack itself into the server as if like the vanilla game

Also.... What kind of access do I need to the server? I host through a website that grants access to server-data and server-files but other than that it's not under my control to root and whatnot

jagged ingot
#

Decompile it. Mod it. Recompile it. Run it. Test it & improve it.

#

That's it.

#

Some things are sensitive for the server when modding it is all.

#

All the client cares about is getting back the information it needs to perform its job.

wraith root
#

Indeed

#

I think I'll keep Lua side code to the client so it's not a nightmare

#

And Java to server junk I can improve

#

What do you use again to convert Typescript to Lua?

jagged ingot
#

I'll link you one sec.

wraith root
#

And is that a language preference? I wouldn't expect TS to give some magical expansion of access as it's just going to be Lua anyway

jagged ingot
#

With generated typings it's a lot better than you think.

wraith root
#

What's the generated typing for

jagged ingot
#

Oh, that's how TypeScript works.

#

It's an option if you don't prefer Lua.

wraith root
#

One benefit I've heard is that TS makes it explicit where vars are going and no ambiguity of globals

jagged ingot
#

Less time spent digging up what is what. ๐Ÿ˜„

wraith root
jagged ingot
#

The GitHub link I provided is actually a Node environment.

#

It's basic but does the job.

wraith root
#

Fair enough lol

#

Lots to learn then, ATM I am Java / C# / Python based in web apps and server management

#

Personally I haven't delved too much into hard modding and mostly keep to work for programming so it's a new process

jagged ingot
#

All good. It's good to have more options.

wraith root
#

My main goal is ease of access to the server for new players, then also cool mods to improve the game

#

But in a way that is better than most modders who are pushing out.... Not so great content (the mods break and are often standalone versus being future proof and easy to work with)

jagged ingot
wraith root
#

I mean updating a mod to the newer versions should be fairly simple

#

Not to mention some modders update multiple times a day, which I frown upon. They shouldn't be releasing a mod like that

jagged ingot
#

I also agree with rapid updates. It's up to that modder.

#

The game doesn't have version control. All these issues you have with mods can be fixed with it in place.

wraith root
#

Not sure how I'd get every modder to get their mods on git lol

jagged ingot
#

No. I mean in the game's engine.

wraith root
#

Ah, well that's the devs

#

๐Ÿ‘น

jagged ingot
#

Yeah. I mean nothing negative by saying it. It's more to do with fixing some issues with mods is all.

wraith root
#

Indeed, just have to fix them every update to the game though lol

jagged ingot
#

Just giving you a more accurate place to focus your issue on.

wraith root
jagged ingot
#

Modders in here are full of kids too that are getting their feet wet.

#

I think that seeing people work on something they don't know is awesome.

wraith root
#

Wish I had the chance when I was younger

jagged ingot
#

If you find new and better ways to mod something, share it with us. ๐Ÿ™‚

wraith root
#

But it's a lot to work on. I used to mod for GTA, which was actually harder than this is here as you don't need a whole portfolio of setup going to work on the mods. I will say mods didn't require a complete restart each time a mod updated

#

Can't find better ways til I make some mods with the current tools first! That's why I've been paying through every single doc / link for the past week

jagged ingot
#

I wonder if GTA modders use Ghidra.

wraith root
#

First two major mods are Java and Lua respectively

One is a planned clientside Lua based UI overhaul for inventory and other interactions to beautiful some stuff

Other is server side Java based logging for all interactions on the server to post to my discord admin channels for monitoring

wraith root
jagged ingot
#

Spent my time as a kid trying to break a CRC32 checksum with the oldschool 90's self-unzipping machine code security pass for a game I played using Olly.

#

Learning that process fried my brain, but in a good way.

#

I respect the GTA modders.

wraith root
#

When I was younger I was banned from having my own rig, finally got fed up and built my own when I turned 18 and i've had for seven years now. Been programming for not as long as most.of my peers but I'm still in the game.

Ive got the edge on 3d modeling however, just need to get myself going on modding here so I can justify quitting GTA

jagged ingot
#

To think a game that had millions of players used a modified checksum that packaged malware from Europe.. That's a story.

wraith root
#

Lol

#

Things were a bit more wacky for PC work back then

jagged ingot
#

It's absolutely beautiful.

#

What can you do with such little space.

wraith root
#

Indeed, nowadays people are used to a lot of it

jagged ingot
wraith root
#

Indeed

#

Ahh I just saw build 42 is approaching at some point... Cant wait for my server to be down for a week as modders catch up lmao

jagged ingot
#

Now people can code like it's poetry.

wraith root
#

jaques_beaver Shakespeare programming languages do exist for TS

#

Er linting

wraith root
shadow geyser
pale cradle
#

are there any events connected to multiplayer voice chat? like an event for "voip start" and "voip end"?

undone crescent
#

good morning everyone! does anybody know a way to make object say lines like the radio/tv does? i wanna have some items in the ground that say different lines when the players get near ๐Ÿ™‚ thanks in advance!

stray yacht
#

Does anyone know which class(es) have the logic for spear sprinting/charging or the spear stab calculations? Going crazy looking for them

thin hornet
#

Radio like object can have a "text" speech

#

Only radio and IsoPlayer can

#

as far as i know

undone crescent
thin hornet
#

Could make your custom tile object an IsoWaveSignal type

#

not sure what it would do on right click tho

undone crescent
#

this would only work on tile objects, right? or could i use the same for an world item i just dropped from inventory?

thin hornet
#

The only things that could "speak" is like players and radio objects.

undone crescent
#

roger, many thanks again! ๐Ÿ™‚

open abyss
#

Tried to make the following recipe, but that breaks the game.
How can i make a recipe that gives multiple items per creation?

    {
        keep Jack,
        keep LugWrench,
        keep TirePump,
        keep Spanner,
        keep Screwdriver,
       
        Result:MechanicMag1;MechanicMag2;MechanicMag3,
        Sound:Hammering,
        Time:10.0,
        Category:AGCM 1,
    }```
thin hornet
#

@open abyss set only one result item and add a OnCreate function that add the rest of it

#

have a look at lua/server/recipecodes.lua

open abyss
#

will do, thanks ^_^

#

found this function Recipe.OnCreate.OpenCandyPackage(items, result, player) player:getInventory():AddItem("Base.MintCandy"); player:getInventory():AddItem("Base.MintCandy"); player:getInventory():AddItem("Base.MintCandy"); player:getInventory():AddItem("Base.MintCandy"); player:getInventory():AddItem("Base.MintCandy"); player:getInventory():AddItem("Base.MintCandy"); end
I guess what i can do is something like this:

    {
        keep Jack,
        keep LugWrench,
        keep TirePump,
        keep Spanner,
        keep Screwdriver,
       
        Result:MechanicMag1,
        Sound:Hammering,
        Time:10.0,
        Category:AGCM 1,
        OnCreate:ThreeCarDoodles
    }```Followed by, in a .lua file:
```function Recipe.OnCreate.OpenCandyPackage(items, result, player)
    player:getInventory():AddItem("Base.MechanicMag2");
    player:getInventory():AddItem("Base.MechanicMag3");
end```Right?
#

@thin hornet

thin hornet
#

Exactly yeah

function Recipe.OnCreate.ThreeCarDoodles(items, result, player)
    local inv = player:getInventory();
    inv:AddItem("Base.MechanicMag2");
    inv:AddItem("Base.MechanicMag3");
end
OnCreate:Recipe.OnCreate.ThreeCarDoodles,
#

I suggest you make your own object for storing your recipe codes
create a file in your mod directory /media/lua/server/MyModName_RecipeCode.lua
then add this:

MyModName_Recipes = MyModName_Recipes or {};
MyModName_Recipes.OnCreate = MyModName_Recipes.OnCreate or {};

-- then add your funcs here
function MyModName_Recipes.OnCreate.ThreeCarDoodles(items, result, player)
    local inv = player:getInventory();
    inv:AddItem("Base.MechanicMag2");
    inv:AddItem("Base.MechanicMag3");
end

then use this in the recipe

OnCreate:MyModName_Recipes.OnCreate.ThreeCarDoodles,
open abyss
#

I already have such a file, apparently, about a year ago, i made a recipe using this oncreate system... but forgot all about how it works, lol

thin hornet
#

its just adding a global object with functions that can be called with recipes.
because it has to be global that why we try to keep it clean into a single global object
by using your mod name at least that make sure to never overwrite any other mod

open abyss
#

here, let me post the entire code of that file:

function onCreate_AGCMFullSetOfClothing(items, resultItem, player)
    resultItem:getInventory():AddItem("AGCMCheatItems.AGCMOddThingy");
    resultItem:getInventory():AddItem("Hat_CrashHelmetFULL");
    resultItem:getInventory():AddItem("Gloves_WhiteTINT");
    resultItem:getInventory():AddItem("Scarf_White");
    resultItem:getInventory():AddItem("Jacket_Fireman");
    resultItem:getInventory():AddItem("Trousers_Fireman");
    resultItem:getInventory():AddItem("Shirt_Denim");
    resultItem:getInventory():AddItem("Tshirt_Profession_FiremanRed");
    resultItem:getInventory():AddItem("Vest_BulletArmy");
    resultItem:getInventory():AddItem("Vest_DefaultTEXTURE");
    resultItem:getInventory():AddItem("Socks_Long");
    resultItem:getInventory():AddItem("Shoes_ArmyBoots");
end

function OnCreate_AGCMThreeCarPowers(items, result, player)
    player:getInventory():AddItem("Base.MechanicMag2");
    player:getInventory():AddItem("Base.MechanicMag3");
end```
i don' even know if the first one works, i DID back in the day, but maybe the code has been changed since last year?
thin hornet
#

hum

open abyss
#

I should test to see if the old recipe works ๐Ÿ˜›

thin hornet
#

resultItem:getInventory()?

#

is it a backpack?

open abyss
#

yeah, i noticed, why i'm sceptical it'll work

#

yes

#

part of a carepackage

#

I learned back then, that you can't just wear all of it at once without dying of heat...

#

it's easy to forget how many important yet small mechanics this game has in place

thin hornet
#

probably would be
resultItem:getContainer()

open abyss
#

not like a classic action RPG where you just play dressup doll... PZ is far more realistic...

#

give me... 10 minutes? i'll go test the recipe, alright?

#

it'll answer the question of whether it works or not

shadow geyser
open abyss
#

OFFTOPIC: "This is how you died" - that sentence always sends a chill down my spine...

undone crescent
jagged ingot
#
function onCreate_AGCMFullSetOfClothing(items, resultItem, player)
    local inventory = resultItem:getInventory()
    inventory:AddItem("AGCMCheatItems.AGCMOddThingy")
    inventory:AddItem("Hat_CrashHelmetFULL")
    inventory:AddItem("Gloves_WhiteTINT")
    inventory:AddItem("Scarf_White")
    inventory:AddItem("Jacket_Fireman")
    inventory:AddItem("Trousers_Fireman")
    inventory:AddItem("Shirt_Denim")
    inventory:AddItem("Tshirt_Profession_FiremanRed")
    inventory:AddItem("Vest_BulletArmy")
    inventory:AddItem("Vest_DefaultTEXTURE")
    inventory:AddItem("Socks_Long")
    inventory:AddItem("Shoes_ArmyBoots")
end

function OnCreate_AGCMThreeCarPowers(items, result, player)
    local inventory = player:getInventory()
    inventory:AddItem("Base.MechanicMag2")
    inventory:AddItem("Base.MechanicMag3")
end
#

Would be nice if this:

AddItems(items: string[])
#

Heh.

thin hornet
#
AGCM_Recipes = AGCM_Recipes or {};

function AGCM_Recipes.onCreate_FullSetOfClothing(items, resultItem, player)
  local list = {"AGCMCheatItems.AGCMOddThingy", "Hat_CrashHelmetFULL", "Gloves_WhiteTINT", "Scarf_White", "Jacket_Fireman", "Trousers_Fireman", "Shirt_Denim"};
  local inv = resultItem:getContainer();
  for i = 1, #list do
    inv:AddItem(list[i]);
  end
end
#

๐Ÿ˜›

jagged ingot
#

If you know it's a proper table array then yeah.

#

I fit's an ArrayList instance or something else, then that goes differently.

thin hornet
#

huh?

jagged ingot
#

java.util.ArrayList or something else.

#

Then you'd need to use for i=0, list.size(), 1 do .. end

thin hornet
#

Its lua man

#

๐Ÿ˜›

#

Me doing lua

#

But also cant wait to use ts

jagged ingot
#

Just pickin on ya.

thin hornet
#

Gonna be dope

open abyss
#

ts?

thin hornet
#

typescript yeah

open abyss
#

to add more annoyance: what if i want 4 scarft_white, 1 scarf_white at 50% condition?

jagged ingot
#

I think you'd create an item from some factory and then modify it.

open abyss
#

๐Ÿ˜›

thin hornet
#

i supose you could change the array to

local list = {
  {"AGCMCheatItems.AGCMOddThingy", 5}, "Hat_CrashHelmetFULL", "Gloves_WhiteTINT", "Scarf_White", "Jacket_Fireman", "Trousers_Fireman", "Shirt_Denim"
};
for i = 1, #list do
    if type(list[i]) == "table" then
      inv:AddItems(list[i][1], list[i][2]);
    else
      inv:AddItem(list[i]);
    end
end
jagged ingot
#

InventoryItemFactory.CreateItem("some_id")

pulsar rock
#

o/

#

How are y'all doing

thin hornet
#

Hey Max

pulsar rock
#

I once again come to ask for help with my issue

thin hornet
#

oh yeah

pulsar rock
#

Stuff ain't working :')

thin hornet
#

So you are doing something like

playerObj:LevelPerk(perk, false);
playerObj:getXp():setXPToLevel(perk, playerObj:getPerkLevel(perk));
SyncXp(playerObj)
pulsar rock
#
local function limitSkill(character, perk, level, levelUp)
    -- If not levelUp, then we do not need to check whether or not we should cap the skill.
    -- This also prevents some infinite loops, since this function can cause a LevelPerk event to be fired.
    if not levelUp then
        return
    end
    
    (...)
    -- max_skill_ is calculated here
    (...)

    if level > max_skill then
        -- Cap the skill level.
        character:getXp():setXPToLevel(perk, max_skill)
        character:setPerkLevelDebug(perk, max_skill)
    end
end

Events.LevelPerk.Add(limitSkill)
#

@thin hornet

#

I can confirm max_skill is properly calculated.

#

If setPerkLevelDebug is not commented out, however, it causes the entire thing to get called endlessly, causing a crash.

#

Seems like it triggers LevelPerk, and the xp for whatever reason isn't handled(?). Logs show me the limitSkill function keeps getting called repeatedly with the same arguments.

#

This only happens when you level up with XP. Not if I "add level" using the admin panel.

#

So it leads me to believe something about levelling up with XP is funky and needs to be handled differently here. Though, setting the XP to the previous level before debug levelling doesn't seem to do it.

pulsar rock
#

I wonder if that's the issue

#

Also, what does LevelPerk(perk, false) do?

#

Specifically, the "false"

#

I wonder if the server kept asking the player to level up, since xp wasn't synced hmm

#

Lemme try

thin hornet
#

is Events.AddXp never triggered?

pulsar rock
#

Not sure, haven't used that Event

thin hornet
#

Cause you could use it to remove the added xp if the level is at its maximum

#

this way it would never really reach the next level

pulsar rock
#

Issue is that'd be potentially a ton of calls?

#

Whereas only checking on LevelPerk is so much less taxing

#

@thin hornet SyncXp doesn't seem to do it.

thin hornet
#

it should trigger only when AddXP param3 is true

#

SyncXp only send the xp changes (from client to server)

pulsar rock
#

That's what I want though, no?

#

I'm confused as to why the LevelPerk event keeps firing tbh

thin hornet
#

setPerkLevelDebug should only set the level of the perk, it doesnt change the xp

pulsar rock
#

Does setPerkLevelDebug somehow cause LevelPerk to fire?

thin hornet
#

shouldnt really

pulsar rock
#

I'm really confused then

thin hornet
#

but

jagged ingot
#

Debug code is something I don't touch. It's whacky code.

thin hornet
#
   public void setPerkLevelDebug(PerkFactory.Perk var1, int var2) {
      IsoGameCharacter.PerkInfo var3 = this.getPerkInfo(var1);
      if (var3 != null) {
         var3.level = var2;
      }

      if (GameClient.bClient && this instanceof IsoPlayer) {
         GameClient.sendPerks((IsoPlayer)this);
      }

   }
#

it does only set a variable and send the changes if its a client

jagged ingot
#

I didn't think that was a Java method last night.

thin hornet
#

what i think is going on

jagged ingot
#

Was too busy watching something and eating dinner when I was working out the problem in my head. Thought it was a Lua call.

thin hornet
#

is that character xp is running into an update loop

pulsar rock
#

So, test results:

If I comment out setPerkLevelDebug and level up using XP, the LevelPerk event fires once, and the xp becomes negative. It does not, however, reduce skill level.

If I do not comment out setPerkLevelDebug, and level up using XP, the LevelPerk event fires repeatedly (pretty much every tick or so, the log very quickly adds up), and the game crashes.

#
        character:getXp():setXPToLevel(perk, max_skill)
        character:setPerkLevelDebug(perk, max_skill)
        SyncXp(character)
thin hornet
#

zombie\characters\IsoGameCharacter.java
line 11217 is the update loop function

pulsar rock
#

I'm not familiar enough with Zomboid to fully understand what's happening in your snippet Konijima. What's this about an update loop?

thin hornet
#

ah thats just the server

pulsar rock
#

Hm

#

What if I sync XP before I setPerkLevelDebug?

jagged ingot
#

I refer to this loop as "The Monolith".

pulsar rock
#

Or will that not do anything (useful)?

thin hornet
#

nvm

#

wait ill write a code and test its too blurry right now in my head

pulsar rock
#

Update: Syncing Xp before setPerkLevelDebug didn't change the behaviour / crash.

jagged ingot
#

Isn't Syncing for multiplayer though?

pulsar rock
#
    if button.internal == "ADDXP" then
        local modal = ISPlayerStatsAddXPUI:new(self.x + 200, self.y + 200, 300, 250, nil, ISPlayerStatsUI.onAddXP)
        modal:initialise();
        modal:addToUIManager();
        table.insert(ISPlayerStatsUI.instance.windows, modal);
    end
    
    if button.internal == "LEVELPERK" then
        self.char:LevelPerk(self.selectedPerk.perk, false);
        self.char:getXp():setXPToLevel(self.selectedPerk.perk, self.char:getPerkLevel(self.selectedPerk.perk));
        SyncXp(self.char)
        self:loadPerks();
        if self.selectedPerk.perk == Perks.Strength or self.selectedPerk.perk == Perks.Fitness then
            self:loadTraits();
        end
    end
#

These are interesting

#

So, first of all, I can ditch the XP setting code from my end

#

Nevermind, I'm a doofus

thin hornet
#

setXPToLevel set the new required xp to level up that perk

pulsar rock
#

Anyway, this showcases the LevelPerk button's behaviour

#

Which doesn't cause a crash

thin hornet
#

char:LevelPerk does a LevelUP

pulsar rock
#

Yep

thin hornet
#

LosePerk does a level down

pulsar rock
#

false means it doesn't call the event?

open abyss
#

you guys gonna freak out a bit more...

thin hornet
#

that bool does absolutly nothing

pulsar rock
#

It doesn't?

thin hornet
#

lol

pulsar rock
#

๐Ÿ˜ฉ

thin hornet
#

its there but is not even used in the source

jagged ingot
#

This is a somewhat common issue.

#

Probably for compatability with older mods.

open abyss
#
function onCreate_AGCMDupeDeluxe(items, resultItem, player)
    resultItem:getInventory():AddItem("AGCMCheatItems.AGCMOddThingy");
    resultItem:getInventory():AddItem("Sheet");
    resultItem:getInventory():AddItem("RippedSheets");
    resultItem:getInventory():AddItem("Log");
    resultItem:getInventory():AddItem("Plank");
    resultItem:getInventory():AddItem("TreeBranch");
   ------------ SNIPPED 63 more items from list to save space in the chat room ------------
    resultItem:getInventory():AddItem("BathTowel");
    resultItem:getInventory():AddItem("9mmClip");
    resultItem:getInventory():AddItem("45Clip");
    resultItem:getInventory():AddItem("44Clip");
end```
jagged ingot
#

aaaaaaaaaaaaAAAAAAAAAAAAAAAAA

#

Not editing this one.

open abyss
#

i know

#

just wanted to show you the nightmare

#

this is a year old script

pulsar rock
#
function ISPlayerStatsUI:onAddXP(button, perk, amount, addGlobalXP)
    if amount and amount ~= "" then
        amount = tonumber(amount);
        ISPlayerStatsUI.instance.char:getXp():AddXP(perk:getType(), amount, false, false, true);
        sendAddXp(ISPlayerStatsUI.instance.char, perk:getType(), amount);
        ISPlayerStatsUI.instance:loadPerks();
    end
end

@thin hornet This is the behaviour that's triggering when I add XP using the menu

open abyss
#

It still works tho

jagged ingot
#

So there's this method in uhhh GameServer.. that makes this look nice..

pulsar rock
#

Is loadPerks() somehow an issue?

#
ISPlayerStatsUI.loadPerks = function(self)
    local previousSelection = self.xpListBox.selected;
    self.xpListBox:clear();
    local maxNameWidth = 0
    for i=0, Perks.getMaxIndex() - 1 do
        local perk = PerkFactory.getPerk(Perks.fromIndex(i));
        if perk and perk:getParent() ~= Perks.None then
            local newPerk = {};
            newPerk.perk = Perks.fromIndex(i);
            newPerk.name = perk:getName() .. " (" .. PerkFactory.getPerkName(perk:getParent()) .. ")";
            newPerk.level = self.char:getPerkLevel(Perks.fromIndex(i));
            newPerk.xpToLevel = perk:getXpForLevel(newPerk.level + 1);
            newPerk.xp = self.char:getXp():getXP(newPerk.perk) - ISSkillProgressBar.getPreviousXpLvl(perk, newPerk.level);
            newPerk.xp = round(newPerk.xp,2)
            local xpBoost = self.char:getXp():getPerkBoost(newPerk.perk);
            if xpBoost == 1 then
                newPerk.boost = "75%";
            elseif xpBoost == 2 then
                newPerk.boost = "100%";
            elseif xpBoost == 3 then
                newPerk.boost = "125%";
            else
                newPerk.boost = "50%";
            end
            newPerk.multiplier = self.char:getXp():getMultiplier(newPerk.perk);
            self.xpListBox:addItem(newPerk.name, newPerk);
            maxNameWidth = math.max(maxNameWidth, getTextManager():MeasureStringX(self.xpListBox.font, newPerk.name))
        end
    end
    self.xpListBox:sort()
    self.xpListBox.selected = previousSelection;
    self.xpListBox.columnWidth[1] = maxNameWidth + 15
    self:updateColumns()
end
thin hornet
#

nah thats just part of the player stats ui

jagged ingot
#

@open abyss Take a peek at public static void loadModData(IsoGridSquare var0) in zombie.network.GameServer.

open abyss
#

Any way to make sure the item i create ALWAYS gets dropped on the ground?
Cause this satchel is like 183 units heavy... well beyond 20 a strong chracter can carry ๐Ÿ˜›

thin hornet
#

@pulsar rock im going to test in a sec

open abyss
jagged ingot
#

It's a Java file.

open abyss
#

ah, okay, then that's why i find nothing... ๐Ÿ˜›

#

Okay, finding the right file is gonna be a bich, so gonna just do *.* ๐Ÿ˜›

#

gonna take a while to have npp search all files, but ooh well

pulsar rock
jagged ingot
pulsar rock
#

Line 3112 of GameServer.jar

#

Fun fact

#

It seems the hard limit on players is 512

jagged ingot
#

Nope. You're reading dead code.

pulsar rock
jagged ingot
#

That's ancient. Like when I started playing ancient.

#

Go look at zombie.core.raknet.UdpEngine

pulsar rock
#

Ah

thin hornet
#

@pulsar rock i dont have trouble limiting the level btw

jagged ingot
#

The limit internally is around the signed byte max value.

open abyss
#

i don't see that file

thin hornet
#

for example

#
local function limitSkill(character, perk, level, levelUp)
    print("leveling up " .. perk:getName())
    if level > 1 then
        -- Cap the skill level.
        character:getXp():setXPToLevel(perk, 1);
        character:setPerkLevelDebug(perk, 1);
        print("limited skill " .. perk:getName() .. " to 1")
    end
end

Events.LevelPerk.Add(limitSkill)
#

it cap it to 1 and doesnt loop for ever

open abyss
#

oh well... not that awefully important i guess

pulsar rock
#

@smoky tendon Any chance we can be allowed to make threads?

pulsar rock
#

Not just the add level button

#

But adding sufficient XP to level up

thin hornet
#

using add level button yeah

#

lets see

pulsar rock
#

Add level button works fine

#

It's XP that loops forever and goes ๐Ÿ’ฅ

thin hornet
#

ooof ok

#

game blow up

#

alright ill just add a print for now and see what happen with that xp

pulsar rock
#

I wouldn't mind if they at some point said "goodbye old mods" and cleaned some of this up, ngl

jagged ingot
pulsar rock
#

Aye

jagged ingot
#

I'd be selfish and biased in saying that the Lua should be rewritten in TS. xD

thin hornet
#

When is pz2 coming out ๐Ÿ˜›

pulsar rock
#

Playztation 2

thin hornet
#

okay so added bunch of xp and it ran LevelPerk event for each level that it equated

pulsar rock
#

The issue isn't the xp setting in our code btw

#

It seems to be something to do with the debug level setting

#

I also tried looping LoseLevel

#

That caused the same behaviour

#

For whatever reason, it seems like setting the level makes it so that the XP isn't overwritten and re-triggers the levelup?

thin hornet
#

somehow Events.AddXP.Add(addXP); doesnt seem to trigger at all

pulsar rock
#

Wait, so AddXP isn't even triggering?

#

Then what's causing LevelPerk to trigger hmm

thin hornet
#

LevelPerk is its own event

#

triggered when using LevelPerk method

#

AddXP should trigger (based on the source) but ill test again

#

could be that i reloaded the script and it didnt catch it

pulsar rock
#

On a side note; I did some tests and even when setting the XP - if it loops like that, the XP is the same each time. So the change isn't properly persisting.

thin hornet
#

Well i might have an idea to go around this issue but will have to test soon ๐Ÿ˜„

jagged ingot
#

Up all night coding. Sleep sounds good.

pulsar rock
#

'Night!

thin hornet
#

Night Delta

pulsar rock
#

If you remove setPerkLevelDebug, the XP is set properly, however. And it's only called once.

jagged ingot
#

Just wish I had some gin in this place.

#

๐Ÿ’ช tired๐Ÿ‘

open abyss
#

Is it possible to set the condition of items using the recipe system?

pulsar rock
#

There might be an event for crafted items that you can hook into?

open abyss
#

looks like i need to use the oncreate feature again ๐Ÿ˜„

thin hornet
#

ok addxp worked

open abyss
#

i'm trying to create some recipes that uses a custom item, that then in another recipe is combined with tire breaks or wheels or what not, repairs the condition of said item to max (or replaces the item with same type item, but with max condition)
(hope that made sense)

thin hornet
open abyss
thin hornet
open abyss
#

oh, so... wait...

#
    {
        OldTire1, /* this would delete/consume the old wheel that has damage */
       
        Result:OldTire1, /*this would give me one at max condition?*/
        Sound:Hammering,
        Time:10.0,
        Category:AGCM 1,
    }```
like this?
thin hornet
#

that should work yeah

#

would still work if that OldTire1 ingredient is not damaged tho

open abyss
#

alright, will give them proper names and the like, but this is very helpful, Konijima!

thin hornet
#

so might want to add a CanPerform check

#

and only return true is the condition is lower then the maxcondition

open abyss
#

eh?

thin hornet
#

okay two sec

#

lol

#

im doing 4 things at the same time atm

open abyss
#

yeah, sorry, i'm not great with all this x.x

thin hornet
#

if you check the recipecode.lua

open abyss
#

no worries, i don't mind if one can replace a maxed condition tire...

thin hornet
#

you can see other type of functions

#

like

function Recipe.OnCanPerform.CleanMuffin(recipe, playerObj, item)
    return item and not item:isCooked();
end
#

you can add in your recipe script a OnCanPerform:myOnCanPerformFunc

pulsar rock
#

I'll wait until the other issue is resolved ๐Ÿ˜…

thin hornet
#

this will prevent the recipe from being performed if the return is false

thin hornet
#

but adding xp from debug doesnt trigger it

#

anyway that not the point we gonna find a way to cap those perk

pulsar rock
#

Aye

open abyss
pulsar rock
#

Preferably using LevelPerk, rather than hooking into the far less efficient AddXp

open abyss
#

However, i do have one last question. and then i think i got my mod at the point where i won't need to worry about it beyond updating it if it got out of date.

I see a few recipes of the base game use "destroy".
What is the difference of using that or not at all?
Don't they both do the same? Or is there more to it?

#

This``` recipe Fixing a wheel
{
OldTire1,

    Result:OldTire1,
    Sound:Hammering,
    Time:10.0,
    Category:AGCM 1,
}```VS This: ```    recipe Fixing a wheel
{
    Destroy OldTire1,
   
    Result:OldTire1,
    Sound:Hammering,
    Time:10.0,
    Category:AGCM 1,
}```What is the difference?

(I added destroy, but what function does destroy serve??)

#

Once i know this info, i don't think there is possibly anything else i need (at least not in regards to my mod)

thin hornet
open abyss
#

ooooh!

#

Alright, thanks a ton!

#

You have been a great help!

pulsar rock
#

Oh?

thin hornet
#

it kind of hackish but it prevent the infinit loop

#
local perkTicks = 0;
local perkLeveledUp = {};

local function limitSkill(character, perk, level, levelUp)
    if not levelUp then return; end
    
    if level > 1 then
        table.insert(perkLeveledUp, { -- add a table witht he reference of the level up to cap
            player = character,
            perk = perk,
            level = 1 -- set limit level here
        });
        perkTicks = 4; -- set the delay for the onTick check
    end
end
Events.LevelPerk.Add(limitSkill);

local function onTick()
    if #perkLeveledUp > 0 then
        if perkTicks > 0 then
            perkTicks = perkTicks - 1;
            return;
        end

        for i = 1, #perkLeveledUp do
            local entry = perkLeveledUp[i];
            entry.player:getXp():setXPToLevel(entry.perk, entry.level);
            entry.player:setPerkLevelDebug(entry.perk, entry.level);
        end
        perkLeveledUp = {};
    end
end
Events.OnTick.Add(onTick);
#

it kind of work you will see the level go up but go down 4 ticks later

#

wich is pretty fast but kind of give time to the game to complete its LevelPerk job before limiting it again

open abyss
#

wait a sec... how do i start a new game?
Ya know, with all this modding, i kind of forgot...

open abyss
#

Either you are the perv, or I am. I'm not into solo sessions right now... i just want to kill zombos... Me time can wait ๐Ÿ˜‰

thin hornet
#

Sorry Copper i truly have no idea what you are talking about ๐Ÿคฃ

open abyss
#

was trying to make a joke here, but i guess it failed hard... ooh well..

thin hornet
# pulsar rock Oh?

On the otherhand it would be good to remove the xp in AddXP so that it never level up at all when at the cap you set

pulsar rock
#

That's just so many unnecessary checks though

#

Any chance you figured out what is causing the infinite levelling back up thing?

thin hornet
pulsar rock
#

Why not just revert back to 3 when it hits 4?

thin hornet
#

this way it wouldnt trigger the audio and halo over the head

pulsar rock
#

Hm

#

I don't mind that too much tbh

cosmic condor
#

Workshop Mech, super cool

pulsar rock
#

I'm more worried about doing checks on every single xp gain

thin hornet
#

its a bit confusing if the player hear a level up but doesnt get it

#

well there is no trouble to check on every xp check

#

not really a performance issue

pulsar rock
#

I'm not really comfortable with the potential impact tbh

thin hornet
#

im going to test it ๐Ÿ˜›

pulsar rock
#

Like, I'm querying all the character's traits and looping over them to check the skill cap

#

And checking sandbox settings

#

And I can't just cache those since dynamic traits could be installed

thin hornet
#

could try and check how long your function take to run, but chance are its nothing

pulsar rock
#

I'm assuming that has a non negligible impact if combined with other mods

thin hornet
#

this mixed with the other code would be pretty solid

#

its not like you gain xp so often that the function would lag the game

pulsar rock
#

I might go the more hackish way that you suggested

#

Less calculations per tick

thin hornet
#

oh i mean you can use both,
one prevent the actual level up and the xp one prevent the small xp from growing up

shadow geyser
#

can't you just set the multiplier to 0 if you want to prevent gaining xp?

thin hornet
#

nothing seem to prevent LevelUpMultiplier to be set to zero

#

actually

#

you cant set the multiplier for a perk to you can only add

#

addXpMultiplier

#

and with AddXPNoMultiplier it would still add the xp no matter the multiplier

sour island
#

working on making more vanilla items into weapons and thought I could edit the attachment offset/rotate on those models for ground but there is only an attachment for world and none seemingly for weapons being held...

#

anyone know a good program to modify models? ๐Ÿ˜…

thin hornet
#

other than blender

sour island
#

does the game have an ingame animations editor like for vehicles?

#

would be great to be able to add world attachment right then and there

#

also, can't help but think it would have been wiser to do this before hand?

#

then again adding in 100+ models I'd try to mitigate the process too

#

could have sworn there was an animation viewer in game

thin hornet
#

there is an animation viewer

sour island
#

what's the key?

cosmic condor
#

irc access via debug menu

thin hornet
#

there seem to have an attachment editor too

sour island
#

yeah just found it

#

thanks

#

oh they updated it

#

sexy

thin hornet
#

tho i have no idea where that animation viewer is anymore lol

sour island
#

the viewer is right above what you highlighted

thin hornet
#

oh LOL

#

my eyes was stuck on Anim monitor

sour island
#

this is too fun

cosmic condor
#

lots of new animation updated recently

sour island
#

you put PZ into github to see changes?

#

damn... that's like 200+ IQ

cosmic condor
#

local git only

sour island
#

I think someone wrote a difference checker utility to print changes into a txt

#

use : for instanced objects

#

also if I recall, getDay get's the day of the month 1 to 29/31

#

if you want what day the game is on you should use getNightsSurvived()

#

almost every call will use : as they're all instances

#

lua side you will more likely use .

thin hornet
#

For the total days the server world exist, no mater the player survived time

local worldAge = getGameTime():getWorldAgeHours();
local totalDays = worldAge / 24;
sour island
#

that works too

#

so getDaysSurvived actually counts how long the player has been alive

#

while getnightssurvived is used for challengemaps I believe so it counts the days

wraith root
#

Any way to change the zombie infection settings such as symptoms and certain meds that have to be taken to stave off the infection?

sour island
#

You could leverage off PlayerUpdate

#

There is a popular mod called "antibodies" that does this, except they made it so you lose infection status over time if meeting criteria.

#

Would not be all that hard to add more symptoms if your criteria is infection value > x, do etc

thin hornet
sour island
#

heh

thin hornet
#

so its not player related

sour island
#

I know, dayssurvived is

thin hornet
#

player nightsurvived in inside the IsoPlayer

wraith root
#

I'll be honest I've gotta figure out how that antibodies mod works, cause I satisfied all the good conditions and still died lmao

sour island
#

wait they have an additonal var in players for nights survived?

wraith root
#

I'm looking more so to remove symptoms and add new ones, like sleeplessness, depression, larger FOV, etc

thin hornet
sour island
sour island
#

Messing around in bodyparts code is a bit of a nest

#

player's have bodyparts with parts which have bodygamage and bodyparts or some such

#

the file is LuaEventManager

#

Did you properly set up the libraries section?

thin hornet
#

you mean the auto complete doesnt work on events right?

#

yeah unfortunatly

sour island
#

Oh yeah I noticed that too

thin hornet
#

because PZ events are not defined like objects and methods, they are pretty volatile

sour island
#

now that you mention it

#

I wonder why it isn't a function in luamanager

#

like addLuaTriggerEvent(eventID, function)

thin hornet
#

thats something that Typescript system is going to fix effortlesly

sour island
#

There's also Hooks which I don't think anyone has ever used

#

there's only like 3 hooks though - but they would allow for total overhauls

#
    private static void AddEvents() {
        AddEvent("AutoDrink");
        AddEvent("UseItem");
        AddEvent("Attack");
        AddEvent("CalculateStats");
        AddEvent("WeaponHitCharacter");
        AddEvent("WeaponSwing");
        AddEvent("WeaponSwingHitPoint");
    }
#

I think they added more

thin hornet
#

Yeah not all events are defined in LuaEventManager.java

sour island
#

@wraith root Ironically, both topics merged - you can use the hook CalculateStats to completely modify how illness is handled but you would have to also recreate every other facet that the hook bypasses.

wraith root
#

Hm

#

I wouldn't mind

#

Modding be modding

sour island
#

Idk if this convention is used elsewhere but Hooks circumvent the rest of the function entirely for a lua function.

wraith root
#

I want to make a custom infection so I had a feeling I'd have to rework a bit to get it working...

sour island
#
   protected void calculateStats() {
      if (GameServer.bServer) {
         this.stats.fatigue = 0.0F;
      } else if (GameClient.bClient && (!ServerOptions.instance.SleepAllowed.getValue() || !ServerOptions.instance.SleepNeeded.getValue())) {
         this.stats.fatigue = 0.0F;
      }

      if (!LuaHookManager.TriggerHook("CalculateStats", this)) {
         this.updateEndurance();
         this.updateTripping();
         this.updateThirst();
         this.updateStress();
         this.updateStats_WakeState();
         this.stats.endurance = PZMath.clamp(this.stats.endurance, 0.0F, 1.0F);
         this.stats.hunger = PZMath.clamp(this.stats.hunger, 0.0F, 1.0F);
         this.stats.stress = PZMath.clamp(this.stats.stress, 0.0F, 1.0F);
         this.stats.fatigue = PZMath.clamp(this.stats.fatigue, 0.0F, 1.0F);
         this.updateMorale();
         this.updateFitness();
      }
   }
#

hmm

#

illness isn't handled here after all

wraith root
#

Gonna give players 100 in all of those /s

sour island
#

LuaEventManager.triggerEvent("OnPlayerUpdate", this) will still work though

#

function thing(playerObj)
end

Events.OnPlayerUpdate.Add(thing)
alpine scroll
#

Anyone knows if there is a method or example that returns the x/y/z of an item in the world?

sour island
#

Unfortunately it will be a situation where the game is adding x and you may have to subtract x lol

alpine scroll
#

For example, to find the Home VHS tapes

sour island
alpine scroll
#

Hm

#

I'll try to mess with it

#

Thanks

sour island
#

@thin hornet Can typescript make it so I don't have to remember the class inherits?

#

I wish the lookup knew to grab the inherited functions

thin hornet
#

The Typescript thing is 200% better than that intelij intelisense yeah

#

Im just waiting a bit so that everything is perfect and ill make a mega tutorial how to get started with typescript modding

#

that will probably be a big game changer for the modding community

sour island
#

What would be some differences? Like would I have to write differently than I do now?

thin hornet
#

Well first, you wouldnt need to search as much in the source

#

and second, youll have access to a real complete intelisense of everything

#

events included with param types etc

sour island
#

hmm

#

no param names though unfortunately?

thin hornet
#

let me show a preview ๐Ÿ˜›

#

fully typed

sour island
#

oh damn

thin hornet
#

this is just insane

#

๐Ÿ˜„

#

all that get compiled into lua

sour island
#

yeah I have to go in to see what types the params are sometimes

thin hornet
#

And lets not forget that typescript will let you know about any syntax error or wrong type usage

craggy furnace
#

omg how did i forget that

sour island
#

Yeah, but I don't think I can change model placements

#

I'd have to go in to every model to make it a weapon then add an attachment world to their script for when they're on the ground

vestal lantern
#

Hello. I don't know how to introduce myself so I'm gonna go straight to the point lol. I'm new to modding. I don't know if this is correct
`-- Scripted Talk
if(SS:getModData().NoParty ~= true) then
if worldAgeDays < 1 then
if(SS.player:getModData().isChatValue ~= 1) then
getSpecificPlayer(0):Say("Testing 1")
SS:Speak("Testing 1")
mySS:setChatValue(2)

		elseif(SS.player:getModData().isChatValue ~= 2) then
		getSpecificPlayer(0):Say("Testing 2")
		SS:Speak("Testing 2")
		mySS:setChatValue(3)
		
		end -- end of if ChatValue
	end -- end of worldAgeDays < 1
end -- end of if NPC has no group`
vestal lantern
#

It's in function TalkToSurvivorWP(test,SS)

thin hornet
#

and where does TalkToSurvivorWP come from

vestal lantern
#

The function happen when you target an NPC from Superior Survivor *then go to context menu then click "Talk"

thin hornet
#

Okay, so what exactly you want to know about the snippet you sent?

#

Did you test it and did it work or throw an error?

vestal lantern
#

I want to know if it's correct and if it doesn't have any errors

vestal lantern
thin hornet
#

haha

#

no worry, just try it, you find the error much easier

vestal lantern
#

Ok thanks ๐Ÿ™

thin hornet
#

if you get an error and dont know what it mean then post the error stack here we will try and help you understand it

vestal lantern
#

Oh, ok. thank you

craggy furnace
#

mommas dont let your babies grow up to be cowbooooooooys

thin hornet
#

when you add a trait the last param of the function is a boolean, if its set to true it wont show up in the selectable traits

#

for example

TraitFactory.addTrait("Mechanics2", getText("UI_trait_Mechanics"), 0, getText("UI_trait_Mechanics2Desc"), true);
sour island
#

you can also give perks a parent

#

so it shows up inside of a category

#

I don't know if category perks have a level/xp assigned to them but technically they could

sour island
#

@iron salmon they have unreleased tools right? right?

#

unless I'm doing something wrong lmao

#

gotta mail your 3D guys some liquor

#

there's probably a typo in your code - check your local files

#

C:\Users\<YOU>\Zomboid\console.txt

#

The path might be different for you- but that file will have whats printed on that screen

#

but you know - not garbled lol

#

that'll do it

#

in-game error report isn't all that reliable from what i've seen

#

would suggest bringing up the console.txt

#

also are you on unstable branch?

#

they added more features to the error screen

#

including a button to open the file / force the game to play on through errors iirc

#

yes as it's a new branch

#

I think it's up to .72 ?

#

so there's alot of changes

thin hornet
#

unstable is at .73 atm

#

and yeah you can just redo the setupWorkspace task in intelij to generate source and lib again (update the game first)

open abyss
#

Okay, so make a dupe recipes and then duping a wheel, it dupes the condition of the original wheel duped (which might make sense, but not for my intentions and mod)
So i made a recipe like this:``` recipe Dupe x1 Performance Tire Heavy-Duty
{
keep ModernTire2,

   Result:ModernTire2,
   Sound:Hammering,
   Time:10.0,
   Category:AGCM C,
   OnCreate:OnCreate_AGCM_ModernTire2,
}```And i made a script that does this:
    item:setCondition( item:getConditionMax() );
end```I just wish to know if this is correct (since i have ZERO knowledge with Lua... )
thin hornet
#

you are using item:setCondition but look item is nowhere defined

#

you might actually want to us the variable resultItem instead

open abyss
#

I did as you suggested ๐Ÿ˜‰

thin hornet
#

yeah but you must fix what i send ๐Ÿ˜›

#

for your use case

open abyss
#
    resultItem:setCondition( resultItem:getConditionMax() );
end```??
thin hornet
#

its not bad, just swithc the var name it will work

#

yeah

open abyss
#

on both?

thin hornet
#

so it dupe the item which mean the ingredient item should keep low condition (if low)?

open abyss
#

It honestly does not matter for the design of the mod, whether the original item is at 100% or 44% or what ever... as long as the recipe can use the original item, then make a new item which is in pristine condition.

thin hornet
#

Is there many items than you intend to do this with?

open abyss
#

Car parts only... (like doors, wheels, etc)

thin hornet
#

Okay then there is a way of doing this without having 30 new recipes

open abyss
#

there is roughly 76 car parts, minus the engine and truck which you sadly cannot replace in vehicles

#

so once the engine is dead, repairing it is a hit and miss situation...

sour island
#

there's a context timed action for repairing engines

#

if I recall

#

recently made a mod that made wrenches recursively looked for like all other mechanic actions

open abyss
#

yeah, but still, even with max skills, your not going to be able to turn the condition & damage of an engine to 100% again :/

#

at least not from what i have experienced :/

sour island
#

Yes you can?

#

Unless I'm mistaking modded gameplay, can't you just use spare engine parts?

open abyss
#

shrugs

sour island
#

you said you've experienced it, does your experience differ?

#

removing engine parts nets 1 part per 10% of condition (I think higher mechanics gets more parts)

#

adding engine parts back gets 1% (higher mechanics nets more)

#

I do use a mechanics overhaul mod but I assumed they just added extra functions as to use scrap to repair parts directly rather than replace them

open abyss
#

hmm, i'll experiement with it again later

#

.
getMoodleLevel
get Moodle Level
Moodle???

sour island
#

those objects/methods require types I believe

#

not strings

open abyss
thin hornet
# open abyss there is roughly 76 car parts, minus the engine and truck which you sadly cannot...

media/lua/server/MyModNameRecipe.lua

MyModNameRecipe = {}
MyModNameRecipe.GetItemTypes = {}
MyModNameRecipe.OnCreate = {}
MyModNameRecipe.OnCanPerform = {}
MyModNameRecipe.OnGiveXP = {}
MyModNameRecipe.OnTest = {}

local function addExistingItemType(scriptItems, type)
    local all = getScriptManager():getItemsByType(type)
    for i=1,all:size() do
        local scriptItem = all:get(i-1)
        if not scriptItems:contains(scriptItem) then
            scriptItems:add(scriptItem)
        end
    end
end

-- Set all the items the recipe will accept as ingrediant
function MyModNameRecipe.GetItemTypes.DupeableMecanic(scriptItems)
    addExistingItemType(scriptItems, "ModernTire1"));
    addExistingItemType(scriptItems, "ModernTire2"));
    -- add all mecanic item you want to be dupeable
end

-- Give a dupe of the result item type
function MyModNameRecipe.OnCreate.DupeItem(items, resultItem, player)
    player:getInventory():AddItem(items:get(0):getFullType());
end

MyModRecipes.txt

recipe Dupe Mecanic Part
{
    keep [MyModNameRecipe.GetItemTypes.DupeableMecanic] // this use a function to allow multiple input item

    Result:ModernTire2, // this doesnt matter anymore
    Sound:Hammering,
    Time:10.0,
    Category:AGCM C,
    RemoveResultItem:true, // destroy the result item
    AllowDestroyedItem:true, // allow duping the part even if its broken
    OnCreate:MyModNameRecipe.OnCreate.DupeItem,
}

So basically with this code here you wont need 97 recipes to do the same on all the items defined inside MyModNameRecipe.GetItemTypes.DupeableMecanic

sour island
#

according to the decompiled code there are no overloads for int even

#

check out zombie/characters/Moodles/MoodleType.java

#
public enum MoodleType {
   Endurance,
   Tired,
   Hungry,
   Panic,
   Sick,
   Bored,
   Unhappy,
   Bleeding,
   Wet,
   HasACold,
   Angry,
   Stress,
   Thirst,
   Injured,
   Pain,
   HeavyLoad,
   Drunk,
   Dead,
   Zombie,
   Hyperthermia,
   Hypothermia,
   Windchill,
   CantSprint,
   FoodEaten,
   MAX;
#

you can use from index with a number to get the type

#

but that might change if someone adds a moodle or they change them in the vanilla game

#

but you should be able to use the actual type path

#
local panicLevel = player:getMoodles():getMoodleLevel(MoodleType.Panic)
#

I use this is in one of my mods for conditional speech, and it works

thorny garnet
#

Anyone have the code handy for checking if a particular mod is installed? Is there any documentation around for these API calls?

sour island
#

Ooh I do

thorny garnet
#

I just need to check if a mod is installed for now, but reading the 92 step Github document on decompiling the Java source makes my brain hurt

sour island
#
local activeMods = {}
local activeModIDs = getActivatedMods()
for i=1,activeModIDs:size() do
    local modID = activeModIDs:get(i-1)
    activeMods[modID] = true
end
thorny garnet
#

getActivatedMods, nice. Couldn't remember what it was

#

Thanks @sour island !

sour island
#

I also made a version that includes requires

#
local crossRefMods = {
    ["CatsWalkWhileReadMod"]="ReadFasterWhenSitting",
    ["CatsReadMod"]="ReadFasterWhenSitting",
    ["CatsReadMod(slower)"]="ReadFasterWhenSitting",
}
local loadedModIDs = {};
local activeModIDs = getActivatedMods()
for i=1, activeModIDs:size() do
    local modID = activeModIDs:get(i-1)
    if crossRefMods[modID] and not loadedModIDs[modID] then
        require (crossRefMods[modID])
        loadedModIDs[modID] = true
    end
end
#

requires the modID and filename

thorny garnet
#

oh nice

#

What's the best resource for finding these API calls?

sour island
#

could expand the filenames to a list if need be

thorny garnet
#

Just decompiling the source?

sour island
thin hornet
#

an the shortest check for active mod would be like

if not getActivatedMods():contains("ThisModID") then return; end
-- dont execute if this mod not active
thorny garnet
#

Oh god yeah that's the one haha. Guess I'll have to give it another go

thorny garnet
#

I already have the rest of the code ready to go, just needed that

wraith root
#

I know there is an access to the infection symptoms, it's all in a class

#

I forget where

#

I'll have to go digging again

#

I know it's contained somewhere since last time I found it by tracing how the time of infection setting got passed along

thorny garnet
#

Another quick question - when using ScriptManager.instance:getItem, if I'm trying to modify a value of a modded item's parameters, I would simply include the module like this ScriptManager.instance:getItem(ModdedModule.ModdedItem), or is that incorrect?

sour island
thin hornet
thorny garnet
sour island
thorny garnet
#

ScriptManager.instance:getItem("ModdedModule.ModdedItem") works?

sour island
#

Let me double check cause I mess with script manager alot

thin hornet
sour island
#

I don't know if isoplayer has a function like that directly - if they do then great

thorny garnet
sour island
#
public int getMoodleLevel(MoodleType var1) {
        return this.getMoodles().getMoodleLevel(var1);
    }
thorny garnet
#

Just include the Module.Item, right?

sour island
#

heh... this has to be new

#

they don't even use it in the java afaik

thin hornet
#

just add the module name with the dot

#

it will get that modded item if it exist

thorny garnet
#

Roger that, thanks!

thin hornet
#
   public Item getItem(String var1) {
      if (var1.contains(".") && this.FullTypeToItemMap.containsKey(var1)) {
         return (Item)this.FullTypeToItemMap.get(var1);
      } else {
         ScriptModule var2 = this.getModule(var1);
         return var2 == null ? null : var2.getItem(getItemName(var1));
      }
   }
sour island
#

actually getItem doesn't need the full path but you don't want to leave that opening for issues

thorny garnet
sour island
#

yeah that's what I meant lol

thin hornet
#

getItem handle the module if not specified it would find a vanilla one

sour island
#

seems like the direct method was a recent addition - and a good one - but it's not widely used

#

just from a cursory glance not used once

#

so yeah - this should be fine

sour island
#

if you set up the libraries you can ctrlshiftF to search through your own project and all files in scope

#

which include libraries

open abyss
sour island
cosmic condor
sour island
#

ShareX

cosmic condor
sour island
#

open sourced afaik - combined printscreen with the snipping tool - lets you record gifs as either - and has automatic options for upload to imgur or clipboard etc

#

also has a crap ton of other uses

open abyss
#

@thin hornet if you have a few workshop PZ mods, could you be kind and link me to one of them?
I wish to add you to the credits, since you did a helleva lot of help for me, the least i can do is add you to the credits section

sour island
#

now why you'd want to do all this idk

#

but I'm American and I love excess

open abyss
#

awesome!

thin hornet
#

recipecode is getting more evolved with time so much more efficient

#

alot is now possible with so much less line of code or recipe duplicate

open abyss
#

aye, also, i get errors when i try open crafting menu... so i derped or something...

sour island
#

if you have removeResult as true that breaks the tooltip system

#

I probably should have reported this bug but I forgot

#

๐Ÿ™‚

open abyss
thin hornet
#

it remove alot of clutter in the recipe txt file
but also make the tooltip more efficient in game

#

i recall that rip clothing tooltip with over 400 rippable clothing item would lag alot when hovering

open abyss
#

`-----------------------------------------
function: @stdlib.lua -- file: null line # 10
function: setVisible -- file: ISCraftingUI.lua line # 30
function: toggleCraftingUI -- file: ISCraftingUI.lua line # 1366
function: onPressKey -- file: ISCraftingUI.lua line # 1380.
[25-07-22 18:40:37.439] ERROR: General , 1658767237439> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: at KahluaUtil.fail line:82..
[25-07-22 18:40:37.439] ERROR: General , 1658767237439> DebugLogStream.printException> Stack trace:.
[25-07-22 18:40:37.440] LOG : General , 1658767237440> -----------------------------------------
STACK TRACE

function: @stdlib.lua -- file: null line # 10
function: setVisible -- file: ISCraftingUI.lua line # 30
function: toggleCraftingUI -- file: ISCraftingUI.lua line # 1366
function: onPressKey -- file: ISCraftingUI.lua line # 1380.
[25-07-22 18:40:38.552] LOG : General , 1658767238552> -------------------------------------------------------------
attempted index: view of non-table: null.
[25-07-22 18:40:38.553] LOG : General , 1658767238553> -----------------------------------------
STACK TRACE

function: getRecipeListBox -- file: ISCraftingUI.lua line # 21
function: refresh -- file: ISCraftingUI.lua line # 60
function: setVisible -- file: ISCraftingUI.lua line # 38
function: toggleCraftingUI -- file: ISCraftingUI.lua line # 1369
function: onPressKey -- file: ISCraftingUI.lua line # 1380.
[25-07-22 18:40:38.553] ERROR: General , 1658767238553> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: view of non-table: null at KahluaThread.tableget line:1689..
[25-07-22 18:40:38.554] ERROR: General , 1658767238554> DebugLogStream.printException> Stack trace:.
[25-07-22 18:40:38.556] LOG : General , 1658767238556> -----------------------------------------
STACK TRACE

function: getRecipeListBox -- file: ISCraftingUI.lua line # 21
function: refresh -- file: ISCraftingUI.lua line # 60
function: setVisible -- file: ISCraftingUI.lua line # 38
function: toggleCraftingUI -- file: ISCraftingUI.lua line # 1369
function: onPressKey -- file: ISCraftingUI.lua line # 1380.`

sweet trail
#

Looking for people with modding, mapping and staff experience, contact me if you want to be part of a new server beginning.

plush lily
#

So I'm looking for a simple mod, that makes the skeletons/burned skeletons a clothing mod that a player can wear, only can be gained by debug/console cheats. I tried doing it myself but I have no experience in code whatsoever, looking for pointers or someone to help

cosmic condor
plush lily
#

correct

cosmic condor
#

are you familiar with Blender?

plush lily
#

not at all, figured i could have used the textures from the base game of the skeletons and use them for the player avatar

cosmic condor
plush lily
#

thank you

winter bolt
#

you could make a clothing item that just uses the skeleton model

plush lily
#

yeah i tried following all the steps, so confused lol

sour island
#

Is there a place where all tags used in-game are displayed?

#

wait... I can just write it

brave ruin
#

Best mods for a server with only small group like 3 - 5 people?

thin hornet
#

There is also bunch of collections out there that could give you ideas

brave ruin
willow estuary
#

That should be a new server setting when the current unstable build goes stable.

thin hornet
#

Latest (unstable) has this already

brave ruin
#

When I started up my dedicated server it just made a new file called "ServerTest" but I wanted it to use "ServerBuildPT" is it possible ? I can't find it anywhere in the bat .

sour island
#

Some interesting things in the tags

#
function Recipe.GetItemTypes.BrokenGlass(scriptItems)
    scriptItems:addAll(getScriptManager():getItemsTag("BrokenGlass"))
    addExistingItemType(scriptItems, "SmashedBottle")
end
#

I wonder what this is for

#

"FitsToaster" is a tag

#

heh

#
item Waffles
{
    DisplayName = Waffles,
    DisplayCategory = Food,
    Type = Food,
    Weight = 0.3,
    Icon = Waffles,
    DaysFresh = 3,
    DaysTotallyRotten = 5,
    HungerChange = -15,
    UnhappyChange = -10,
    Calories = 80,
    Carbohydrates = 13,
    Lipids = 4,
    Proteins = 3,
    WorldStaticModel = Waffles_Ground,
    Tags = FitsToaster,
}

item Waffles**Recipe**
{
    DisplayName = Waffles,
    DisplayCategory = Food,
    Type = Food,
    Weight = 0.3,
    Icon = **Saffles**Fruit,
    DaysFresh = 3,
    DaysTotallyRotten = 5,
    HungerChange = -15,
    UnhappyChange = -10,
    Calories = 80,
    Carbohydrates = 13,
    Lipids = 4,
    Proteins = 3,
    WorldStaticModel = WafflesFruit_Ground,
}
#

uh

thin hornet
#

Probably that new feature where you can only fit some specific stuff into some specific containers

sour island
#

also idk if fruit waffles are like infused or ontop but should probably have fits toaster too if infused

shadow geyser
#

its for 41.73

#

before you could put anything into toasters

sour island
#

I know just thought the tag was funny with out context

thin hornet
#

Put a metal knife in the toaster

sour island
#

but the fruit waffles script has typos

thin hornet
#

let see what happen

#

lol

#

DONT DO THAT

#

just saying

#

I wonder if it was a fire hazard to add metal object into a microwave (i mean in game)

sour island
#

yeah the fruit waffle has infused fruit

#

where do I report this critical bug

#

hm pancakes fruit is also called 'PancakesRecipe'

thin hornet
#

xD

sour island
#

I wonder if the type was inuse before and just reused for fruit?

thin hornet
#

#1 priority

#

Game breaking fix the waffle please

sour island
#

potentially

#
item PancakesCraft
{
    DisplayName = Pancakes,
    DisplayCategory = Food,
    Type = Food,
    Weight = 0.3,
    Icon = Pancakes,
    BadInMicrowave = true,
    IsCookable = true,
    ReplaceOnCooked = Base.Pancakes,
    MinutesToCook = 10,
    MinutesToBurn = 30,
    DaysFresh = 3,
    DaysTotallyRotten = 5,
    HungerChange = -20,
    UnhappyChange = 10,
    Calories = 210,
    Carbohydrates = 42,
    Lipids = 2,
    Proteins = 6,
    WorldStaticModel = Pancakes,
}

item PancakesRecipe
{
    DisplayName = Pancakes,
    DisplayCategory = Food,
    Type = Food,
    Weight = 0.3,
    Icon = PancakesFruit,
    DaysFresh = 3,
    DaysTotallyRotten = 5,
    HungerChange = -20,
    UnhappyChange = -10,
    Calories = 210,
    Carbohydrates = 42,
    Lipids = 2,
    Proteins = 6,
    WorldStaticModel = PancakesFruit_Ground,
}
#
   BadInMicrowave = true,
        IsCookable = true,
        ReplaceOnCooked = Base.Pancakes,
        MinutesToCook = 10,
        MinutesToBurn = 30,
thin hornet
#

oh thats cause you have the pancake package box

sour island
#

does this mean we can't cook fruit pancakes?

thin hornet
#

and can make your own mix

sour island
#

but this isn't the mix

#

it's a fruit variant

thin hornet
#

ahhh

#

yeah ok

sour island
brave ruin
thin hornet
#

mhm

#

did you add this to your server bat file?

#

StartServer64.bat

brave ruin
#

Yeah

sour island
brave ruin
#

I added it to StartServer64_nosteam.bat

sour island
#

the suffix of Recipe might have something to do with evolved recipes maybe

#

not sure if the cooked stuff matters though

#
evolvedrecipe Waffles
{
    BaseItem:Waffles,
    MaxItems:3,
    ResultItem:WafflesRecipe,
    AddIngredientIfCooked:true,
    Name:Waffles,
    CanAddSpicesEmpty:true,
}
#

hmm

thin hornet
sour island
#

Does this mean anything you use in waffles makes it a fruit waffle?

brave ruin
#

That worked ๐Ÿ˜› @thin hornet

thin hornet
#

yay

thin hornet
sour island
#

based on the evolved recipe yes

thin hornet
#

D:

sour island
#

it's still called waffle though

#

fruit is only mentioned in the art

#

I've played SS13 - the more modular the recipes the better

thin hornet
#

Well there is baby food with weird mix theses days, like Strawberry+Carrots

sour island
#

really excited for the liquids aupdate

#

give me cooking to that same extent

#

let me have a bottle of cheese

thin hornet
#

Liquid cheeze queasy

sour island
#

jarring should be handled as containers that get sealed

#

probably could write that as a mod right now

#

adding more item types for each outcome feels wrong to me

thin hornet
#

what do you mean

sour island
#

like cheesewaterbottle, cheesecan, cheesejar

#

I would think making a liquid compatible container object would make more sense

thin hornet
#

ah so just a bottle containing something instead

sour island
#

hell even a behavior object you can then perscribe to any other object

#

let people use shoes as a liquid container with a 80% retention

thin hornet
sour island
#

it's the apocalypse god can not judge me

thin hornet
#

Well my shoes would clearly have 0% retention with those holes

sour island
#

this is already a technique used in game for item containers

#

the player/bags/mapobjects don't have lists to themselves they have itemcontainer objects

#

you can extend this to other behaviors

#

as nice as the tag system is for items

#

doing the above could make things like adding generators or other types of power sources much more accessible

thin hornet
#

Have all vegetables get a tag vegetable and fruits a tag fruits and tomatoes exceptionally have both

sour island
#

and you can mix and match behaviors

sour island
#

an example would be clothing / weapons / items

thin hornet
#

then have evolved recipe accept tags