News:

Welcome to World of Banished!

Main Menu

Decorative plants

Started by Voeille, May 21, 2018, 01:05:57 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Voeille

I want to slowly add the plants I made for Cities Skylines as a decorative plants set (4 plants, each one with F key variants). What I want to achieve at the end is:

  • Ghosted plants that can be put anywhere, with 0 build cost
  • They should be immune to fires and tornadoes
  • They should have the tree animation
  • I want them to change leaf colour for autumn, but I don't want the leaves to vanish in winter, just cover with snow
  • They should appear in my section under the common toolbar
At the moment, I just wanted to import one plant and see it in the game, it should appear directly under the community toolbar without my section yet (just for testing, I'd add the section later), and have the apiary icon. The mod compiled just fine without errors, I can enable it in game, but nothing shows up in the menu. I must've done something wrong, but I don't know what. Here are the files, the compiled .pkm is inside the folder.

If someone is curious, here are pictures of the plants I want to add, I think they fill fit into Banished aesthetics:
Except for the ferns textures are handmade, so not photo-realistic ;)

RedKetchup

#1
Quote from: Voeille on May 21, 2018, 01:05:57 PM
I want to slowly add the plants I made for Cities Skylines as a decorative plants set (4 plants, each one with F key variants). What I want to achieve at the end is:

  • Ghosted plants that can be put anywhere, with 0 build cost
  • They should be immune to fires and tornadoes

for ghosted, you need to set up your createplaced, map and build paragraphs like this:
[/list]
CreatePlacedDescription createplaced
{
PathBits _placeBits = Normal | Obstacle;

int _width = 0;
int _height = 0;
int _footprintRotation = 0;

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

ComponentDescription _allowAndRemove = "Template/Clear.rsc";
}
MapDescription map
{
PathType _pathType = Immovable;
String _pathBitmap =
"";

bool _addToOverhead = true;
Color _mapColor = 0xFF545454;
}
BuildDescription build
{
int _workRequired = 0;
}


they will eventually be immune to fire/tornados.

oh and about "F" variant is set by the number of items in the decal, picking, model and highlight paragraphs. in your case you said 4 "F" then each of those will have 4 items in each like:


PickingDescription picking
{
MaterialInstance _selectMaterial = "Material/SelectionMask/SelectionMask.rsc";
PickingGroup _meshes
[
{
PickingMesh _mesh
[
"Models\NaturalResource\DecoTrees\DecorativeCedar1Picking.rsc"
]
}
{
PickingMesh _mesh
[
"Models\NaturalResource\DecoTrees\DecorativeCedar2Picking.rsc"
]
}
{
PickingMesh _mesh
[
"Models\NaturalResource\DecoTrees\DecorativeCedar3Picking.rsc"
]
}
]
}

ModelDescription model
{
MeshGroup _meshes
[
{
GraphicsMesh _mesh
[
"Models\NaturalResource\DecoTrees\DecorativeCedar1Mesh.rsc"
]
}
{
GraphicsMesh _mesh
[
"Models\NaturalResource\DecoTrees\DecorativeCedar2Mesh.rsc"
]
}
{
GraphicsMesh _mesh
[
"Models\NaturalResource\DecoTrees\DecorativeCedar3Mesh.rsc"
]
}
]

int _displayIndex = 0;
int _subIndex = 0;
bool _randomIndex = false;
}

HighlightDescription highlight
{
EdgeGroup _meshes
[
{
EdgeMesh _mesh
[
"Models\NaturalResource\DecoTrees\DecorativeHighlightMesh.rsc:edge"
]
}
{
EdgeMesh _mesh
[
"Models\NaturalResource\DecoTrees\DecorativeHighlightMesh.rsc:edge"
]
}
{
EdgeMesh _mesh
[
"Models\NaturalResource\DecoTrees\DecorativeHighlightMesh.rsc:edge"
]
}
]

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


my example has 3 "F" , you , you need 4 of those.


Quote from: Voeille on May 21, 2018, 01:05:57 PM
  • They should have the tree animation

what you mean by tree animations ? because trees can have animations but i am pretty sure it is not what you think, the trees animations are the part where they fall to the ground and then disappear. and not the part where they have their leaves moving, changing colors and disappear in winter.


Quote from: Voeille on May 21, 2018, 01:05:57 PM
  • I want them to change leaf colour for autumn, but I don't want the leaves to vanish in winter, just cover with snow

it is set inside your leaves texture files in Models/MaterialInstance. instead of:    Material _material = "Material\Opaque\OpaqueMaterial.rsc";
you will use :   Material _material = "Material\Billboard\BillboardMaterial.rsc";

i am not sure if you can add snow on it in winters because as soon you use ModelAlpha function it tends to imunne it to snow unless you find a way to do it with your AO file.

the turn to orange is set by the billboard Material
while the 3rd channel wrap up is set in your 3D model fbx and it decides the fact it shrink to nothingness (disappearing) in winter. you will need to check the tutos in tuto section to how to do it in blender.


Quote from: Voeille on May 21, 2018, 01:05:57 PM
  • They should appear in my section under the common toolbar

when you've set your section under common toolbar, did you set all your categories at begining ? like the examples i did in the common toolbar tuto. i ve shown i prepared in advance all the category i wished... RKfood.. RKresources... RKservices... RKdecorations... and inside my decoration, i set in advances some of sub categories like RKfences... RKtrees.... RKanimals....

i explained you need to set your toolbar structure in advance (even if you wont use it) because the first mod in your list need to have all sub categories or they wont show up
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Voeille

Thanks! I'll try to set the categories and see if that will make it appear in the game.

elemental

Looking forward to seeing them (and using them).

Do you plan to make them non ground-flattening? It makes them easier to use with other mods if ghost decos don't flatten ground.

Voeille

Yes, that would be good, I also prefer when ghosted deco doesn't flatten terrain.

I set up the toolbar like in the example from the tutorial, but the model still doesn't appear anywhere in the menu in game, so I must've done something else wrong.

New files

RedKetchup

Quote from: Voeille on May 21, 2018, 07:44:57 PM
Yes, that would be good, I also prefer when ghosted deco doesn't flatten terrain.

I set up the toolbar like in the example from the tutorial, but the model still doesn't appear anywhere in the menu in game, so I must've done something else wrong.

New files

ok gonna go check. btw sorry i just saw you posted the files in the 1st post
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

RedKetchup

#6
Quote from: RedKetchup on May 21, 2018, 08:04:28 PM
ok gonna go check.

ok first i didnt want to go explore everything and let you fix things :)

