[MOD] City planning with pegs (version 5.0)

Here is my first mod, I hope you enjoy it:

City Planning With Pegs. version 5.0

What is this mod?
I made this mod to learn how to mod things into the game. It adds small, medium and large pegs into the game, of a stone, wooden and clay variety. With these pegs, you can stake out an area where you want to build a building in the future, so you can plan a city/building in advance.

Hearthling for scale:

Download v5.0
All my mods can by found at my stonehearth mod repository.

How to use the pegs

First you need to craft the pegs. This goes by the batch, so search for the recipe of a Batch of Pegs (under ā€œbuilding partsā€), rather than the recipes for the pegs themselves. To get the individual pegs, you need to harvest the batch, just how you would do with a log pile for example. Edit: Not any more.
Pegs are so small that one unit of resource can make a batch of them, the game tells you how many in the recipe.

You place the pegs in the same way that you place any other furniture item into the world. The small and medium pegs are on a corner of a block, so make sure they are rotated the right way. The big peg is centered on a block. The configuration of the pegs is up to you.

Changes in v5.0

  • implemented a feature where one recipe can produce multiple pegs. This fixed the hack where I used piling mechanics for this.
  • removed symbols from the mod name that the engine didnā€™t like me using.
  • changed .zip to .smod
  • moved file to github
Summary

Changes in v4.1

  • changed ā€œpiles of pegsā€ to ā€œbatches of pegsā€ for more clarity as to how to craft pegs.

Changes in v4.0

  • added stacks of pegs, the bigger variants of peg piles, balanced around storage, rather than crafting. These were only added for large pegs.
  • make the piles for small and medium sized pegs look like a shelve when stacked. This whay, ā€˜stacks of pegsā€™ are not necessary for these sizes like they are for the large pegs. (Also, thanks @BrunoSupremo for his help with this.)
  • restored all i18n() references. All texts (descriptions, flavortexts etc) are now read from the locales file.
  • removed references to big piles related to harvesting piles
  • changed the model_origin for uncentered models (its center being a seam, and not a voxel)
  • removed invisible voxels (from different layers in the voxel editor)

Changes in v3.0

  • added piles of pegs
  • changed big piles into large piles
  • changed to crafting pegs in batches at a time
  • had a pass on the monetary value of the pegs
  • had a pass on all collison boxes
  • removed the collision boxes of small and medium pegs, so hearthlings can now walk on top of them. (they also canā€™t hit their toes to them anymore)
  • probably some more small stuff.

Changes in v2.1

  • fixed bug where some models werenā€™t showing properly.

Changes in v2.0 beta

  • Added two sets of pegs, a clay set and a stone set
  • Pegs now mark territory
  • fixed bug where the pegs were displayed with an undefined item category.

:warning:For those who update from earlier versions:
The name change will force you to delete all pegs from your worlds when updating. The game will be searching for pegs with the prefix [Add][Model]Peg_Planning_mod, but it wonā€™t find any, scince all are called Peg_planning_mod:ā€¦. You can choose not to delete them, but then youā€™ll be stuck with errors of the game swearing that those damn pegs were here just a minute ago. Sorry for this.

Planned features
My vision of the mod is complete. I donā€™t suspect that it will need work (other than bugfixes, and compatibility updates), but I am open to all kinds of feedback.

I hope that this will be useful, and that you have fun using it. :smiley: Please let me know if it came in handy.

10 Likes

yay for building planning tools. thanks! will report back if i find any issues!

1 Like

great idea for a mod! good job @nikosthefan :merry: :

I never knew I wanted this until I saw itā€¦ but holy butts this is a brilliant idea!

In the past, Iā€™ve used a trick I picked up in other games to get a similar effect: a stockpile with the filter set to ā€˜nothingā€™ to mark out the floorplans of larger/more elaborate construction projects. Of course, Stonehearth is a bit easier to work with than other games Iā€™m used to since you can create your building as a blueprint and then start construction at your leisure, but having too many blueprint ghosts active can still cause problems.

These pegs are great as little markers, and very thematic, so they actually add to the story of the town. They go beyond a simple reminder that something will be built there, they actually imply construction and growth in progress ā€“ your town is making plans to expand, not just you as a player but the townfolk themselves know that theyā€™re building up something larger over time.

I love this mod to bits!

2 Likes

Thank you all for the compliments. :slight_smile: I am working on version two and making good progress.

1 Like

Version 2.0 beta

download
at the first post


This version adds in a set of clay pegs and a set of stone pegs. I also fixed the bug where the items showed up with an unidentified category name in the ā€œplace furniture menuā€. The pegs now also mark territory.

why is it beta?
I have found another bug I need to squash. The models of the medium stone peg, the medium stone peg iconic and the small stone peg iconic are not showing, for some reason. Edit: It was that the models had voxels on different layers. It has been fixed for next patch.

Version 2.1

download
at the first post


This version fixes a the remaining bug where some models werenā€™t showing correctly. The mod should now be bug-free

Version 3.0

download
at the first post

This version adds peg piles. Scince you can get multiple pegs out of one lump of material, you now need to craft a batch (read: said piles) of pegs, instead of the pegs themselves.

how to install the mod

  1. put the downloaded folder into the stonehearth/mods folder.
  2. start the game

