Pawel's Mod Corner: Autoharvest, Biome Crops, LostEms & others

I monkeypatched PlaceItemCallHandler.undeploy_item function so it should work properly, at least for me it does. Have you tried undeploying anything else than a plant? It could be that for some reason the whole undeploy command is bugged.

EDIT: I found the typo, I was missing one end in plant_lore_server.lua, hotfix uploaded.

EDIT2: Something strange happened as none of my server.lua files seem to work now, despite me not changing a single character in the files. I have to investigate further.

EDIT3: So it seems there’s a new annoyance in modding: .lua files don’t work if the mod isn’t packed into .smod file. For fast testing I kept the mods unpacked and zipped them only for releases, now I’ll have to zip before every test. Not nice.

It seems the bug was caused because bounds table was missing somehow, it is not even related to the margin table in the code. I find it strange. "mixintypes": "remove" has specific table set as a target and should not even attempt to touch the bounds table, so I’ll use it instead.

After checking the fixture component: it assigns 0 if margin is nil, there’s even a comment so I guess it was addressed in A22.5 after bug report. This means the old method should be safe now and, given how unexpected the mixin results can be, even more reliable. I’ll revert to it in the next small update of Finetems, which will fix the problem of windows being passable when placed next to each other.

1 Like

Just a quick but very important note: because of the Pawel API mod coming soon next releases of both Finetems and Plant Lore will be completely backward incompatible with savegames based on earlier mod versions. Some elements will be fused, renamed, moved to the API or even completely removed so the game won’t be able to load them.


An idea, what about workers can harvest herbs, yet their is a chance of destroying them if done wrong. Just an idea,

1 Like

I would like to report, that the wooden doorways dont work properly with the Finetems mod, they dont have the margin removed from them, funnily enough, the stone doorways do have their margin removed, and work just fine.

1 Like

Wooden doorways are added by [MOD] [18-21] Stonehearth Doorways 2.0 and I think I’ve already added support for them, but I’ll double check that before the next release (coming soon as the first version of the API is almost ready and most data is already migrated).

I have to admit Finetems is a bit on hold right now and possibly until A23 because the devs keep writing about some crafting system overhaul and Finetems, like the name suggests, depends heavily on fine item mechanics, so I’ll wait to see what happens with them in the future. Plant Lore will get some more attention (I have few more decorations planned) and Archmod is pretty much stopped because I want to add new features instead of just new entities first. I have quite a few ideas waiting and even got names for them:

  • Land Grab: territory can be marked as owned by the player, all objects not in the player’s territory are slowly abandoned and lose player_id in the end, while objects with no player_id which end up in the player’s territory get player_id after some time. Maximal territory is limited by town tier and certain actions can be performed only on objects in the player’s territory. Also adds Patriot (feels better in the player’s territory) and Traveller (feels better outside the player’s territory) traits.
  • Clillmate: adds climates (seasons, varying day length and sun position), new physical needs (warmth, thirst, hunger divided into nutritional categories) and medical condition bar. Hearthlings may become ill if they are cold, dehydrated or have unbalanced diet and it is the Herbalist’s job to take care of them in such case. Adds traits for temperature preference and need-related thoughts.
  • YetAnotherCookingMod: some foods require maturation, e.g. the cook has to pour milk into a curding tub and curd can be harvested after some time. Adds some more elaborate food chains so it is not just a raw food > cooking ingredient > food system.

The main reason for updates slowing down recently is whenever I add a new saved variable to any component backward save game compatibility is broken, so I want to add a bunch of these in a single release.

I like the cooking mod Idea, I just think there needs to be an “auto harvest” feature for berry bushes, berry pie/cake made from berries from bushes is ANNOYING to make, since I have to harvest them every.single.time.

The land grab idea seems nice, one thing that needs to be added is some sort of defense along the road, have points along whatever road in your terriroty and have a “patrol” set there, like a footman, or a little tower with an archer.

Have you looked into the Muskets mod some guys here wanted to make?

I dont know how to mod, but you seem to know what you are doing. Could you maybe lend them a hand? I would LOVE to see muskets

smod file has a string of numbers in front may you please re upload or provide different link

the wooden doorways do not have the margins removed, and those recipes are not in the mod compatibility folder

It has nothing to do with the recipes, manifest.json should list the entity alias or .json path in “mixintos” table with margin_removal.json file path after a colon. I made sure it is done properly in the next release.

For all those experiencing bugs related to margin removal: I won’t even attempt to fix these until A23 because I’m not able to reproduce the bugs and building editor will get an overhaul in A23+ anyway so it would be more probable that I break something for A23+ than I fix it for A22.5.

