World of Banished

MODS Garage => Mod Talk => Topic started by: zak4862 on November 20, 2018, 05:03:30 AM

Title: Town Big Medieval Barn
Post by: zak4862 on November 20, 2018, 05:03:30 AM
   Hi guys!
Now that I finally learned a few things about the blender, I started to work on the on Town Big Medieval Barn. The footprint will be 8x4 without road.
Since I'm not completely sure of all the things I would highly appreciate any comment and opinion about an emerging object.
       Regards  zak 4862  :)
Title: Re: Town Big Medieval Barn
Post by: kid1293 on November 20, 2018, 05:20:15 AM
Hmm... Nice model. I like that style.
Don't forget to go to object mode and apply location and scale. (select model and ctrl-a)
Maybe some window or shutter.
Title: Re: Town Big Medieval Barn
Post by: embx61 on November 20, 2018, 05:25:57 AM
Looking good so far.

Couple of little things.
I would make the roof a little bit thicker (About 2 x as thick) as if two planes are too close it will show moire (Stripes) in the game from above.

Maybe a bit detail on the top part too. It not have to be as detailed as bottom part but a couple of those insets would be nice.

I like the top part being a bit bigger and the beams which support it, very good job.

A couple of Windows? It is a Barn so not many are needed.

All in all, very nice what I see so far.

I would add a road in the template file so bannies always can access the barn.
If no Road and players build the barn so it is locked in the bannies will not be able to reach it and so nothing happens.
A lot of players know this and will be leaving space so bannies can access the barn but new players will probably not.
Title: Re: Town Big Medieval Barn
Post by: zak4862 on November 20, 2018, 06:22:11 AM
Thanks guys! I really needed that. It's like a patch for endless hours and a repeat experiment. I've said before, I'm still learning and progressing slowly - but I will
get there in time.
Oh yes ,the object is far from over, I think I'm somewhere in the middle. I have only finished the bottom part and I wanted to hear your opinion.  :)
Title: Re: Town Big Medieval Barn
Post by: embx61 on November 20, 2018, 06:33:40 AM
No worry, we all been there and we are still learning.

Modding if never done it before is a slow process but with time and dedication it will get better and better.
Then the speed will pickup too.

It is at the beginning that most beginning modders give up and quit out of frustration. I been there too and was lucky my wife kept cheering me on so i kept trying.
If you get stuck ask questions.

After a little while you get hooked and going to notice you hardly play the game anymore. :)

Title: Re: Town Big Medieval Barn
Post by: angainor88 on November 20, 2018, 07:14:54 AM
Woo! Looks good!
Title: Re: Town Big Medieval Barn
Post by: Gatherer on November 20, 2018, 08:16:07 AM
Very nice looking model so far.
Title: Re: Town Big Medieval Barn
Post by: Discrepancy on November 20, 2018, 10:06:28 PM
agree :) very nice. can't wait to see it finished.
Title: Re: Town Big Medieval Barn
Post by: zak4862 on November 21, 2018, 01:08:26 PM
Finally, I slowly finished the first phase of my warehouse. I took into account all your opinions and comments.
The roof is thicker, windows and some decorative battens on the top are added. It seems to me pretty well. Now I will start searching for suitable textures to add them on. Anyway, I will take a little break. Believe it or not this is hard work for me because I am still learning. So guys, what do you think - is it good enough to go further? :)




Title: Re: Town Big Medieval Barn
Post by: RedKetchup on November 21, 2018, 01:24:38 PM
looking great !!!!!!  ;D
Title: Re: Town Big Medieval Barn
Post by: embx61 on November 21, 2018, 01:28:19 PM
I would say, after your break, put those textures on and release :)

Very well done!!!
Yes, it is hard work but you will be happy after release and see it in the game.
Just take your time, if you get frustrated, just take a break and after an hour or two you get back to it with open mind again.

oh, and better look at some more textures because you can be sure some ask you for some F key Texture variants.  ;)  :D
Title: Re: Town Big Medieval Barn
Post by: zak4862 on November 21, 2018, 01:39:22 PM
Quote from: embx61 on November 20, 2018, 05:25:57 AM
I would add a road in the template file so bannies always can access the barn.
If no Road and players build the barn so it is locked in the bannies will not be able to reach it and so nothing happens.
A lot of players know this and will be leaving space so bannies can access the barn but new players will probably not.


