World of Banished

MODS Garage => Tips and Help => Topic started by: JusticePrevails on June 09, 2018, 12:42:17 AM

Title: Simple Modding attempt [advice and feedback please]
Post by: JusticePrevails on June 09, 2018, 12:42:17 AM
So I'm getting into the groundwork of modding.  I want to be able to change simple things to build up my skill.
Primarily I'm having trouble figuring out what does what within the modkit files.

What I'm trying to do :

1) I want to do something similar to the 1:1 aging mod, but with my own values and tweaks.
-how are the ages implemented within the documentation [I've found where the value goes but don't understand what it means]
-is there any way to open up another mod to look at the way it handles the coding for comparison?

2) Increase the number of citizens per house without changing the texture.  Just the values of what the house can hold.
-increase number of citizens
-increase amount of food/fuel required for comfort

I'm hoping since these just deal with numbers they'll be simple mods for me to do to begin my adventure in modding this wonderful game.  Also moved this from another location since I think it makes more sense to put it here.
Title: Re: Simple Modding attempt [advice and feedback please]
Post by: kid1293 on June 09, 2018, 03:32:11 AM
@JusticePrevails

Try this
http://worldofbanished.com/index.php?topic=1930.msg39182#msg39182

There is code you can use and a link to small discussion about values.
There is more, spread out in forum.

Welcome to fun and frustrating modding! :)
Title: Re: Simple Modding attempt [advice and feedback please]
Post by: JusticePrevails on June 09, 2018, 02:58:27 PM
thanks! @kid1293

Okay so my thoughts so far :

age is done in 1.0 intervals per five years.
Thus 1.0 is five years old.  That being so, would 1.5 then be 7-8 years old since 2.0 is 10 years?
I think getting my timing down is the first step.  If I'm right on how the timing for age goes and it is +5 years per 1 full point up.  Which is a great starting point.  The resource is really helping me, and for now I'm trying to get my thought process rolling.  Also I really appreciate how much time and effort you and all other modders take to work on these mods and even to help fledgling modders like me.  Knowing the tic for age, and how long a month is in game for my calculations was wonderful. So thank you for all your time and effort.

UPDATE!

So I got the string files editted and tested them in the debug version of the game.
Success! Now my next real question is what is the next step.  The Readme file that comes with the moddingkit is confusing to me and I don't understand.  How do i get it to be a pkm file and thus be able to use it in the game?

Title: Re: Simple Modding attempt [advice and feedback please]
Post by: RedKetchup on June 09, 2018, 05:23:40 PM
same as all other mods or example.

inside your BanishedKit folder (with no strange caracters) you have your mod folder : /MyAgingMod/ for example
inside you have a package.rsc filled with the name of your mod (.pkm) , the name and all the info that will appear in the mod window.

you will have a MyAgingModResource.rsc file with one link (or more) that point out the Folder/NameOfTheFile.rsc you edited like (Template/Citizens.rsc)
you will have 1 or more folder in your /MyAgingMod/ with all the files you edited and probably with some required files if the toolkit asks it.


and then you will have your .bat that is used to compile and package your mod. similar to this:

..\..\bin\x64\Tools-x64.exe /build MyAgainModResources.rsc /pathres ../MyAgainMod /pathdat ../MyAgainMod/bin
..\..\bin\x64\Tools-x64.exe /mod Package.rsc:MyAgainMod /pathres ../MyAgainMod /pathdat ../MyAgainMod/bin
Title: Re: Simple Modding attempt [advice and feedback please]
Post by: JusticePrevails on June 09, 2018, 07:27:35 PM
I have no idea what you mean.

I've got the .rsc files separated into a folder for easy use, but that's as far as I get.  How do I get them into a pkm format?  That's the part that I'm stuck at. 

First, you'll create a definition for the package (see /example/translation/Package.rsc)

PackageFile translationExample
{
   String _name = "Translation Example";
   String _author = "Shining Rock Software, LLC";
   String _description = "This mod changes the font from the default to Arial.
      It also modifies the default character set. All text strings
      are made uppercase and vowels have accents over them.";
   String _icon = "icon.png";   // must be 48x48
        String _preview = "preview.jpg"  // preview image used for Steam Workshop, must be square, png or jpg.
   int _userVersion = 1;

   // all files in resource directory (each item is searched recursively)
   String _includeList
   [
      "*"   
   ]
   
   // exclude package files, mod files, file used for building packages
   String _excludeList
   [
      "Package_*.crs"
      "*.pkg"
      "*.pkm"
   ]
}
----------------
I need to include two files, so where in this exactly am I supposed to add the information for those rsc files?  This is the example package that comes with the modkit for this code.
Title: Re: Simple Modding attempt [advice and feedback please]
Post by: RedKetchup on June 09, 2018, 08:19:18 PM
I have no idea what you mean.

