Author Topic: Getting IO\MemoryStream.cpp(75) error when packaging.  (Read 382 times)

0 Members and 1 Guest are viewing this topic.

Offline Tawsag

  • Newb
  • *
  • Posts: 7
Getting IO\MemoryStream.cpp(75) error when packaging.
« 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.

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 7384
Re: Getting IO\MemoryStream.cpp(75) error when packaging.
« Reply #1 on: September 11, 2017, 05:55:07 PM »
can we get some screenshot of your folder structure ? .bat, package.rsc & Resources.rsc files ?
> > > Support Mods Creation developments with Paypal Donations < < <
Click here to PayPal Donate.

Offline Tawsag

  • Newb
  • *
  • Posts: 7
Re: Getting IO\MemoryStream.cpp(75) error when packaging.
« Reply #2 on: September 11, 2017, 06:46:36 PM »
Here is my build.
Code: [Select]
bin\x64\Tools-x64.exe /build banMyWayResources.rsc /pathres ../banMyWay /pathdat ../banMyWay/bin

This is the /ref
Code: [Select]
bin\x64\Application-x64-profile.exe /ref banMyWayResources.rsc /pathres ../banMyWay /pathdat ../banMyWay/bin

Package
Code: [Select]
bin\x64\Tools-x64.exe /mod Package.rsc:banMyWay /pathres ../banMyWay /pathdat ../banMyWay/bin

Resource
Code: [Select]
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
Code: [Select]
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.
« Last Edit: September 11, 2017, 07:26:05 PM by Tawsag »

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 7384
Re: Getting IO\MemoryStream.cpp(75) error when packaging.
« Reply #3 on: September 11, 2017, 07:25:05 PM »
why are you calling these ?
Code: [Select]
"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.
« Last Edit: September 11, 2017, 07:34:13 PM by RedKetchup »
> > > Support Mods Creation developments with Paypal Donations < < <
Click here to PayPal Donate.

Offline Tawsag

  • Newb
  • *
  • Posts: 7
Re: Getting IO\MemoryStream.cpp(75) error when packaging.
« Reply #4 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.

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 7384
Re: Getting IO\MemoryStream.cpp(75) error when packaging.
« Reply #5 on: September 11, 2017, 07:34:54 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.
> > > Support Mods Creation developments with Paypal Donations < < <
Click here to PayPal Donate.

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 7384
Re: Getting IO\MemoryStream.cpp(75) error when packaging.
« Reply #6 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)
« Last Edit: September 11, 2017, 07:42:24 PM by RedKetchup »
> > > Support Mods Creation developments with Paypal Donations < < <
Click here to PayPal Donate.

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 7384
Re: Getting IO\MemoryStream.cpp(75) error when packaging.
« Reply #7 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
> > > Support Mods Creation developments with Paypal Donations < < <
Click here to PayPal Donate.

Offline Tawsag

  • Newb
  • *
  • Posts: 7
Re: Getting IO\MemoryStream.cpp(75) error when packaging.
« Reply #8 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.

Code: [Select]
// 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;
}

Code: [Select]
// 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;
}


« Last Edit: September 11, 2017, 07:49:14 PM by Tawsag »

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 7384
Re: Getting IO\MemoryStream.cpp(75) error when packaging.
« Reply #9 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)
> > > Support Mods Creation developments with Paypal Donations < < <
Click here to PayPal Donate.

Offline Tawsag

  • Newb
  • *
  • Posts: 7
Re: Getting IO\MemoryStream.cpp(75) error when packaging.
« Reply #10 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.

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 7384
Re: Getting IO\MemoryStream.cpp(75) error when packaging.
« Reply #11 on: September 11, 2017, 08:06:27 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 ?

Code: [Select]
"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.
> > > Support Mods Creation developments with Paypal Donations < < <
Click here to PayPal Donate.

Offline Tawsag

  • Newb
  • *
  • Posts: 7
Re: Getting IO\MemoryStream.cpp(75) error when packaging.
« Reply #12 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!

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 7384
Re: Getting IO\MemoryStream.cpp(75) error when packaging.
« Reply #13 on: September 11, 2017, 08:29:46 PM »
your resource file should look like this:

Code: [Select]
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",
]
}
> > > Support Mods Creation developments with Paypal Donations < < <
Click here to PayPal Donate.

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 7384
Re: Getting IO\MemoryStream.cpp(75) error when packaging.
« Reply #14 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:

Code: [Select]
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 ^^
> > > Support Mods Creation developments with Paypal Donations < < <
Click here to PayPal Donate.