So, could you help me with how to add road in the template file when I will get to that point?
Title: Re: Town Big Medieval Barn
Post by: brads3 on November 21, 2018, 01:51:42 PM
looks very good.
Title: Re: Town Big Medieval Barn
Post by: embx61 on November 21, 2018, 01:52:50 PM
This is the part in the Template file from one of my 4x4 houses.

Because of the road it will be 4x5.

CreatePlacedDescription createplaced
{
PathBits _placeBits = Normal | Obstacle;

int _width = 4;
int _height = 5;
int _footprintRotation = 0;

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

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

MapDescription map
{
PathType _pathType = Immovable;
String _pathBitmap =
"####
####
####
####
....";

bool _addToOverhead = true;
Color _mapColor = 0xFF545454;
}


# means bannies are not allowed there.
. means road enabled.
_ means Bannies can walk there.

You probably have to move your Barn in Blender Half a tile back and set the pivot back at 0 after that or the road will be half under the Barn.
I am not familair with Blender but maybe Kid can say how to do this.

It seems your barn is 4x8 so you need to set the width and height to 4x9 in your template file.

So 8 rows of 4 0 and then 1 row of 1's in the first part.
Then if no Bannies are allowed in the Barn just 8 rows of 4 times # and 1 row of 4 times a .

So your will be:

CreatePlacedDescription createplaced
{
PathBits _placeBits = Normal | Obstacle;

int _width = 4;
int _height = 9;
int _footprintRotation = 0;

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

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

MapDescription map
{
PathType _pathType = Immovable;
String _pathBitmap =
"####
                 ####
                 ####
                 ####
                 ####
####
####
####
....";

bool _addToOverhead = true;
Color _mapColor = 0xFF545454;
}


4x10 as Kid suggest is also good, Then you not have to move the Barn either half a tile.

Then it will become

CreatePlacedDescription createplaced
{
PathBits _placeBits = Normal | Obstacle;

int _width = 4;
int _height = 10;
int _footprintRotation = 0;

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

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

MapDescription map
{
PathType _pathType = Immovable;
String _pathBitmap =
"....
                 ####
                 ####
                 ####
                 ####
                 ####
####
####
####
....";

bool _addToOverhead = true;
Color _mapColor = 0xFF545454;
}

Title: Re: Town Big Medieval Barn
Post by: kid1293 on November 21, 2018, 01:57:34 PM
Maybe better to make it 4x10 with road both in front and back so they can access back door too.
Title: Re: Town Big Medieval Barn
Post by: RedKetchup on November 21, 2018, 02:19:30 PM
4x10 looks very slim.... maybe 5x10 ?
Title: Re: Town Big Medieval Barn
Post by: embx61 on November 21, 2018, 02:28:09 PM
You probably have to learn the code too.

Good thing is a Barn is pretty easy to do.
Just go to resources/Template in your Mod kit and copy the Storage barn file into a Template Folder wherever your folder is
For example BanishedKit\ZakBarn\Template

In that file you have to change some stuff so it refers to your toolbar, Icon, string table, meshes etc.

This can be very overwhelming and this is were many modders quit out of frustration.
Just change stuff and compile, ask questions and we guide you through it.

Here  the Storage Barn File from Vanilla. I put a <============ were changes need to be made.

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

// declare types that will be used
Description _descriptions
[
"ui",

"map",
"zone",
"toolbar",
"createplaced",
"decal",
"model",
"picking",
"highlight",
"interact",
"storage",
"work",
"statusicon",
"ambientemitter",
"Common.rsc:fireWoodBuilding",
"particle",

"statemachine",
"cleararea",
"build",
"workplace",
"destroy",
"storagelocation"
]
}

AmbientEmitterDescription ambientemitter
{
bool _addOnCreate = false;
SoundEffect _soundEffects [ "Audio/Effects/FireEffect.rsc" ]
}

ClearAreaDescription cleararea { }
StateMachineDescription statemachine { }
ZoneDescription zone { }
StorageLocationDescription storagelocation { }

DestroyDescription destroy
{
int _damagedSkin = 1;
int _damagedDecal = 1;
}

ParticleDescription particle
{
ParticleAttachment _systems
[

{
Time _fadeInOutTime = 2.0;
bool _addOnCreate = false;
bool _addOnNotify = false;
Particle _particle = "ParticleSystems\Fire\FireMedium.rsc";
}
]
}

StatusIconDescription statusicon
{
SpriteSheet _spriteSheet = "StatusIcons\BuildingIconSpriteSheet.rsc";
bool _fixedSize = true;
float _size = 0.04;
float _zoffset = 1.33;
}

ToolbarDescription toolbar
{
SpriteSheet _spriteSheet = "Dialog/SpriteSheet.rsc";  <====== Name of your sprite sheet say ZakBarnSpriteSheet.rsc
String _spriteName = "BuildStorageBarn";   <========= Link to your Toolbar Icon

StringTable _stringTable = "Dialog/StringTable.rsc:objects";  <====== Name of your sprite sheet say ZakBarnStringTable.rsc You can remove the :objects at the end.
String _stringName = "StorageBarn";   <========= Link to StringTable
String _stringNameLwr = "StorageBarnLwr";  <========= Link to StringTable
String _toolTip = "StorageBarnTip";  <========= Link to StringTable

String _statusStrings
[
"CreateOk",
"CreateBlocked",
]

int _group = 3;

}

CreatePlacedDescription createplaced   <============== This is explained a post above.
{
PathBits _placeBits = Normal | Obstacle;

int _width = 8;   <==== change
int _height = 5;  <==== change
int _footprintRotation = 0;

PathBits _placeBitArray
[
Normal | Obstacle,
Normal | Obstacle | Fast | Faster,
]
String _placeBitmap =
"10000001  <===Change all those so it become 10 rows of 4 from left to right
10000001
10000001
10000001
10000001";

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

MapDescription map
{
PathType _pathType = Immovable;
String _pathBitmap =
".######.   <===Change all those so it become 10 rows of 4 from left to right
.######.
.######.
.######.
.######.";

bool _addToOverhead = true;
Color _mapColor = 0xFF545454;
}

DecalDescription decal
{
MaterialInstance _materials
[
"Terrain/TiledDecals/BuildingFootprint8Material.rsc"    <====== Link to your own foot print file
"Terrain/TiledDecals/BuildingFootprint8DamageMaterial.rsc"  <====== Link to your own foot print file
]
bool _tiled = false;
float _initialAlpha = 0.5;

float _mapWidth = 512.0;  <====== Size of your png footprint so say 512x512

DecalLocation _decalLocations
[
{
float _x0 = 0.0;   Mostly if your footprint png is say 512 you do
float _y0 = 0.0;   
float _x1 = 512.0;
float _y1 = 512.0;
}
]
}

PickingDescription picking
{
MaterialInstance _selectMaterial = "Material/SelectionMask/SelectionMask.rsc";
PickingGroup _meshes
[
{
PickingMesh _mesh
[
"Models\Buildings\StorageBarn\StorageBarnBuild01Picking.rsc",     <======== All three need a name change Just Zak in front of it will do.
"Models\Buildings\StorageBarn\StorageBarnBuild02Picking.rsc",
"Models\Buildings\StorageBarn\StorageBarnPicking.rsc"
]
}
]
}


ModelDescription model
{
MeshGroup _meshes
[
{
GraphicsMesh _mesh
[
"Models\Buildings\StorageBarn\StorageBarnBuild01Mesh.rsc",   <======== All three need a name change Just Zak in front of it will do.
"Models\Buildings\StorageBarn\StorageBarnBuild02Mesh.rsc",
"Models\Buildings\StorageBarn\StorageBarnMesh.rsc"
]
}
]
int _displayIndex = 0;
int _subIndex = 0;
bool _randomIndex = false;
}

HighlightDescription highlight
{
EdgeGroup _meshes
[
{
EdgeMesh _mesh
[
"Models\Buildings\StorageBarn\StorageBarnBuild01Mesh.rsc:edge",  <======== All three need a name change Just Zak in front of it will do.
"Models\Buildings\StorageBarn\StorageBarnBuild02Mesh.rsc:edge",
"Models\Buildings\StorageBarn\StorageBarnMesh.rsc:edge"
]
}
]

// materials for drawing selection with no mesh
MaterialInstance _maskMaterial = "Material/SelectionMask/SelectionMask.rsc";
MaterialInstance _edgeMaterial = "Material/SelectionEdge/SelectionEdge.rsc";
}

InteractDescription interact
{
PointList _pointList = "Models\Buildings\StorageBarn\StorageBarnPoints.rsc";  <======== link to your points file Example ZakBarnPoints.rsc
}

StorageDescription storage
{
RawMaterialFlags _storageFlags = Edible | Tool | Health | Clothing | Textile; <=========== Can add more flags
bool _areaBasedLimit = false;
bool _available = false;
int _volumeLimit = 6000; <======= Can be changed if you want to store less or more
}

WorkDescription work
{
int _defaultWorkers = 4;
}

WorkPlaceDescription workplace
{
// no actual work done here once the building is built
//Profession _profession = null;
//Profession _pickupProfession = null;
}

BuildDescription build
{
int _workRequired = 60;   <===== Number of build cycles it takes to build the barn

BuildRequirement _buildRequirement
[
{
ComponentDescription _rawMaterial = "Template/RawMaterialWood.rsc";   
int _count = 48;  <======= Needed wood
}
{
ComponentDescription _rawMaterial = "Template/RawMaterialStone.rsc";
int _count = 16;  <======= Needed Stone
}
]
}

UIDescription ui
{
int _displayPage = 1; // set to 1 for tab layout
Dialog _dialog = "Dialog/StandardDialog.rsc:entity";
ElementController _controllers
[
{
ObjectType _type = StorageUI;
ElementDescription _element = "Dialog/Storage.rsc:storage";
String _insertAt = "pageTab";
ElementDescription _tabButton = "Dialog/Storage.rsc:buttonTabStorage";
}
{
ObjectType _type = StorageCapacityUI;
ElementDescription _element = "Dialog/Storage.rsc:capacity";
String _insertAt = "pageTabHeader";
}
{
ObjectType _type = BuildUI;
ElementDescription _element = "Dialog/Build.rsc:build";
String _insertAt = "pageBuild";
}
{
ObjectType _type = DestroyUI;
ElementDescription _element = "Dialog/Destroy.rsc:destroy";
String _insertAt = "pageDestroy";
}
{
ObjectType _type = WorkPlaceUI;
ElementDescription _element = "Dialog/Work.rsc:workPlace";
String _insertAt = "userTitle0";
}
{
ObjectType _type = StatusIconUI;
ElementDescription _element = "Dialog/Building.rsc:icons";
String _insertAt = "userTitle1";
}

]
}


As you see the changes are not that many and much of that file can stay as it is.
As I said. This is the hardest and can be most frustrating part of Modding.
Just try stuff out and check with the resources from the Mod Kit and even the Apiary Building from Luke in the examples folder as to see how stuff is linked together and ask questions if you get stuck.

We maybe even have to do the code for you but that is fine.
Title: Re: Town Big Medieval Barn
Post by: Maldrick on November 21, 2018, 02:31:16 PM
Looks great, zak. I like that mesh for in-town storage a lot.

Been getting back into a project, myself.  Best general suggestion I can give is take your time and have fun with it.  Texturing completely stressed me out with my first one, so I've spent about a week just on trying different things with that this time.  A lot of time spent just watching YouTube videos on different ways to do things in Blender.

Looking forward to seeing how this turns out.
Title: Re: Town Big Medieval Barn
Post by: zak4862 on November 21, 2018, 03:44:47 PM
Thank you to all of you for your support and kind help. I appreciate it very much. But as I already said - I still have a long way to go. I am learning now how to handle everything in blender ( next is texturing) , later I will confront with coding. So I hope that I will succeed in a week or two, everything goes very slowly because I am learning at the same time.
       Greetings and thanks to everyone      zak 4862  :)
Title: Re: Town Big Medieval Barn
Post by: Gatherer on November 22, 2018, 08:59:53 AM
Looks better with the added windows.


Quote from: embx61 on November 21, 2018, 01:28:19 PM
oh, and better look at some more textures because you can be sure some ask you for some F key Texture variants.  ;) :D


And a version with just the front door. ;)  Or only at the long side. ;D  Madness never ends.
Title: Re: Town Big Medieval Barn
Post by: zak4862 on November 22, 2018, 10:52:25 AM
Quote from: 1 on November 22, 2018, 10:02:17 AM
zak4862 do you have earlier experience for modding and this kind of stuff, or are you learning all for first time. If you are first timer its encourage me little to try again blender and all.

