Jump to content
catty-cb

Adding a new crop into Banished

1 post in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

This example adds a new crop to fields. In this case the crop is lettuce. If you want to build and test the mod...

bin\x64\Tools-x64.exe /build lettuceResources.rsc /pathres ../example/crop /pathdat ../example/crop/bin

You should now be able to run the game and see that lettuce can now be used when you plant crops in a field. You'll most likely want to enable debug mode to be able to use the lettuce seeds before buying them from a trading post. You'll have to copy the toolbar resource (from the previous example) into the /example/crop/Game folder so that you can enable debug mode. The debug menu is available from the Tools & Reports menu item. There's an icon of a bug on it. When you bring up the debug dialog, there's a button to give all seeds to the player. Just hover over the buttons and read the tooltips.

Before giving a mod to others, make sure you've turned the debug option off if it isn't your intent to leave it enabled.

Before the mod is packaged, you have to explicitly tell the game to load the resources using the /ref parameter.

bin\x64\Application-x64-profile.exe /ref lettuceResources.rsc /pathres ../example/crop /pathdat ../example/crop/bin

Start a new game, and use the debug menu to give all seed types to the player. Then place a crop field - you should be able to select Lettuce as the crop. This crop works like any other.

You can build the mod into a package like so:

bin\x64\Tools-x64.exe /mod Package.rsc:lettuce /pathres ../example/crop /pathdat ../example/crop/bin

To test the mod by itself, you can run the game forcing it to only use packages.

bin\x64\Application-x64-profile.exe /onlypkg

The game should have the new mod listed in the Mods dialog and you can enable it.

If you've been working through all these examples, you can see you can load multiple mods at once. You can start a game with both the lettuce mod and the apiary mod.

General steps for adding a new crop

  1. You'll need to model two objects. One for this display of the crop in the field, and one for the crop when it is harvested.
    • See /example/crop/Models/Lettuce.fbx
  2. Like in the building example you need to build Textures, Materials, and Meshes for the objects. The process is the same.
    • See /example/crop/Models/MaterialInstance/Lettuce* and LettuceLeaf*
    • See /example/crop/Models/LettuceLeafMesh.rsc and LettuceLeaf.rsc
  3. Like in the building example you need to build String Tables and Sprites.
    • See /example/crop/UI/CropSpriteSheet.rsc
    • See /example/crop/UI/CropStringTable.rsc
  4. Finally you'll have to make entity definitions (again, similar to the building example)
    • See /example/crop/Template/NaturalResourceLettuce.rsc
    • See /example/crop/Template/RawMaterialLettuce.rsc
  5. To package and reference the new entities, you'll need a package resource and a list of referenced objects.
    • See /example/crop/lettuceResources.rsc
    • See /example/crop/Package.rsc

preview.jpg


  Edited by catty-cb  

Banished Toolkit 1.0.7

Share this post


Link to post
Share on other sites

×

Thank You for the Continued Support!

Simtropolis depends on donations to fund site maintenance costs.
Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

Make a Donation, Get a Gift!

Expand your city with the best from the Simtropolis Exchange.
Make a Donation and get one or all three discs today!

STEX Collections

By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

Each donation helps keep Simtropolis online, open and free!

Thank you for reading and enjoy the site!

More About STEX Collections