World of Banished

MODS Garage => Tips and Help => Topic started by: Tawsag on September 11, 2017, 03:06:29 PM

Title: Getting IO\MemoryStream.cpp(75) error when packaging.
Post by: Tawsag on September 11, 2017, 03:06:29 PM
Hello all!

I've been working on a mini-mega mod  for about two years off and on.  I'm currently using the most recent beta modkit, and I can build and play just fine using the /ref command line.  Everything in game is fine,  just when I exit and try to package, I get this error.

I've read about this error being associated with fonts in the past, thing is, my mod makes no changes to the character set.

Looking for any help with this.
Title: Re: Getting IO\MemoryStream.cpp(75) error when packaging.
Post by: RedKetchup on September 11, 2017, 05:55:07 PM
can we get some screenshot of your folder structure ? .bat, package.rsc & Resources.rsc files ?
Title: Re: Getting IO\MemoryStream.cpp(75) error when packaging.
Post by: Tawsag on September 11, 2017, 06:46:36 PM
Here is my build.
bin\x64\Tools-x64.exe /build banMyWayResources.rsc /pathres ../banMyWay /pathdat ../banMyWay/bin


This is the /ref
bin\x64\Application-x64-profile.exe /ref banMyWayResources.rsc /pathres ../banMyWay /pathdat ../banMyWay/bin


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


Resource
ExternalList resource
{
External _resources
[
// toolbar - references building and everything else - nothing else need be listed here
//"Game/ToolBar.rsc"
"Game/Terrain/TerrainList.rsc"
//"Game/Climate/ClimateList.rsc"
"Template/PopulationMallard.rsc"
"Template/PopulationCanGoose.rsc"
"Template/PopulationBison.rsc"
"Template/PopulationTurkey.rsc"
"Template/PopulationBearBrown.rsc"
"Template/PopulationElk.rsc"
"Template/PopulationBoar.rsc"
"Template/LivestockPig.rsc"
"Template/LivestockGoat.rsc"
"Template/LivestockBison.rsc"
"Template/LivestockDuck.rsc"
"Template/LivestockGeese.rsc"
"Template/LivestockFriesianCow.rsc"
"Template/LivestockLonghorn.rsc"
"Template/WhiteChicken.rsc"
"Template/NaturalResourceLettuce.rsc"
"Template/RawMaterialLettuce.rsc"
"Template/NaturalResourceFigTree.rsc"
"Template/RawMaterialFig.rsc"
"Template/NaturalResourceMud.rsc"
"Template/NaturalResourceCotton.rsc"
"Template/RawMaterialCotton.rsc"
"Template/NaturalResourceOrangeTree.rsc"
"Template/NaturalResourceLemonTree.rsc"
"Template/NaturalResourceWatermelon.rsc"
"Template/NaturalResourceCantaloupe.rsc"
"Template/UtilityLimits.rsc",
"Dialog/StatusBar.rsc:tableStats",
//"Dialog/TownHall.rsc:productionRibbon",
"Dialog/StringTable.rsc:gameDialogs",
"Dialog/StringTable.rsc:graphTypes",
"Dialog/StringTable.rsc:graphKeys",
]
}


Notice the toolbar is commented out, but is included in the packaging attempt after I start a new game using the /ref.

Package.banMyWay
PackageFile banMyWay
{
String _name = "Banished My Way";
String _author = "Tawsag";
String _description = "This is a compilation of my favorite mods, as well as a lot of new content of my own making.";
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"
]
}


This is the file structure before the build and ref play.  Also included is the file structure in the bin folder, after running /ref, and also inside the Game folder, after running /ref.
Title: Re: Getting IO\MemoryStream.cpp(75) error when packaging.
Post by: RedKetchup on September 11, 2017, 07:25:05 PM
why are you calling these ?

"Template/UtilityLimits.rsc",
"Dialog/StatusBar.rsc:tableStats",
//"Dialog/TownHall.rsc:productionRibbon",
"Dialog/StringTable.rsc:gameDialogs",
"Dialog/StringTable.rsc:graphTypes",
"Dialog/StringTable.rsc:graphKeys",


did you tried to compile and get your .pkm without those ? and if it compiles, then this would mean something about those.
why are you editing the game originals ? and not adding your own banMyWayStringTable.rsc ?