I am learning everything for the first time. Its hard,but slowly and with patience I can make it. Of course you must know that guys (moders) here are helping in anyway
they can with their experience and knowledge. You must just ask them and they will get you an answer or a direction to solution. They are all very helpful and kind. So go ahead - try, you have nothing to lose. But you have to be very patient. Me for example, I have started to building  a mesh 7 times before It was done properly and I was satisfied with it. As @Maldrick said - take your time and take this for fun.
    Regards   zak 4862  :)
Title: Re: Town Big Medieval Barn
Post by: zak4862 on November 22, 2018, 10:55:18 AM
The roof, the roof, the roof is on fire!  ;D
Title: Re: Town Big Medieval Barn
Post by: Gatherer on November 22, 2018, 11:35:43 AM
I like that texture.
Title: Re: Town Big Medieval Barn
Post by: zak4862 on November 25, 2018, 04:03:18 AM
Hi guys!
I have finished the textures and I would like yours opinion on it. Are they good enough. I wanted to get a bit old look.
I also have one important question. Before I export object in FBX (object mode in blender), do I select all or no. I would be grateful for help with this,because
I dont know which is correct. Thanks in advance for your opinions and any help.  :)
Title: Re: Town Big Medieval Barn
Post by: kid1293 on November 25, 2018, 05:46:47 AM
Wow, we're getting a new village style! :)