how to update the mod from v2.1

  1. Delete all big pegs (big pegs are not anymore in the mod, they are large pegs now.
  2. Cancel all peg-crafting activity. Pegs now need to be crafted in batches, so all those individual-peg recipes will not be there anymore after the update.
  3. Install the mod as detailed above.

feedback
If you have any feedback about the balancing or capacity of the piles, the feedback is welcome. Especially feedback about how many you typically need to store all the pegs you use in a playthrough, is especially valuable.

4 Likes

My first mod is finally complete :smiley: YAY. Here is the new version of it:

City Planning With Pegs. version 4.0

Download v4.0
at the first post


In this update, I added the ability to pile pegs together in amounts which are useful for storage. The earlier piles where balanced around how many pegs a crafter could make out of one wood/stone/clay resource.
The new stacks are either multiple piles, stacked on top of one another (as seen in the picture), or a new model altogether (which is only for large piles). I tried to keep the amount of extra models and recipes small with that move.
I also made the mod translatable and polished it up here and there.

Changes in v4.0

  • added stacks of pegs, the bigger variants of peg piles, balanced around storage, rather than crafting. These were only added for large pegs.
  • make the piles for small and medium sized pegs look like a shelve when stacked. This whay, ā€˜stacks of pegsā€™ are not necessary for these sizes like they are for the large pegs. (Also, thanks @BrunoSupremo for his help with this.)
  • restored all i18n() references. All texts (descriptions, flavortexts etc) are now read from the locales file.
  • removed references to big piles related to harvesting piles
  • changed the model_origin for uncentered models (its center being a seam, and not a voxel)
  • removed invisible voxels (from different layers in the voxel editor)

I hope that this will be useful, and that you have fun using it. :smiley: Please let me know if it came in handy.

5 Likes

Hello i love this mod for multiple reasons, planning out the first floor of a building, being able to train crafters while sacrificing very little in terms of resources, being able to profit off of the pegs i have them craft. etc However i must say itā€™s very frustrating to see ā€œbatch of large clay pegsā€ listed in the crafting list but the normal singular large clay peg is NOT there in the crafting menu, which is required to craft the large batch. Also i canā€™t craft ANY single sized peg on itā€™s own. none of them are available in the crafting menu. Is this an error or on purpose? why are the batch of pegs listed twice? from what i can tell one of them is meant to be purely decorative and nothing more while the other is meant to be functional??? am i correct? wrong? and why isnā€™t the single pegs listed?

oh, I think this is a disconnect between what I know and what the player knows. oops :sweat_smile: Here is an explanation:

  • The reason that you canā€™t craft a singular peg, is that a carpenter can create way more than one peg out of a wooden log. Pegs are so small that a carpenter could make a batch of them out of one log, hence the ā€œBatch of Pegsā€.
  • These batches are basically log piles, but then pegs and a different amount of them. To get an individual peg, you do the same as when youā€™d want to turn a log pile into a buch of individual logs, by placing down and harvesting the pile. (donā€™t do this when a peg pile is stacked on top of another, it might break, i think)
  • The two recipeā€™s actually ā€˜pointā€™ to the same item, that same batch of pegs. However one, found in storage, piles individual pegs up into a batch, while the other, found in building parts, crafts a batch out of some resources.

So in short,

  1. you need to craft a batch out of resources first (recipe in building parts)
  2. then you need to take the batch apart (harvest like you would a log pile)
  3. then you can repack them to a batch again (recipe in storage)

When I made this, I thought it made sense (I even dropped hints in the recipe descriptions of the crafted batches), but that doesnā€™t say anything cuz i made it, so of course I would understand. Thanks for letting me know, I will try to think of a more explicit way to say what is what.

2 Likes

I must be doing something wrong because I canā€™t get this mod to work ^^ā€™'
I dragged the unzipped folder into the Mods Folder then in the main menu of the game I go to settings. Then I go to the mods and try to check ā€œ[Add][Model]Peg_Planning_modā€ but when I hit Okay, nothing happens. If I go back to the menu, it is back to being unchecked.

you should not unzip the download, just rename it to .smod instead of .zip, then it should work :slight_smile:

You can do both way, you can unzip it or just renamed to smod.
That is not the problem.

The problem is the name of the mod. It has symbols that mess with the UI, like blocking the ok button.

I wonder why there is such a batch of new mods that are insisting in adding brackets and other symbols into their names. Not only it bugs the game, but it looks bad and is less readableā€¦

2 Likes

:sweat_smile: ā€¦ my bad ā€¦ :sweat_smile: sorry

I thought it was a good habit to put those labels in front. The idea was that it would function as a self sorting mechanism in the mods directory, using the fact directories sort their folders in alphabetical order. In practice it should group all biome mods together, if the same labels were used.

I will remove it from all my mods, seeing as it bugs out the game.


Having said that, I am curious as to which characters (that are easily available on the keyboard of course) will cause problems with the engine.

I assume I canā€™t just change the file name myself XD probably would mess with the code right?

Maybe not. Try it. If it was not working before, the worst thing that can happen is it keep not working.

1 Like

When I rename to file where I changed the extension, I get the message ā€œInvalid Manifestā€ in the mod tab.
If I rename the folder that I unzip, it can be checked but the mod is broken once in game.
Ah well, I can just wait until the download is fixed ^^

@nikosthefan I hate to bother but is there any kind of ETA for the updated mod? Iā€™m super to excited to give it a try and I would edit all references to the file name but I donā€™t know how to ^^ā€™ā€™

What do you mean by ETA, I donā€™t know what the abbreviation is.

ETA = Estimated Time of Arrival

Oh, ok. Well, I donā€™t know how much time it will take. I need to fix all three of my mods, and some have more problems/things I wanna add than others. First on the list is the name change of ClearSky, which should be very easy to do. Then this mod is on schedule. I need to do the name change, and I want to try something I found on the forum to make the peg crafting process easier.
I think it will be done within a week (Iā€™ve also got college to attend), but it is always tricky talking about release dates, so keep that in mind.

2 Likes