edit: ok i see. i guess the /StringTable.rsc:graphTypes is for the new limits ? then what for the gamedialog and graphkey ? proceed by elimination/re-enable. you need to find the problem one.
Title: Re: Getting IO\MemoryStream.cpp(75) error when packaging.
Post by: Tawsag on September 11, 2017, 07:32:16 PM
Those are the lines directly from the increaseLimit example.  Yes I have tried packaging it without those lines, with the same result.

As far as editing the original,  it is the one from the increaseLimit.
Title: Re: Getting IO\MemoryStream.cpp(75) error when packaging.
Post by: RedKetchup on September 11, 2017, 07:34:54 PM
Quote from: Tawsag on September 11, 2017, 07:32:16 PM
Those are the lines directly from the increaseLimit example.  Yes I have tried packaging it without those lines, with the same result.

As far as editing the original,  it is the one from the increaseLimit.

edit: ok i see. i guess the /StringTable.rsc:graphTypes is for the new limits ? then what for the gamedialog and graphkey ? proceed by elimination/re-enable. you need to find the problem one.
Title: Re: Getting IO\MemoryStream.cpp(75) error when packaging.
Post by: RedKetchup on September 11, 2017, 07:37:36 PM
what raw material resources files are from your livestocks/populations/trees ? sometimes you are calling rawmaterial files (like fig/lettuce)and sometimes not.(like orange... new animals)
Title: Re: Getting IO\MemoryStream.cpp(75) error when packaging.
Post by: RedKetchup on September 11, 2017, 07:40:38 PM
for sure you have too many exclusive stuff to ask the code and find the problem. so i cannot press keyboard keys to find and spot the problem....
so you have to be at the keyboard
Title: Re: Getting IO\MemoryStream.cpp(75) error when packaging.
Post by: Tawsag on September 11, 2017, 07:45:40 PM
I don't quite understand the question.

Here is an image of the Bear folder, and the Template for the bear population.  All the others are set up the same.

// layout of the entity
ComponentDescription resource
{
// how often to update
UpdatePriority _updatePriority = Third;

// declare types that will be used
Description _descriptions
[
"population",
]
}

PopulationDescription population
{
String _name = "Bear Population";

// size of grid
int _cellSize = 8;
int _largeCellSize = 64;

// pathing info
PathBits _allowedPathing = Fast | Faster | Normal | Obstacle;
PathBits _disallowedPathing = Immovable | Unusable | Occasional;
bool _disallowZoneEntities = true;

// population
int _maxPopulationPerCell = 8;
int _populationIncreasePerMonth = 1;
int _populationDecreasePerHarvest = 1;

// if true, cell max array will be updated
bool _updateCells = true;

// type of herd that is displayed, if any
ComponentDescription _herd = "bearbrownHerd";
}

ComponentDescription bearbrownHerd
{
// how often to update
UpdatePriority _updatePriority = Fifth;

// declare types that will be used
Description _descriptions
[
"herd",
]
}

HerdDescription herd
{
ComponentDescription _animalType = "Template\WildAnimalBearBrown.rsc";
int _maxAnimals = 1;
int _minAnimals = 1;
float _timeInAreaMonths = 1.0;
float _timeInAreaTolerance = 0.5;
int _grazeAreaSize = 8;
float _reproduceTimeInMonths = 12.0;
}


// layout of the entity
ComponentDescription resource
{
// how often to update
UpdatePriority _updatePriority = Fifth;

// declare types that will be used
Description _descriptions
[
"model",
"character",
"animal",
"wildanimal"
]
}

WildAnimalDescription wildanimal
{
}

ModelDescription model
{
MeshGroup _meshes
[
{
AnimationGroup _animations = "Models\Animals\Bear\BearBrownAnims.rsc";
GraphicsMesh _mesh
[
"Models\Animals\Bear\BearBrownMesh.rsc"
                "Models\Animals\Bear\BearBlackMesh.rsc"
]
}
]

int _displayIndex = 0;
int _subIndex = 0;
bool _randomIndex = true;
}


AnimalDescription animal
{
ComponentDescription _rawMaterial
[
"Template/RawMaterialBearMeat.rsc"
"Template/RawMaterialBearSkin.rsc"
]

int _roamSize = 8;
int _requiredArea = 4;

float _maxAge = 6.0;
float _maxAgeTolerance = 0.5;
float _ageForOffspring = 1.0;
float _offspringTerm = 9.0;
float _offsprintTermTolerance = 0.0;

bool _randomIdleHeading = false;
float _idleTime = 8.0;
}

CharacterDescription character
{
float _headingOffset = 180.0;
float _turnFilter = 0.97;
float _defaultAnimationBlendTime = 0.33;
float _minHeight = -1.2;
}


