News:

Welcome to World of Banished!

Main Menu

Executable Batch File

Started by FlyingDutchman, September 26, 2019, 04:20:55 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

FlyingDutchman

These executables, compiled batch files, can be used for building and packaging all your mods. The attached ZIP-archive contains both a 64-bit and a 32-bit version.

How to use

Before using the executable batch files, please carefully read the Requirements!

Copy the executable (bp32.exe or bp64.exe) to the base folder of your mod. Run the executable (in the Command Prompt) with the following command line:

   bp64 modName
or
   bp32 modName

where modName is the name of your mod.

Requirements


  • The first line in Package.rsc should be PackageFile modName
  • If you are using an additional resource file, containing the ExternalList and External declare types, this resource file should be named: modNameResources.rsc
  • If you don't use this additional resourcefile, but instead declare the externals inside your Package.rsc, the ExternalList declare type should be declared as: ExternalList list
  • Your base mod folder should be a subfolder of your Banished Toolkit folder and should be named: modName
  • Be sure to include referenced vanilla resource files in their appropriate folders
  • Both executables can only be used with Windows 7 or later

Why these requirements?

These requirements are necessary to prevent the use of too many parameters in the command line. It also enables you to use one single executable batch file for building and packaging all your mods and it forces you to be consistent in naming your mods and declare types.

Warning

You cannot use these executables for building and packaging the examples from the Banished Toolkit as the examples do not meet the above requirements. If you want to do so, you will have to move the mod folders in the example folder to your Banished Toolkit folder and do some renaming of folders and declare types until the requirements are met.

Example

To build and package the whiteChicken example, move the Animal folder to your Banished Toolkit folder. Rename the Animal folder to whiteChicken. There is no need to rename the declare types in Package.rsc and whiteChickenResources.rsc. Open the Command Prompt and enter the following command line:

   bp64 whiteChicken

Another example

The translation example doesn't use a seperate resourcefile. Move the translation folder to your Banished Toolkit folder. Alter the first line in Package.rsc to PackageFile translation. Enter the following command line in the Command Prompt:

   bp64 translation

In both examples bp64.exe should be copied into the whiteChicken and the translation folder. Instead of the 64-bit version you could also use the 32-bit version.

Command Prompt

When activating the Command Prompt it usually opens in C:\Users\yourUserName. If you want the Command Prompt to open in your Banished Toolkit folder, click Start, select All Programs, select Accessories, right-click Command Prompt and choose Properties. In the Command Prompt Properties dialogue window select the Shortcut tab and change the Start in: value to the pathing of your Banished Toolkit folder (see the following image).



EDIT: After installing Windows 10 yesterday, I found that this option is no longer available. Instead you can create a small batchfile with the following contents:

    cmd /k cd [path to your Banished toolkit folder]

e.g.: cmd /k cd c:\BanishedToolkit