lol thats not a good news for me LOL if you cant figure out that part by checking the examples :D


PackageFile translationExample <==== thats the name of the .pkm you want to create. a "translationExample" will make a "translationExample.pkm" file.
{
   String _name = "Translation Example";  <==== thats the name of the mod you will see in the mod window when you will gonna go enable it , thats the name you will see at your screen
   String _author = "Shining Rock Software, LLC";  <==== thats the name of the author you will see at your screen, YOU
   String _description = "This mod changes the font from the default to Arial.   <==== (along the 2 other lines) thats the description of your mod you will see at your screen in the mod window.
      It also modifies the default character set. All text strings
      are made uppercase and vowels have accents over them.";
   String _icon = "icon.png";   // must be 48x48  <==== thats the icon next to your mod name and author you will see in the mod window
        String _preview = "preview.jpg"  // preview image used for Steam Workshop, must be square, png or jpg.  <==== it is only used for steam workshop bug 512x512 image people will see in the workshop
   int _userVersion = 1;  <==== your internal version of your mod. usually =1 if thats the first version

   // all files in resource directory (each item is searched recursively)  <==== everything else you dont touch that.
   String _includeList
   [
      "*"   
   ]
   
   // exclude package files, mod files, file used for building packages
   String _excludeList
   [
      "Package_*.crs"
      "*.pkg"
      "*.pkm"
   ]
}
Title: Re: Simple Modding attempt [advice and feedback please]
Post by: RedKetchup on June 09, 2018, 08:31:58 PM
show me you integrated that part with a copy paste of your own file.
Title: Re: Simple Modding attempt [advice and feedback please]
Post by: JusticePrevails on June 09, 2018, 09:52:04 PM
like this?  And I'm sure it would make perfect sense if I had any concept of coding.  I really appreciate you taking the time to help me with this.

PackageFile agingmod
{
   String _name = "agingmod";
   String _author = "ChallengingReality";
   String _description = "this mod changes the age rate of birth of citizens";
   String _icon = "icon.png";
   String _preview = "preview.jpg";
   int _userVersion = 1;

   // all files in resource directory
   String _includeList
   [
      "*"   
   ]
   
   // exclude package files, mod files, file used for building packages
   String _excludeList
   [
      "Package_*.crs"
      "*.pkg"
      "*.pkm"
   ]
}
Title: Re: Simple Modding attempt [advice and feedback please]
Post by: RedKetchup on June 09, 2018, 11:07:02 PM
right ok

now with what you have written i assume....

your mod folder is name :

/Banishedkit/agingmod/

and inside that folder you have :

/Template/
agingmodResources.rsc
BuildAgingmod.bat
icon.png (maybe, not obligated but it is nice to have an icon instead a black 48x48 image)
Package.rsc
preview.jpg (maybe, not obligated, depend if you want to upload it on steam workshop and not having it black)

---------------------
inside your agingmodResources.rsc you should have something like this:

ExternalList resource
{
   External _resources
   [
      "Template/Citizen.rsc",
   ]
}

---------------------------------------------

and inside the /Template/ folder you have 1 file:

Citizen.rsc

a copy modified of the real Citizen.rsc template which contain all your changes

--------------------------------------------

and your BuildAgingmod.bat contains your DOS commands to compile it and package it :

..\..\bin\x64\Tools-x64.exe /build agingmodResources.rsc /pathres ../agingmod /pathdat ../agingmod/bin
..\..\bin\x64\Tools-x64.exe /mod Package.rsc:agingmod /pathres ../agingmod /pathdat ../agingmod/bin


Note: if happends you placed your mod inside the /Banishedkit/example/ folder, your path in your .bat need to reflect it by adding /example/ to it like:
..\..\bin\x64\Tools-x64.exe /build agingmodResources.rsc /pathres ../example/agingmod /pathdat ../example/agingmod/bin
..\..\bin\x64\Tools-x64.exe /mod Package.rsc:agingmod /pathres ../example/agingmod /pathdat ../example/agingmod/bin

Title: Re: Simple Modding attempt [advice and feedback please]
Post by: RedKetchup on June 09, 2018, 11:22:30 PM
and you should find your agingmod.pkm inside the /Banishedkit/bin/WinData/ folder. take it and put it in your real game WinData folder
Title: Re: Simple Modding attempt [advice and feedback please]
Post by: JusticePrevails on June 10, 2018, 05:49:52 PM
Figured out why it crashed the first time, now did everything step by step and for whatever reason the .pkm file is not showing up in the WinData folder.  I think the .bat file might not be done right, but I'm not sure.
Title: Re: Simple Modding attempt [advice and feedback please]
Post by: RedKetchup on June 10, 2018, 07:23:35 PM
and if you give us some pictures ? you know, i am not at your computer behind you and see what you see.
you know how to take pictures ? (keystroke printscreen and open paint.exe and do control+v, and save)

