News:

Welcome to World of Banished!

Main Menu

Packaging problems

Started by scoutae4, October 13, 2023, 05:25:24 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

scoutae4

Hi all! I am putting the finishing touches on the ModKit installation tutorial and I hit a snag. To test the installation I want to show how to build the Apiary example included in the kit in steps, and inside a MyMods folder (to show best practices and also to help with understanding of how a mod is constructed.) I think my code is good, but I can't get it to package ...

This builds nicely:

..\..\bin\x64\Tools-x64.exe /build ApiaryResources.rsc:resource /pathres ../MyMods/Apiary /pathdat ../MyMods/Apiary/bin 

Game loads with the Apiary nicely:

..\..\bin\x64\Application-x64-profile.exe /ref ApiaryResources.rsc:resource /pathres ../MyMods/Apiary /pathdat ../MyMods/Apiary/bin

however I think I'm missing some files in the bin (image attached)

And lastly, the package won't complete:

..\..\bin\x64\Tools-x64.exe /mod Package.rsc:Apiary /pathres ../MyMods/Apiary /pathdat ../MyMods/Apiary/bin

The warning I get is Failed to load resource 'C:BanishedKit\MyMods\Apiary\bin\Package_Apiary.crs'

Am I making a stupid mistake somewhere, or is it more complicated since I moved the the files from the "example" folder?



kid1293

Where is the Package file? The program searches for an entry 'Apiary' in the package file.
What I can see is that you renamed Apiary.rsc to Apiary_apiary.rsc. No good.

scoutae4

Hi Kid! Yes this is what I am asking - where is the Package file? Why isn't it generating properly from the /build code?

QuoteWhat I can see is that you renamed Apiary.rsc to Apiary_apiary.rsc. No good.
I didn't... did you mean the Apiary_apiary.crs file? I *think* that file is supposed to be there. The only thing I renamed is the "building" folder to "Apiary" when I moved it from BanishedKit/example/building to BanishedKit/MyMods/Apiary. In relocating the folder I broke a connection somewhere. Oh well, I will keep digging.  :)

kid1293

The Package file is with the other files in the examples folder.

scoutae4

Maybe I am not understanding something: when I run the batch files for the mod examples you shared with me (for example), the bin folder is generated and includes the, "Package_NameOfMod.crs" file automatically. This exercise has taught me that this file is necessary to create the Package. :) For some reason, that file is not being automatically created when I relocate the "building" (apiary) folder to a new place, and therefore it won't create the pkm file. I don't know why it fails, but clearly this is not a good example for me to include in the tutorial.

I can create the apiary mod and package files without any problems if I leave them where they are in the ModKit as is and create the batch files right in the root folder following the developers guide BUT I don't think that's how you should structure your mod work. Seems like it would get very messy very fast.


kid1293

Did you forget to change any paths to point to the correct place?
In the files I sent you only have one .bat file with the two lines needed for compiling and packing.
Look at those and see if you have a path reference.

kid1293

You must have missed to copy the package file.
The only other explanation is a wrong written .bat file.

scoutae4

#7
I copied the entire folder so if it must be my .bat file, that must be solvable! I was using Discrepancy's Build, Run, Package examples from his house tutorial because I wanted to copy that structure (BanishedKit/MyMods/NameOfMod) and also because it breaks down the code which makes it easier to isolate your mistakes when you're a Jon Snow know nothing like me ;)

One thing I have been wondering is that most modders have ":resource" included in their Build code and the developer does not?

** this is corrected since I found my mistake - first line is the developer's code, second is the Discrepancy example, and last is what I will include with the tutorial **

bin\x64\Tools-x64.exe /build apiaryResources.rsc /pathres ../example/building /pathdat ../example/building/bin
..\..\bin\x64\Tools-x64.exe /build SmallTownHomeResources.rsc:resource /pathres ../MyMods/SmallTownHome /pathdat ../MyMods/SmallTownHome/bin
..\..\bin\x64\Tools-x64.exe /build apiaryResources.rsc:resource /pathres ../MyMods/Apiary /pathdat ../MyMods/Apiary/bin

bin\x64\Application-x64-profile.exe /ref apiaryResources.rsc /pathres ../example/building /pathdat ../example/building/bin
..\..\bin\x64\Application-x64-profile.exe /ref SmallTownHomeResources.rsc:resource /pathres ../MyMods/SmallTownHome /pathdat ../MyMods/SmallTownHome/bin
..\..\bin\x64\Application-x64-profile.exe /ref apiaryResources.rsc:resource /pathres ../MyMods/Apiary /pathdat ../MyMods/Apiary/bin

bin\x64\Tools-x64.exe /mod Package.rsc:apiary /pathres ../example/building /pathdat ../example/building/bin
..\..\bin\x64\Tools-x64.exe /mod Package.rsc:SmallTownHome /pathres ../MyMods/SmallTownHome /pathdat ../MyMods/SmallTownHome/bin
..\..\bin\x64\Tools-x64.exe /mod Package.rsc:apiary /pathres ../MyMods/Apiary /pathdat ../MyMods/Apiary/bin

scoutae4

#8
Oh my gosh... *forehead slap* I figured it out... I capitalized the first letter in Apiary when is should have been lower case apairy  ::)

I am still curious about the ":resource" naming structure though if anyone know why this is the norm now! with/without seemed to work with this mod

kralyerg

If you don't put :resource, it will default to :resource, so it doesn't really matter if you put it there or not.

If you open the file apiaryResource.rsc, the first line says "ExternalList resource".

Putting :resource in the command tells the compiler to look in that file for the ExternalList named "resource".

You could technically name it anything you want, as long as the word behind the : colon, and the word after ExternalList is exactly the same.

scoutae4

Ok thank you very much @kralyerg and of course, always, @kid1293 for your help. I think I will include the ":resource" in the tutorial since almost every mod example I have seen has it.