News:

Welcome to World of Banished!

Main Menu

Error message (problem with model)

Started by angainor88, January 28, 2019, 05:34:20 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

angainor88

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.


Discrepancy

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.


Discrepancy

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.

Discrepancy

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 :)

RedKetchup

#5
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 ?
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

angainor88

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";

RedKetchup

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.
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

RedKetchup

#8
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
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

angainor88

Ah ok that makes a lot more sense now thank you! Time to fiddle with my model :D

RedKetchup

> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .