Author Topic: Town Big Medieval Barn  (Read 1188 times)

0 Members and 1 Guest are viewing this topic.

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 10511
  • Country: ca
Re: Town Big Medieval Barn
« Reply #15 on: November 21, 2018, 02:19:30 PM »
4x10 looks very slim.... maybe 5x10 ?
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Offline embx61

  • Modders
  • Banished Expert
  • *****
  • Posts: 1831
  • Country: us
  • You are always on my mind, Forever in my heart
Re: Town Big Medieval Barn
« Reply #16 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.

Code: [Select]
// 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.
My beloved Kathy
As you were you will always be
Treasured forever in my memory


For my list of Mods with download links go here

Offline Maldrick

  • Modders
  • Architect
  • *****
  • Posts: 629
  • Country: us
Re: Town Big Medieval Barn
« Reply #17 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.
"We are the architects of our actions and we must live with their consequences, whether glorious or tragic.
― Ezio Auditore da Firenze

Offline zak4862

  • Trader
  • ****
  • Posts: 188
  • Country: si
Re: Town Big Medieval Barn
« Reply #18 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  :)

Offline Gatherer

  • Banished Expert
  • *****
  • Posts: 1241
  • Country: si
  • DECO FANATIC!!!
Re: Town Big Medieval Barn
« Reply #19 on: November 22, 2018, 08:59:53 AM »
Looks better with the added windows.


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.
There's never enough deco stuff!!!
Fiat panis.

Offline 1

  • Trader
  • ****
  • Posts: 187
Re: Town Big Medieval Barn
« Reply #20 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.

Offline zak4862

  • Trader
  • ****
  • Posts: 188
  • Country: si
Re: Town Big Medieval Barn
« Reply #21 on: November 22, 2018, 10:52:25 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  :)

Offline zak4862

  • Trader
  • ****
  • Posts: 188
  • Country: si
Re: Town Big Medieval Barn
« Reply #22 on: November 22, 2018, 10:55:18 AM »
The roof, the roof, the roof is on fire!  ;D

Offline Gatherer

  • Banished Expert
  • *****
  • Posts: 1241
  • Country: si
  • DECO FANATIC!!!
Re: Town Big Medieval Barn
« Reply #23 on: November 22, 2018, 11:35:43 AM »
I like that texture.
There's never enough deco stuff!!!
Fiat panis.

Offline zak4862

  • Trader
  • ****
  • Posts: 188
  • Country: si
Re: Town Big Medieval Barn
« Reply #24 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.  :)

Offline kid1293

  • Modders
  • Banished Expert
  • *****
  • Posts: 3104
  • Country: se
  • Never confuse movement with progress
Re: Town Big Medieval Barn
« Reply #25 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!

Offline zak4862

  • Trader
  • ****
  • Posts: 188
  • Country: si
Re: Town Big Medieval Barn
« Reply #26 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. :)

Offline kid1293

  • Modders
  • Banished Expert
  • *****
  • Posts: 3104
  • Country: se
  • Never confuse movement with progress
Re: Town Big Medieval Barn
« Reply #27 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.

Offline Maldrick

  • Modders
  • Architect
  • *****
  • Posts: 629
  • Country: us
Re: Town Big Medieval Barn
« Reply #28 on: November 27, 2018, 12:14:12 PM »
Looks great, zak!  Looking forward to checking it out when you get finished.
"We are the architects of our actions and we must live with their consequences, whether glorious or tragic.
― Ezio Auditore da Firenze

Offline zak4862

  • Trader
  • ****
  • Posts: 188
  • Country: si
Re: Town Big Medieval Barn
« Reply #29 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 :)