You should have all models (build stages and finished model) with scale applied (control-a in object mode)
then you should scale everything, with pivot center set to 3D cursor, to 0.01 (don't apply)
then export to fbx. I always use default export settings. Works for me.

Reason for scaling to 0.01 without apply is unknown. If you don't some models do not work!
Title: Re: Town Big Medieval Barn
Post by: zak4862 on November 25, 2018, 07:19:45 AM
Thanks again for your reply kid1293. So, if I understand you properly there is no "select all" in this process. :)
Title: Re: Town Big Medieval Barn
Post by: kid1293 on November 25, 2018, 11:02:09 AM
Yes you select all. (I hope you have everything placed)
I mean, for a build2 or something you first set it to 0,0 where it should show up in game.
Then you press G (grab) and X and type -10. Do not apply this position! In game it is now placed
at 0,0 but temporarily it resides at -10,0.
If you have done all parts and placed them a bit spread out you can select all and save a backup
then save fbx. I have PM'd you about this.
Title: Re: Town Big Medieval Barn
Post by: Maldrick on November 27, 2018, 12:14:12 PM
Looks great, zak!  Looking forward to checking it out when you get finished.
Title: Re: Town Big Medieval Barn
Post by: zak4862 on November 27, 2018, 01:28:59 PM
Thanks guys! I dont know when I will finished it. This week we have a lot to do at work - so I am working whole day long. So, when I come home at the evening (like now - it is 10 PM in Slovenia) I am really exhausted. As I said before, slowly I will get there.
          Regards  zak4862 :)
Title: Re: Town Big Medieval Barn
Post by: Maldrick on November 28, 2018, 08:40:30 AM
Take your time with it, zak.  Been working on one thing off and on for weeks.  Might even be a month, at this point.  Finding it helps to be fresh and, with lots of breaks, retaining the constant learning in Blender is much better.
Title: Re: Town Big Medieval Barn
Post by: angainor88 on November 29, 2018, 06:22:49 AM
Yes take your time :)

(I understand the work thing so much haha)