News:

Welcome to World of Banished!

Main Menu

Town Big Medieval Barn

Started by zak4862, November 20, 2018, 05:03:30 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RedKetchup

4x10 looks very slim.... maybe 5x10 ?
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

embx61

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.
[size=8pt][color=teal]My beloved Kathy
As you were you will always be
Treasured forever in my memory[/color][/size]

[size=10pt]For my list of Mods with download links go here[/size]

Maldrick

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

zak4862

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

Gatherer

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

zak4862

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

zak4862

The roof, the roof, the roof is on fire!  ;D

Gatherer

There's never enough deco stuff!!!
Fiat panis.

zak4862

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

kid1293

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!

zak4862

Thanks again for your reply kid1293. So, if I understand you properly there is no "select all" in this process. :)

kid1293

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.

Maldrick

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

zak4862

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

Maldrick

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.
"We are the architects of our actions and we must live with their consequences, whether glorious or tragic."
― Ezio Auditore da Firenze