but i checked what you asked : the missing icons

first thing i've done, i fixed the mess about the Build.bat.. the Package.rsc... and your resources root file.


there is no need to "call" your root DecorativePlants.rsc file 2 times. since you want to use a DecorativePlantsResources.rsc root file (which i prefer you do and work properly...)
so i deleted your external list from your package. you dont need that. and in your .bat i called directly your resources root file:

Build.bat :

..\..\bin\x64\Tools-x64.exe /build DecorativePlantsResources.rsc /pathres ../example/DecorativePlants /pathdat ../example/DecorativePlants/bin
..\..\bin\x64\Tools-x64.exe /mod Package.rsc:DecorativePlants /pathres ../example/DecorativePlants /pathdat ../example/DecorativePlants/bin


Package.rsc :

PackageFile DecorativePlants
{
String _name = "Fern1";
String _author = "Voeille";
String _description = "x";
String _icon = "icon.png";
String _preview = "preview.jpg";
int _userVersion = 1;

// all files in resource directory
String _includeList
[
"*"
]

// exclude package files, mod files, file used for building packages
String _excludeList
[
"Package_*.crs"
"*.pkg"
"*.pkm"
]
}


then your missing icons :
you are missing 2 lines in your DecorativePlants.rsc toolbar root file :

Toolbar DecorativePlants
{
Toolbar _parent = "Game\VToolbar.rsc:Vdecorations";
int _sortPriority = 700;

SpriteSheet _spriteSheet = "UI/Fern1SpriteSheet.rsc";
StringTable _stringTable = "UI/Fern1StringTable.rsc";

Action _action = Tool;
ComponentDescription _tool = "Template/Fern1.rsc";

bool _autoHotKey = true; 
}

explanations: your toolbar file doesnt know where to find your icon, so it doesnt search for it.


i ve put a copy of the files in the attachments and also a screenshot to prove your icons are there thenafter :) (Build.bat and Package.rsc and DecorativePlants.rsc) in an attached .zip below.
you will see your next challenge in that screenshot that you will need to fix :)
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Voeille

Wow that's quite an explosive model! Could it be that Banished doesn't support rectangle texture files? E.g. 512x1024 instead of full 1024x1024. The model looks completely different too, and there's no alpha. Thanks for the help with files :)

RedKetchup

#8
Quote from: Voeille on May 21, 2018, 08:40:39 PM
Wow that's quite an explosive model! Could it be that Banished doesn't support rectangle texture files? E.g. 512x1024 instead of full 1024x1024. The model looks completely different too, and there's no alpha. Thanks for the help with files :)

oh they do support those number. but i wont recommend it, the things should be too small to see any difference. we cannot zoom enough in the game we can see a difference. you will eat memory for nothing. but it does handle those 512 and 1024 numbers.

you mesh hasnt been exported in your .fbx with the good "units". if you keep the same units, then you will have to rescale down your mesh to maybe ... 5% of original scale.
about the alpha, you dont even use the "Texture/ModelAlphaTexture.rsc" material in your /Models/MaterialInstance/Fern1Texture.rsc
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Voeille

I fixed the alpha, but the model is still massive and with wrong shape despite scaling it down according to the apiary building (I deleted the apiary parts after that to leave just the fern parts). Also, when I actually click on the ground to place it, the game crashes with a division by 0 error, so I suppose I must have something else wrong, maybe in Template\Fern1.rsc? I used the well template and removed some things from it, so maybe I removed too much.



Files again

RedKetchup

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

RedKetchup

i compiled and put the .pkm in WinData folder. the screenshot is what it gave me. it didnt crashed at all but the units are still bad.
each time you compile, make sure you delete everytime the bin and build folders it create each time you compile. that way you are sure everything has been updated.
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

RedKetchup

i imported your fbx in my 3dsmax and re-exported... is the supposely the good size ?
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

RedKetchup

not sure how you did it... it is weird in my 3dsmax
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Tom Sawyer

Hi @Voeille, nice to see a new modelmaker on board. :)

From your picture in Blender it looks to me like a missing game tile scaling factor. The thing is that a banished game tile is not 1 meter but a citizens height. I use 1.66666666667 m for it to have a simple factor of 0.6 when modeling in real size and scaling it to the game. So if your original fern model was made in meters then just scale it down this way and it will keep its proportion.

In your fern1.rsc are a couple of wrong things. One that will crash the game is adding happiness around an item placed on 0 x 0 tiles. That probably causes your /0 exception. You have copied the well.rsc and not cleaned it up fully. I send you a file from a ghosted bench including its upgrade item which is necessary to get rid of it in game. So you can look at it or just copy and alter.