Khaligufzel / Dimensionfall

A survival game inspired by Cataclysm: Dark Days Ahead and Bright Nights.
MIT License
13 stars 5 forks source link

Apply custom itemgroup to furniture in mapeditor #222

Closed snipercup closed 4 months ago

snipercup commented 4 months ago

Right now a default itemgroup is applied to furniture if it is marked as a container. For example, you can define a wardrobe as a container and assign it an itemgroup that has some clothes in it. When you place it on the map, it will be filled with clothes from that itemgroup.

But what if you want to put that wardrobe in a police station and fill it with uniforms?

My idea is to have the brushcomposer in the mapeditor accept itemgroups as droppable data. The itemgroup will be added to the brushcomposed alongside the selected furniture brushes. If this itemgroup is present, all furniture currently present in the brushcomposer will get that itemgroup applied to it's data (on the condition that it is a container).

The way it would work is:

Later, when generating the map, the chunk generator will override the furniture's itemgroup with the one specified on the map.

We can use this to re-use furniture to make a diverse collection of shops in a town.