Title: Re: Getting IO\MemoryStream.cpp(75) error when packaging.
Post by: RedKetchup on September 11, 2017, 07:54:28 PM
also i see something strange. in your screenshot there :

why do you have all this ? it looks like a full copy of the resource folder. you need to put only things you are editing.
some folders, even if you are not calling those , they get automatically sucks in the toolkit just because they are there... like dialog folder and +++

i suggest alot of cleanup and only put YOUR mod files there


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

from your last reply ...
why dont you call Template\WildAnimalBearBrown.rsc(and all the others) in your banMyWayResources file. and the others RawMaterialOrange.rsc... (and the others)
Title: Re: Getting IO\MemoryStream.cpp(75) error when packaging.
Post by: Tawsag on September 11, 2017, 07:59:41 PM
Agreed I need to clean the folder structure up.

As for not calling the other .rsc files from the ExternalList resource,  they are called from within the population files.
Title: Re: Getting IO\MemoryStream.cpp(75) error when packaging.
Post by: RedKetchup on September 11, 2017, 08:06:27 PM
Quote from: Tawsag on September 11, 2017, 07:59:41 PM
Agreed I need to clean the folder structure up.

As for not calling the other .rsc files from the ExternalList resource,  they are called from within the population files.

but if you check the example files from Luke : lettuce and fig. they are called by the natural resource files (like your population files) but they are still called in the resource files, no ?

"Template/NaturalResourceLettuce.rsc"
"Template/RawMaterialLettuce.rsc"
"Template/NaturalResourceFigTree.rsc"
"Template/RawMaterialFig.rsc"
"Template/NaturalResourceCotton.rsc"
"Template/RawMaterialCotton.rsc"


maybe it is not significative but you need to eliminate everything. something is weird when* making the .pkm and need to find what it is . maybe it is just all the mess up of resource folder that need to be cleaned....
you need to eliminate all the possibilities.
Title: Re: Getting IO\MemoryStream.cpp(75) error when packaging.
Post by: Tawsag on September 11, 2017, 08:13:02 PM
I see your point about the lettuce and fig examples.  I was going off the apiary example.

I'll give the giant clean up a go, and try some other things.

Thanks for the help so far.  I'll keep at it, and update this post as I find new things.

Thank you ReKetchup!
Title: Re: Getting IO\MemoryStream.cpp(75) error when packaging.
Post by: RedKetchup on September 11, 2017, 08:29:46 PM
your resource file should look like this:


ExternalList resource
{
External _resources
[
// toolbar - references building and everything else - nothing else need be listed here
//"Game/ToolBar.rsc"
"Game/Terrain/TerrainList.rsc"
//"Game/Climate/ClimateList.rsc"

"Template/PopulationMallard.rsc"
"Template/RawMaterialDuckMeat.rsc" // DuckMeat ?

"Template/PopulationCanGoose.rsc"

"Template/PopulationBison.rsc"
"Template/RawMaterialBisonMeat.rsc" // BL BisonMeat ?

"Template/PopulationTurkey.rsc"
"Template/RawMaterialTurkey.rsc" // Turkey meat ?

"Template/PopulationBearBrown.rsc"
"Template/RawMaterialBearMeat.rsc" // BearMeat ?
"Template/RawMaterialBearSkin.rsc" // BearSkin ?

"Template/PopulationElk.rsc" // i guess venison ?

"Template/PopulationBoar.rsc"
"Template/RawMaterialBoarMeat.rsc" // BL RawMaterialBoarMeat ?

"Template/LivestockPig.rsc"
"Template/RawMaterialSwineMeat.rsc" // BL RawMaterialSwineMeat ?

"Template/LivestockGoat.rsc"
"Template/RawMaterialGoatMeat.rsc" // Goat meat ?

"Template/LivestockBison.rsc"
"Template/RawMaterialBisonMeat.rsc" // BL RawMaterialBisonMeat ?

"Template/LivestockDuck.rsc"

"Template/LivestockGeese.rsc"

"Template/LivestockFriesianCow.rsc" //  it is from BLRKCowMesh ? (black liquid / redketchup mesh ?)
"Template/RawMaterialMilk.rsc" // ?? not making milk ?

"Template/LivestockLonghorn.rsc" // why white chicken example resource and livestock longhorn ?
"Template/WhiteChicken.rsc"

"Template/NaturalResourceLettuce.rsc"
"Template/RawMaterialLettuce.rsc"

"Template/NaturalResourceFigTree.rsc"
"Template/RawMaterialFig.rsc"

"Template/NaturalResourceMud.rsc"
"Template/RawMaterialMud.rsc" // Mud resource

"Template/NaturalResourceCotton.rsc"
"Template/RawMaterialCotton.rsc"

"Template/NaturalResourceOrangeTree.rsc"
"Template/RawMateriaOrange.rsc" // Orange edible

"Template/NaturalResourceLemonTree.rsc"
"Template/RawMaterialLemon.rsc" // Lemon edible

"Template/NaturalResourceWatermelon.rsc"
"Template/RawMaterialWatermelon.rsc" // Watermelon edible

"Template/NaturalResourceCantaloupe.rsc"
"Template/RawMaterialCantaloupe.rsc" // Cantaloupe edible

"Template/UtilityLimits.rsc",
"Dialog/StatusBar.rsc:tableStats",
//"Dialog/TownHall.rsc:productionRibbon",
"Dialog/StringTable.rsc:gameDialogs",
"Dialog/StringTable.rsc:graphTypes",
"Dialog/StringTable.rsc:graphKeys",
]
}
Title: Re: Getting IO\MemoryStream.cpp(75) error when packaging.
Post by: RedKetchup on September 11, 2017, 08:37:02 PM
oh also !!! something important.

