Author Topic: How To ...  (Read 35104 times)

0 Members and 1 Guest are viewing this topic.

Offline Pangaea

  • Champion
  • Architect
  • *****
  • Posts: 568
Re: How To ...
« Reply #15 on: September 21, 2014, 09:13:11 AM »
me :

1. i do my changes
2. delete bin and build folders
3. launch my .bat in DOS window
4. look how it compiles
5. go in the 2 little Windows folder at top of my screen (kit bin windata and the game windata)
6. click and drag the .pkm from bin/windata to my game windata
7. launch the game with steam launcher
8. start a new game
9. check in game what i did
10. close the game

11+ rince and repeat. with more changes

I noticed the issue of not overwriting files in the bin folder too when trying to get to the bottom of this, so have also been deleting files there in between each buildmod attempt. I genuinely don't understand why that /build command does not work on my end. As long as including all the files I've changed in the ExternalList works, then that is good at least, but it would be nice if all those *.crs files were compiled by the /build command itself. That does not happen for me (without the list).


This is what I'm doing
1. Copy files I want to change into /mymods/newmod, retaining folder structure from /resource
2. Make the changes to the files
3. Delete /bin folder if present
4. Make sure paths are correct in Package.rsc, and include all files I have edited in ExternalList (okay now, but would be a nightmare in big mods). For example:
Code: [Select]
PackageFile orchard
{
    String _name = "orchard";
    String _author = "Pangaea";
    String _description = "Improves the lifespan of all orchard trees in the game. By default they live on average ~8 years. With this mod they should live ~20 years on average.";
    String _icon = "icon.png";
    int _userVersion = 1.0;

    // all files in resource directory
    String _includeList
    [
        "*"   
    ]
   
    // exclude package files, mod files, file used for building packages
    String _excludeList
    [
        "Package_*.crs"
        "*.pkg"
        "*.pkm"
    ]
}

ExternalList list
{
External _resources
[
"Template/NaturalResourceAppleTree.rsc:growth"
"Template/NaturalResourceCherryTree.rsc:growth"
"Template/NaturalResourceChestnutTree.rsc:growth"
"Template/NaturalResourcePeachTree.rsc:growth"
"Template/NaturalResourcePearTree.rsc:growth"
"Template/NaturalResourcePecanTree.rsc:growth"
"Template/NaturalResourcePlumTree.rsc:growth"
"Template/NaturalResourceWalnutTree.rsc:growth"
]
}
5. Run the .bat file (thanks you slink, as this finally works now)
Code: [Select]
..\..\bin\Tools-x64.exe /build Package.rsc:list /pathres ../mymods/orchard /pathdat ../mymods/orchard/bin

..\..\bin\Tools-x64.exe /mod Package.rsc:orchard /pathres ../mymods/orchard /pathdat ../mymods/orchard/bin
6. If everything worked well here, and I see all the *.crs files in the modded /bin folder and in the main WinData folder, then it should be ready to go
7. Run a *.bat file that only loads the *.pkms
Code: [Select]
bin\Application-x64-profile.exe /onlypkg8. There I check that the mod is available, and tick it and restart if it's not selected
9. Check in the game to see if the mod works as intended (for this orchard mod, that has taken many hours).
10. Close game, rinse and repeat.


I think that was all, and precise, but it's been many hours since I did it now, so maybe my jellyfish brain has forgot something already  ;D :-X

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 11152
Re: How To ...
« Reply #16 on: September 21, 2014, 02:41:13 PM »
i dunno.  my PackageFile DecorativeItems

my bat:

Code: [Select]
bin\Tools-x64.exe /build DecorativeItemsResources.rsc /pathres ../fence /pathdat ../fence/bin
bin\Tools-x64.exe /mod Package.rsc:DecorativeItems /pathres ../fence /pathdat ../fence/bin
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Offline Pangaea

  • Champion
  • Architect
  • *****
  • Posts: 568
Re: How To ...
« Reply #17 on: September 21, 2014, 02:52:52 PM »
Hmm. Could it be because you're making your own files, while I'm just editing existing files? I really don't know, but it's an odd one.

As long as @slink 's trick with list works, that is fine enough, though - at least I can create the pkm file now and the mods work, and at the end of the day that is what matters.

Offline slink

  • Founder
  • Banished Expert
  • *****
  • Posts: 1222
Re: How To ...
« Reply #18 on: October 09, 2014, 03:03:52 PM »
A note for makers of mods that create new items, as opposed to overrides, is that the name inside the package.rsc must correspond to the name of the mod you distribute.  Renaming won't work with mods that create new items.  This may or may not have been the case only since the most recent beta, but it is true now regardless.

