Banished

File information

Last updated

Original upload

Created by

Zookes

Uploaded by

Zookes

Virus scan

Safe to use

Documentation

Readme

View as plain text

@ECHO off
ECHO========================
ECHO BEGIN
ECHO========================
REM WARNING: KEEP THIS FILE HANDY WHILE YOU WORK. It contains valuable information and useful macros for easier editing of your mod.

REM As you can tell from the strange formatting, this README is a batch file in disguise. Batch files can be read and edited
REM in any plain text editor, so go ahead and rename the file from .txt to .bat or make a new .bat yourself and copy this
REM file's contents into it, then right-click and open with a text editor (like notepad) to continue reading the next section.


REM==============================================
REM TESTING THE SKIN
REM==============================================
REM Place the CitizenSkinTemplate folder, which contains this README, in the root of the modkit installation (other folders you
REM should see here are "bin" and "example"). If it's in the correct directory, all the following steps will work.
REM Keep the README inside CitizenSkinTemplate. You may have to close out your text editor to make the move.

REM The following instructions are only valid if you've renamed this README to a .bat file. Otherwise, edit another .bat containing
REM this text if you created one, or go on ahead and enter all the relevant information manually in the correct .rsc files if you
REM already know how all this works.

REM When you're ready to test the mod, double-click the README.bat to execute it. The process should not err, but in case it does,
REM a PAUSE command has been added to the end of this file for your debugging convenience.

REM After creating the binaries and packaged mod file, the game will run, and you can enable the mod as usual to test it.
REM In-game, you should see some very brightly colored people and no trace of human skin tone. This means the mod works.


REM==============================================
REM MODIFYING THE SKIN
REM==============================================
REM Photoshop files are provided with guide layers and examples for your convenience as well as a very colorful map of the
REM model's body parts to help you determine how areas of the texture correspond to areas on the in-game model.

REM The typical skinning procedure is as follows:
REM 0) open the .psd files and start editing the textures
REM 1) make and save** some modifications to the textures
REM 2) run this README.bat
REM 3) look at the results in-game
REM 4) quit the game, and either go back to 1) or call it done and publish.

REM **save your newly edited texture file in .png format to Models/Citizen/MaterialInstance and overwrite either
REM FemaleCitizen.png or MaleCitizen.png, whichever one you've just modified.


REM==============================================
REM PUBLISHING YOUR SKIN
REM==============================================
REM When you've finished making your skin, there are certain attributes you can customize about it, such as its name, your
REM name (the author), a fitting description, and the name of the mod file.

REM First, to change the name of the mod, simply change "Citizen Skin - Template" below to anything you like within quotes.
REM This is what will appear to you and other users in Banished when selected at the mod menu. Spaces and special characters
REM are safe.
REM Example: change "Citizen Skin - Template" to "The Greatest Skin Ever Made!"

SET string_name="Citizen Skin - Template"


REM To claim authorship of the mod, change "Zookes" below to your name within quotes. Spaces and special characters are safe.
REM Example: change "Zookes" to "Me, I made this skin!"

SET string_author="Zookes"


REM To give your mod a description, change "Make a citizen skin of your own!" to any string of letters you so desire within quotes.
REM Example: change "Make a citizen skin of your own!" to "This is my skin for personal use only - if you have this, you're a
REM dirty thief."

SET string_desc="Make a citizen skin of your own!"


REM When you're ready to rename your mod's file, simply change CitizenSkinTemplate below to anything you want within quotes.
REM For example, if you want your mod to be named MySkin, change CitizenSkinTemplate to MySkin.
REM WARNING: DO NOT USE SPACES OR SPECIAL CHARACTERS HERE, IF YOU DO, THE MOD WILL NOT COMPILE (underscores and hyphens are
REM acceptable).

SET string_mod="CitizenSkinTemplate"


REM If you're updating the mod and want to change the version number, you can do so here.
REM Use natural numbers only, letters and decimals probably won't show up.

SET string_ver=1


REM Don't forget to make your own icon.png and preview.png!
REM The pixel size of the icon is 48x48, the preview is 512x512.


REM==============================================
REM DISTRIBUTING YOUR SKIN
REM==============================================
REM When you have finished your skin and you're ready to unleash it upon the world, run this batch file one last time to apply
REM your final changes to the mod file, and you'll find your mod's .pkm in the very same folder as this README.

REM That .pkm file is the finished mod, ready to be shared and used by all.

REM Have fun!

REM==============================================
REM END OF TUTORIAL AND CONFIGURATION
REM==============================================