between each time you are trying to compile...

do you delete manually the bin and build folders ?
very important to have a fresh bin/build folders at every compile


i personally i would add this to the build.bat file:


cd banMyWay
rmdir bin /S /Q
rmdir build /S /Q
cd ..
bin\x64\Tools-x64.exe /build banMyWayResources.rsc /pathres ../banMyWay /pathdat ../banMyWay/bin


but need to make sure that folder exist cause it wont cd banMyWay and delete your /bin/ folder of your toolkit ^^
Title: Re: Getting IO\MemoryStream.cpp(75) error when packaging.
Post by: Tawsag on September 12, 2017, 10:17:27 AM
Ok, a quick update, and answer to Red's questions.

First, yes I always delete the bin and Build folders before a new build.  I learned a long time ago when working with mod kits of any form, to delete previous builds and not overwrite.

About the added livestock and wild animals.  I got some of the meshes and textures from free 3d model sites, and did all the rigging and animations myself.  There was a lot of trial and error to get them to work correctly in the game.  About the LivestockFriesianCow, it's just a logical name to call it, and purely coincidental.


About the I/O error.

After cleaning out pretty much everything in the banMyWay folder.   I got it to build, and package into approximately 57Mb .pkm.  It will run in the /onlypkg command, but there are some inconsistencies with the /ref play through.  So, I'm about to rebuild the entire mod one part at a time, to find the problems.

Good news, is I'm making progress.

Again, thank you Red, for your help!
Title: Re: Getting IO\MemoryStream.cpp(75) error when packaging.
Post by: RedKetchup on September 12, 2017, 11:48:04 AM
Quote from: Tawsag on September 12, 2017, 10:17:27 AM
Ok, a quick update, and answer to Red's questions.

First, yes I always delete the bin and Build folders before a new build.  I learned a long time ago when working with mod kits of any form, to delete previous builds and not overwrite.

About the added livestock and wild animals.  I got some of the meshes and textures from free 3d model sites, and did all the rigging and animations myself.  There was a lot of trial and error to get them to work correctly in the game.  About the LivestockFriesianCow, it's just a logical name to call it, and purely coincidental.

great !
should do a tuto one of these days :)

Quote from: Tawsag on September 12, 2017, 10:17:27 AM
About the I/O error.

After cleaning out pretty much everything in the banMyWay folder.   I got it to build, and package into approximately 57Mb .pkm.  It will run in the /onlypkg command, but there are some inconsistencies with the /ref play through.  So, I'm about to rebuild the entire mod one part at a time, to find the problems.

Good news, is I'm making progress.

Again, thank you Red, for your help!

good :)

btw, i never never build and check in sandbox mode... i always go live everytime each time i want to check changes !
the sandbox mode is too far from reality, from live. and you end up to sometime lose time for nothing searching errors you shouldnt have / not seeing the errors you'll get once you try it live.

you should get the habit to launch your game live when you want to test changes/test to see if it works.
and put the /ref in the garbage.

reinstall your toolkit to refresh your real toolkit files in case you deleted one / or made some changes in the wrong copy of files (edited the original instead of your mod files)

will hope to see good news from you on your mod :)
seems very exciting.