Migration to API is done and as saved variables actually cannot be added via monkeypatching a component all new stuff requires its own components so I don’t have to accumulate updates that much anymore. As I wrote earlier: today’s updates of Finetems and Plant Lore break backward compatibility with older saves. In return you get major bugfixes for Plant Lore and autoharvest for renewable resource nodes. Due to the way I had to implement it loading times may theoretically increase so please report if they get much longer.

Remember to rename downloaded .smod files because Discoruse bug changes filenames.

On the finetems mod, in the compatibility settings:

There is a problem with the compatibility for the doorways mod, on the other mod there are 2 types of “wooden doorway”

The reinforced small wooden doorway is the only one that has the margins removed with your mod.

Thanks for all your help!

looking forward to seeing your new API at work. What kind of bugs does it fix?

So I think I finally found a way to reproduce margin removal bug and I’ll sit down to it tomorrow. Because today I learnt how to rotate model parts via static animations and no Blender is in fact involved (Rayya bless the author of this tool:

So first Archmod feature I’ll show you are roof tiles.
Pros: side of the roof looks awesome
Cons: front of the roof looks ugly, many meshes to render

The problem is I have no idea what do do with roof edges.


This is so awesome Pawel Malecki! I look forward to see the final solution and put it to use :slight_smile:

It would already be solved if I knew how to bind a hotkey to a custom action and how exactly is placing an object from inventory different from moving it in Lua terms (both seem to use different functions because one cannot place an object from inventory on top of another object while it is possible while moving an object). I’d add a new component to Pawel API which allows toggling model variant during object placement. This would in fact help in my mods a lot as I could merge all shuttered windows into a single one and add end and crossing pieces to fences without creating new objects for each segment.

Very nice! I love the roof!

So for the margin removal problem: as I get the error but everything works as intended I’ll leave it as it is until A23, because, fixture_fabricator_component.lua is, um…

   -- what the heck is going on here?  basically other parts of the system want to
   -- maintain the invariant that square region's maintain their same position in
   -- the world when rotated, even if the origin is not exactly at the center of
   -- the region.  this is accomplished by the axis alignment flags on the mob
   -- component.
   -- this means that when an entity is rotated beyond 180 degress, the origin
   -- flips to the other side of the region (e.g. -1, 0 -> 0, 1).  to account
   -- for this, move the fixture along the wall by an opposite amount.
   -- yes, this is very "voodoo magic".  i apologize and loathe myself for writing
   -- it. - tony

In other words: for now all kinds of bugs related to fixtures are expected.

heyho little question can you add to your api the plants of the brewery and settlementdecor mod?

It’s done the other way round, you have to add "show_autoharvest_ui": true to renewable resource node component of these plants. Without API it will have no effect so you don’t have to create separate version of the plants for API and without API. You can do that via a mixin but it complicates the matter if you’re adding new plants instead of enabling the feature on existing ones.

1 Like

so tested - no issues with new plants ^^ also when i remove the mod - so brewerymod is uptodate now :wink: works also perfect with my appletrees :smiley: its gives now apple and wood (like always wanted xD)

soo @BrunoSupremo this could be something for your biomes :wink: like archipelago etc xD


ok now i get an error -.-

release-763 (x64)[M]
…rce_node/pawel_renewable_resource_node_component.lua:216: attempt to index a nil value
stack traceback:
radiant/modules/common.lua:245: in function 'report_traceback’
radiant/modules/common.lua:256: in function <radiant/modules/common.lua:250>
…rce_node/pawel_renewable_resource_node_component.lua:216: in function ‘request_harvest’
…rce_node/pawel_renewable_resource_node_component.lua:182: in function ‘renew’
…_resource_node/renewable_resource_node_component.lua:255: in function '_fn’
radiant/controllers/timer_controller.lua:95: in function 'fire’
radiant/controllers/time_tracker_controller.lua:86: in function <radiant/controllers/time_tracker_controller.lua:86>
[C]: in function 'xpcall’
radiant/modules/common.lua:265: in function 'xpcall’
radiant/controllers/time_tracker_controller.lua:86: in function ‘set_now’
…hearth/services/server/calendar/calendar_service.lua:421: in function ‘_on_event_loop’
…hearth/services/server/calendar/calendar_service.lua:46: in function 'instance’
radiant/modules/events.lua:291: in function <radiant/modules/events.lua:285>
[C]: in function 'xpcall’
radiant/modules/common.lua:265: in function 'xpcall’
radiant/modules/events.lua:285: in function 'trigger’
radiant/modules/events.lua:398: in function '_trigger_gameloop’
radiant/modules/events.lua:446: in function '_update’
radiant/server.lua:61: in function <radiant/server.lua:58>

ok after some test - this is also this also appears with vanilla :frowning: looks like something was changed within the renew order

1 Like