The following warnings occurred:
Warning [2] session_start(): open(/opt/alt/php73/var/lib/php/session/sess_361ffcb27deae913ffba7e632aa88860, O_RDWR) failed: Disk quota exceeded (122) - Line: 415 - File: inc/plugins/myfbconnect.php PHP 7.3.20 (Linux)
File Line Function
[PHP]   errorHandler->error
/inc/plugins/myfbconnect.php 415 session_start
/inc/class_plugins.php 142 myfbconnect_global
/global.php 100 pluginSystem->run_hooks
/showthread.php 28 require_once
Warning [2] session_start(): Failed to read session data: files (path: /opt/alt/php73/var/lib/php/session) - Line: 415 - File: inc/plugins/myfbconnect.php PHP 7.3.20 (Linux)
File Line Function
[PHP]   errorHandler->error
/inc/plugins/myfbconnect.php 415 session_start
/inc/class_plugins.php 142 myfbconnect_global
/global.php 100 pluginSystem->run_hooks
/showthread.php 28 require_once




Mod base game buildings
#1

I need help with modding base game buildings, like changing the vale of how much the Storage Barn can hold, eg from 6000 to 10000. The problem is, I'm not entirely sure how to do it, I was able to mod the raw materials files and pack them, but when trying to get an idea from the Banished kit with the Apiary, its like it was designed to make a whole new building from scratch. So could anyone give me any ideas, screenshots or even a simple walk through that could help me, I would appreciate it. Thank you. 

  Reply
#2


In the resource section of the mod kit, find the template for the building you want to change and copy it into the '*yourmod*/Template' folder. 




You can do two things.




1 - you can either edit the part you want to change and leave the rest of the template as it is, then in your *yourmod*resources.rsc file you list 'Template/StorageBarn.rsc'. Then compile it, and it will 'rebuild' the barn with the new numbers but use everything else from the resource pack. 




2 - you can change the part you want, in this case scroll down to the 'StorageDescription storage' section, change the storage value, then delete everything else in the template file so it looks like this...



Code:
StorageDescription storage
{
    RawMaterialFlags _storageFlags = Edible | Tool | Health | Clothing | Textile;
    bool _areaBasedLimit = false;
    bool _available = false;
    int _volumeLimit = 6000;
}



Then, in your resources.rsc you list 'Template/StorageBarn.rsc:storage" and nothing else. Compile, and it will rebuild just that section of the storage barn code, and when you play with the mod it will overwrite only that section and nothing else. 




 




Both will work to change the numbers in the barn, and you can do the same to any building. 




 




If you do change the storage barn, make sure you use the template file that has the new 1.0.7 flags. If you don't it won't work with new resources. The files in the modkit resource folder do not have the new things added to them, so you need to do that yourself. Hopefully this will change with the next banished release when it comes out of Beta.




 




Here is the code for the new flags, notice that the capacity has also been increased.




 



Code:
StorageDescription storage
{
    RawMaterialFlags _storageFlags = Edible | Tool | Health | Clothing | Textile | Grain | Vegetable | Fruit | Protein | Custom0 | Custom1 | Custom2 | Custom6 | Custom7 | Custom8 | Custom9;
    bool _areaBasedLimit = false;
    bool _available = false;
    int _volumeLimit = 7500;
}



And this is what the *yourmod*resources.rsc will look like...



Code:
ExternalList resource
{
    External _resources
    [
        "Template/StorageBarn.rsc:storage",
    ]
}



 


  Reply
#3

Thank you so much. It worked brilliantly.

  Reply
#4

Great stuff! And welcome to the modding community [img]<fileStore.core_Emoticons>/emoticons/smile.png[/img]/emoticons/smile@2x.png 2x" title=":)" width="20" />
  Reply