or put your code in a .zip and post here so we can check.
Title: Re: Simple Modding attempt [advice and feedback please]
Post by: JusticePrevails on June 10, 2018, 07:28:00 PM
yea sorry, sorry.  I had a moment.
Title: Re: Simple Modding attempt [advice and feedback please]
Post by: RedKetchup on June 10, 2018, 07:47:58 PM
first your .bat is totally wrong and also as said before never use a strange caracter for your toolkit, a space is a strange caracter, it only can lead to potential errors.

rename your toolkit folder to : \BanishedMods\
2nd: i dont see why you've put all this: C:\Users\Crump\Downloads\banished mods\ and your .bat is missing the /pathdat.. you only specified the /pathres .. not the /pathdat ..

your bat should be :

..\bin\x64\Tools-x64.exe /build mytestmodResources.rsc /pathres ../mytestmod /pathdat ../mytestmod/bin
..\bin\x64\Tools-x64.exe /mod Package.rsc:mytestmod /pathres ../mytestmod /pathdat ../mytestmod/bin

Title: Re: Simple Modding attempt [advice and feedback please]
Post by: JusticePrevails on June 10, 2018, 07:59:28 PM
because I am dumb.
That did it!  Thank you so much.  I apologize for my total ineptitude and inability to follow simple directions.  I swear I'm not normally this bad, I was just very nervous about trying it out and screwing it up badly.  I really appreciate you taking the time to help. 

I'm going to test this first little mod myself then move on to a few more 'test mods' until I get the process down.  After simple altering of values, what would you say is the next easiest type of modding?
Title: Re: Simple Modding attempt [advice and feedback please]
Post by: RedKetchup on June 10, 2018, 08:11:34 PM
between test i suggest you to take the habit to delete the folder \mytestmod\Bin\ between each changes to make sure you updated everything in your mod and start to compile from 0. if you let the \bin\ folder there it will only make partial update to it and sometimes it leads to bad things.

i personally use DOS commands in my .bat to automatically delete it before each compile, but i am not suggesting you yet till you will be experimented.


about next mod... bah you need to go with what you would like to have as mod... you need to keep yourself interested :)
Title: Re: Simple Modding attempt [advice and feedback please]
Post by: JusticePrevails on June 10, 2018, 08:54:58 PM
hmm, well for my own personal use I like pushing the limits of play-ability.  I like trying to feed a hoard of people at once and wondering how to house them all.  So harder scenarios, more people with fewer resources.  That kind of thing.

Also got a strange error.  Doing the exact same thing as the first mod, but when I compiled the pkm it gave me a 'testmodResources.rcs' doesn't exist.  Would you mind having a look and seeing one more time where I've gone wrong? 
Title: Re: Simple Modding attempt [advice and feedback please]
Post by: RedKetchup on June 10, 2018, 09:09:31 PM
in your testmodResources.rsc file you are calling :

      "Template/Citizen.rsc",

but when we check your \Template\ folder it contains : StoneHouse.rsc

or it is the wrong file in there.... or you need to change the call :

     "Template/StoneHouse.rsc",
Title: Re: Simple Modding attempt [advice and feedback please]
Post by: JusticePrevails on June 10, 2018, 09:12:17 PM
*head desk*
Thank you.  I swear I probably looked at the code a dozen times and still didn't see it.
Anyway after this I think I'll play some with scenarios.  Like I said, I enjoy making my bannies really work and struggle for their new life.
Title: Re: Simple Modding attempt [advice and feedback please]
Post by: RedKetchup on June 10, 2018, 09:14:12 PM
*head desk*
Thank you.  I swear I probably looked at the code a dozen times and still didn't see it.
Anyway after this I think I'll play some with scenarios.  Like I said, I enjoy making my bannies really work and struggle for their new life.


have fun :)

reminder: get yourself time to learn. Paris hasnt been made in one day :)
Title: Re: Simple Modding attempt [advice and feedback please]
Post by: JusticePrevails on June 10, 2018, 09:47:55 PM
I will thank you.  Right now I'm just testing what I have and writing down ideas for later.  I figure the more fleshed out the idea is, the more likely I am to want to return to it once I've finished the testing process for the first two mods.  Thanks again and you have a great day and happy modding.
Title: Re: Simple Modding attempt [advice and feedback please]
Post by: RedKetchup on June 11, 2018, 12:05:34 AM
happy modding.


sure do :)