REM Everything beyond this point is part of the batch script used to build and compile your mod based on the settings you
REM picked earlier. It's a very good idea NOT to alter anything below unless you're familiar with Windows batch file scripting.

REM ... but if you're feeling curious, make a copy and play with it. Batch files are pretty fun.





REM A few variables for advanced users:
SET update_strings=true REM anything but 'true' will skip the .rsc file update; textures will still be compiled
SET pref_bitness=0 REM any value other than 32 or 64 will do nothing
SET run_after_build=true REM anything but 'true' will prevent Banished from being auto-launched
SET grab_rename_pkm=true REM anything but 'true' will prevent the .pkm file from being copied over from WinData





REM==============================================
REM AUTOBUILD SCRIPT
REM==============================================

SET string_safe_name=NewSkinMod

IF %update_strings% == true (
ECHO Updating Package.rsc...
(
@ECHO PackageFile %string_safe_name%
@ECHO {
@ECHO String _name = %string_name%;
@ECHO String _author = %string_author%;
@ECHO String _description = %string_desc%;
@ECHO String _icon = "icon.png";
@ECHO String _preview = "preview.png";
@ECHO int _userVersion = %string_ver%;
@ECHO.
@ECHO String _includeList
@ECHO [
@ECHO "*"
@ECHO ]
@ECHO.
@ECHO String _excludeList
@ECHO [
@ECHO "Package_*.crs"
@ECHO "*.pkg"
@ECHO "*.pkm"
@ECHO ]
@ECHO }
) > Package.rsc

ECHO Updating %string_safe_name%.rsc...
(
@ECHO ExternalList resource
@ECHO {
@ECHO External _resources
@ECHO [
@ECHO "Models/Citizen/MaterialInstance/CitizenTexture.rsc"
@ECHO "Models/Citizen/MaterialInstance/CitizenTextureF.rsc"
@ECHO ]
@ECHO }
) > %string_safe_name%.rsc
) ELSE (
ECHO Package.rsc strings will not be updated while update_strings != true on line 111.
)
@ECHO.

REM Select bitness for optimal tooling.
REM SET pref_bitness_flag=false
IF %pref_bitness% == 32 (
ECHO Preferring 32-bit environment.
SET bitness=32
REM SET pref_bitness_flag=true
GOTO tooling
)
IF %pref_bitness% == 64 (
ECHO Preferring 64-bit environment.
SET bitness=64
REM SET pref_bitness_flag=true
GOTO tooling
)

SET RegQry=HKLM\Hardware\Description\System\CentralProcessor\0
IF NOT EXIST "AUTOBUILD" MKDIR AUTOBUILD
REG.exe Query %RegQry% > AUTOBUILD/CheckOS.txt
Find /i "x86" < AUTOBUILD/CheckOS.txt > AUTOBUILD/Match.txt
IF %ERRORLEVEL% == 0 (
ECHO Detected 32-bit OS.
SET bitness=32
) ELSE (
ECHO Detected 64-bit OS.
SET bitness=64
)

REM REG.exe has strange behavior in conditionals, so here's the jump
:tooling
FOR %%* IN (.) DO SET this_folder=%%~nx*
ECHO Using %bitness%-bit tools.
@ECHO.
..\bin\x%bitness%\Tools-x%bitness%.exe /build %string_safe_name%.rsc /pathres ../%this_folder% /pathdat ../%this_folder%/bin
@ECHO.
..\bin\x%bitness%\Tools-x%bitness%.exe /mod Package.rsc:%string_safe_name% /pathres ../%this_folder% /pathdat ../%this_folder%/bin
@ECHO.
IF %run_after_build% == true (
ECHO Launching Banished %bitness%-bit.
@start ..\bin\x%bitness%\Application-x%bitness%-profile.exe
) ELSE (
ECHO Banished will not auto-launch while run_after_build != true on line 113.
)

REM Grab and rename the .pkm file from WinData for convenience.
IF %grab_rename_pkm% == true (
SET string_mod=%string_mod:"=%
COPY /B /V "..\bin\WinData\%string_safe_name%.pkm" "%string_mod%.pkm" >nul
@ECHO.
ECHO Copied %string_safe_name%.pkm from WinData as %string_mod%.pkm.
) ELSE (
@ECHO.
ECHO Mod file will not be copied while grab_rename_pkm != true on line 114.
ECHO Mod file is %string_safe_name%.pkm in modkit/bin/WinData
)

ECHO========================
ECHO DONE
ECHO========================
PAUSE