Because of this, underscores can be used in mod names but not space should not be used.  Likewise disallowed are characters relating to the directory structure such as forward-slash, back-slash, and the period.

Offline salamander

  • Founder
  • Architect
  • *****
  • Posts: 624
Re: How To ...
« Reply #19 on: October 12, 2014, 05:40:39 AM »
From way back at the start of the thread:

I use another editor, in Administrator mode, for editing rsc files by simply clicking on them, so that is no problem.

@slink -- just out of curiosity, what editor are you using for the .rsc files?  Notepad is good for a lot of things, but something with a little more oomph would be nice.  Thanks.

Offline slink

  • Founder
  • Banished Expert
  • *****
  • Posts: 1222
Re: How To ...
« Reply #20 on: October 12, 2014, 05:49:05 AM »
I use a program called PFE, short for Programmer's File Editor.  I downloaded it just before the turn of the century.  It is freeware.


Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 11152
Re: How To ...
« Reply #21 on: October 12, 2014, 07:30:23 AM »
personally i open and associated .rsc to notepad :)
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Offline Pangaea

  • Champion
  • Architect
  • *****
  • Posts: 568
Re: How To ...
« Reply #22 on: October 12, 2014, 12:24:34 PM »
I like NotePad++. It's a great program, and has colour highlighting, so I like it better than normal Notepad for a bit more complex tasks. Admittedly there isn't colour highlighting for .rsc files, but I'm sure that could be associated if I bothered to go looking for it. The program is also free.

Offline salamander

  • Founder
  • Architect
  • *****
  • Posts: 624
Re: How To ...
« Reply #23 on: October 12, 2014, 12:33:05 PM »
Thanks to all who replied to the last question about editors.

And special thanks to @slink, whose tutorials  in this thread about override mods have been a great help.  @slink -- your opening posts here have been very helpful.  :)   My first attempt at a mod is an override, and probably pretty useless, but mirroring your examples made it much easier to understand what was going on.

Offline Bradley

  • Newb
  • *
  • Posts: 2
Re: How To ...
« Reply #24 on: November 30, 2014, 02:43:08 PM »
I am trying to follow you tutorial to learn how to mod, but i am stuck where you say to " Change the directory to banishedkit".

I am new to programming and have googled how to open the DOS, but i can't find a way to change the directory.

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 11152
Re: How To ...
« Reply #25 on: December 01, 2014, 12:34:39 AM »
cd <dir>

like:
cd banishedkit

or

cd mymods

depending where you put it
<dir> = the folder you want to go


if you need to swap drive you can do

d:

or e:
for example
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Offline slink

  • Founder
  • Banished Expert
  • *****
  • Posts: 1222
Re: How To ...
« Reply #26 on: December 01, 2014, 06:38:01 AM »
Sometimes the path must be designated from the root.  In that case the format is:

cd /whatever/whatever2/whatever3

The first "/" says to start from the root directory of that drive.  Otherwise the OS only looks in the current directory for the target.  The opening directory in Windows 7 for an admin level DOS window is \Windows\system32 which is not what you want.

Offline Bradley

  • Newb
  • *
  • Posts: 2
Re: How To ...
« Reply #27 on: December 01, 2014, 08:33:44 PM »
Thank you for the help.

I have a new problem now. When i run the override.bat i get this

An assertion failure has occurred. A crash dump has been saved.

Location: IO\TextReader.cpp(70)
Message: C:\Banmods\MyMod\modded\Package.rsc (0): error: Unexpected character '\' found!
Expression: false

Callstack:
Runtime-x64-profile.dll(0x00000000e8e7a733)
unknown(0x00000000fffffffe)
unknown(0x00000000001ed890)

I have tried the tutorial that a link was posted earier and have ran into the same problem when i run the package.bat

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 11152
Re: How To ...
« Reply #28 on: December 02, 2014, 03:13:51 AM »
copy paste your Package.rsc here
(there is a \ inside where there shouldnt be)
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 11152
Re: How To ...
« Reply #29 on: December 02, 2014, 04:07:22 AM »
The opening directory in Windows 7 for an admin level DOS window is \Windows\system32 which is not what you want.

personally my user account has admins rights. i dont use the 'admin account'

when i open c: command prompt i arrive here:

c:\Users\Michael

if we want to go back to c:\ we need to do :

cd ..
cd ..

each time you do cd .. to go back 1 folder closer to the root.
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .