Author Topic: Decorative plants  (Read 2233 times)

0 Members and 1 Guest are viewing this topic.

Offline Voeille

  • Trader
  • ****
  • Posts: 205
  • Country: 00
Decorative plants
« 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
  • 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 ;)

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 9232
  • Country: ca
Re: Decorative plants
« Reply #1 on: May 21, 2018, 04:53:29 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]
Code: [Select]
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:

Code: [Select]
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.


  • 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.


  • 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.


  • 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
« Last Edit: May 21, 2018, 04:57:53 PM by RedKetchup »
> > > Support Mods Creation developments with Paypal Donations < < <
Click here to PayPal Donate.

Offline Voeille

  • Trader
  • ****
  • Posts: 205
  • Country: 00
Re: Decorative plants
« Reply #2 on: May 21, 2018, 05:03:04 PM »
Thanks! Iíll try to set the categories and see if that will make it appear in the game.

Offline elemental

  • Architect
  • *****
  • Posts: 628
  • Country: au
Re: Decorative plants
« Reply #3 on: May 21, 2018, 07:03:03 PM »
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.

Offline Voeille

  • Trader
  • ****
  • Posts: 205
  • Country: 00
Re: Decorative plants
« Reply #4 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

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 9232
  • Country: ca
Re: Decorative plants
« Reply #5 on: May 21, 2018, 08:04:28 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 Paypal Donations < < <
Click here to PayPal Donate.

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 9232
  • Country: ca
Re: Decorative plants
« Reply #6 on: May 21, 2018, 08:28:26 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 :
Code: [Select]
..\..\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 :
Code: [Select]
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 :
Code: [Select]
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 :)
« Last Edit: May 21, 2018, 08:40:42 PM by RedKetchup »
> > > Support Mods Creation developments with Paypal Donations < < <
Click here to PayPal Donate.

Offline Voeille

  • Trader
  • ****
  • Posts: 205
  • Country: 00
Re: Decorative plants
« Reply #7 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 :)

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 9232
  • Country: ca
Re: Decorative plants
« Reply #8 on: May 21, 2018, 08:43:15 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
« Last Edit: May 21, 2018, 08:48:23 PM by RedKetchup »
> > > Support Mods Creation developments with Paypal Donations < < <
Click here to PayPal Donate.

Offline Voeille

  • Trader
  • ****
  • Posts: 205
  • Country: 00
Re: Decorative plants
« Reply #9 on: May 21, 2018, 10:35:44 PM »
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.

https://i.imgur.com/4DZyrxt.png
Decorative plants


Files again

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 9232
  • Country: ca
Re: Decorative plants
« Reply #10 on: May 21, 2018, 10:46:33 PM »
ok :) gonna check
> > > Support Mods Creation developments with Paypal Donations < < <
Click here to PayPal Donate.

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 9232
  • Country: ca
Re: Decorative plants
« Reply #11 on: May 21, 2018, 10:56:09 PM »
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 Paypal Donations < < <
Click here to PayPal Donate.

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 9232
  • Country: ca
Re: Decorative plants
« Reply #12 on: May 21, 2018, 11:14:48 PM »
i imported your fbx in my 3dsmax and re-exported... is the supposely the good size ?
> > > Support Mods Creation developments with Paypal Donations < < <
Click here to PayPal Donate.

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 9232
  • Country: ca
Re: Decorative plants
« Reply #13 on: May 21, 2018, 11:21:44 PM »
not sure how you did it... it is weird in my 3dsmax
> > > Support Mods Creation developments with Paypal Donations < < <
Click here to PayPal Donate.

Offline Tom Sawyer

  • Modders
  • Architect
  • *****
  • Posts: 849
  • Country: is
Re: Decorative plants
« Reply #14 on: May 22, 2018, 12:59:05 AM »
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.