World of Banished

MODS Garage => Tips and Help => Topic started by: angainor88 on January 28, 2019, 05:34:20 PM

Title: Error message (problem with model)
Post by: angainor88 on January 28, 2019, 05:34:20 PM
Sorry for coming to ask for help again so soon :P

When working on my new model, I came across an error message I hadn't seen before. It triggers only when I try to place the model in-game. Has anyone encountered this before?

Attached is the error message.
Title: Re: Error message (problem with model)
Post by: angainor88 on January 28, 2019, 05:35:21 PM
If needed, here is the file I am working on:

http://www.mediafire.com/file/o8s49t4e85to0tm/AtlasMountainStorage.7z/file (http://www.mediafire.com/file/o8s49t4e85to0tm/AtlasMountainStorage.7z/file)

and here are the blender files:

http://www.mediafire.com/file/2uh64yuyheqksdv/AtlasMountainStorageHouseblender.7z/file (http://www.mediafire.com/file/2uh64yuyheqksdv/AtlasMountainStorageHouseblender.7z/file)

http://www.mediafire.com/file/u8hq7j1x6fng5pa/AtlasMountainStorageblender.7z/file (http://www.mediafire.com/file/u8hq7j1x6fng5pa/AtlasMountainStorageblender.7z/file)
Title: Re: Error message (problem with model)
Post by: Discrepancy on January 28, 2019, 06:05:35 PM
Hi :)

It is to do with your template file:

CreatePlacedDescription createplaced
{
PathBits _placeBits = Normal | Obstacle;

int _width = 4;
int _height = 3;
int _footprintRotation = 270;

PathBits _placeBitArray
[
Normal | Obstacle,
Normal | Obstacle | Fast | Faster,
]
String _placeBitmap =
"2222 
2222
1111";

ComponentDescription _allowAndRemove = "Template/Clear.rsc";
}


the mistake is within the String _placeBitmap not aligning with the PathBits _placeBitArray.

it should be:
CreatePlacedDescription createplaced
{
PathBits _placeBits = Normal | Obstacle;

int _width = 4;
int _height = 3;
int _footprintRotation = 270;

PathBits _placeBitArray
[
Normal | Obstacle,
Normal | Obstacle | Fast | Faster,
]
String _placeBitmap =
"0000
0000
1111";

ComponentDescription _allowAndRemove = "Template/Clear.rsc";
}



the first line in the PathBits _placeBitArray is always line 0, second is line 1, etc etc.

Title: Re: Error message (problem with model)
Post by: Discrepancy on January 28, 2019, 06:16:08 PM
that is the issue of why it is crashing when you try to place them. But I have come across another as I cannot select the building once I've placed them. I will look further into it.
Title: Re: Error message (problem with model)
Post by: Discrepancy on January 28, 2019, 06:25:57 PM
It is simply the size of the models.
I imported them into blender and noticed they were compiled at full 1:1 size.
I re-imported at 0.01 and exported and replaced the .fbxs and it all works as you can now select the models in game. Just let me know if you want me to send you the changes. You will also need to move the house model location to make it 'fit' with the storage :)
Title: Re: Error message (problem with model)
Post by: RedKetchup on January 28, 2019, 06:54:59 PM
PathBits _placeBitArray
   [
      Normal | Obstacle,
      Normal | Obstacle | Fast | Faster,
   ]


the first line is always 0
the second one is 1
if you had a 3rd and a 4th, the 3rd would be a 2 and the 4th a 3.

   String _placeBitmap =
      "2222 
       2222
       1111";


here you are calling 4 time a 2 , which should have been the 3rd but you dont have a 3rd. and your 4x1 you are calling the 2nd line which is
      Normal | Obstacle | Fast | Faster,

if can be a bit confusing because the first line is always a 0, and the 2nd a 1.


as Disc said you should have written
0000
0000
1111

the 0000 means 4x 0 , mean 4x the first line which is 4x Normal | Obstacle,
this is probably your rear of the building. so the row of 4 tiles in the back, when you are placing your building on the ground, need to be or normal or obstacle.
the 2nd row of 0000 is same, it can be placed on tiles that are normal or obstacle.

and the row of 1111 is your Normal | Obstacle | Fast | Faster, so that front row of your building can be normal or obstacle but also a dirt road(fast) or stone road (faster)

you are crashing cause you ask 2222 but you didnt specified that line (you only specified the 0000 and the 1111)


PathBits _placeBitArray
   [
      Normal | Obstacle, //====> = 0
      Normal | Obstacle | Fast | Faster, //====> = 1
   ]

see the relation ? the maping ?
Title: Re: Error message (problem with model)
Post by: angainor88 on January 29, 2019, 05:50:34 AM
Ok thank you for all your help! I know I have to do some adjusting on the models haha they always need to be rotated and such.


So if I wanted to have it placed on mountain terrain, how would I change the PathBits _placeBitArray ?

Would I add a third line like the one from Iron Mine? Or would I have to change it?

Is it possible to do it as:

String _placeBitmap =
"2222
0000
1111";
Title: Re: Error message (problem with model)
Post by: RedKetchup on January 29, 2019, 09:31:44 AM
then you need to start the third line ( = 2 )

PathBits _placeBitArray
   [
      Normal | Obstacle, // = number 0
      Normal | Obstacle | Fast | Faster, // = number 1
      Unusable | Walkable, // = number 2
   ]


so all your 0 will be normal tiles... all your 1 will be normal or road... and all 2 will be your mountain tiles.
Title: Re: Error message (problem with model)
Post by: RedKetchup on January 29, 2019, 11:33:13 AM
even if you want more flexibility to where to put down the building, you can add a 4th one like this:

PathBits _placeBitArray
   [
      Normal | Obstacle, // (= number 0)
      Normal | Obstacle | Fast | Faster, // (= number 1)
      Unusable | Walkable, // (= number 2)
      Normal | Obstacle | Unusable | Walkable, // (= number 3)
   ]



   String _placeBitmap =
      "3223
       0000
       1111";


which will give more flexibility in the back corners. it would make accept normal tiles in the back corners if placed a bit left or a bit right
Title: Re: Error message (problem with model)
Post by: angainor88 on January 29, 2019, 06:04:49 PM
Ah ok that makes a lot more sense now thank you! Time to fiddle with my model :D
Title: Re: Error message (problem with model)
Post by: RedKetchup on January 29, 2019, 06:58:31 PM
pictures often help to visualize.