CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.33k stars 4.14k forks source link

add "rotates_toward" attribute for furniture/terrain #51619

Closed I-am-Erk closed 2 years ago

I-am-Erk commented 3 years ago

Is your feature request related to a problem? Please describe.

We're having a tough time drawing street lights with the normal L shape, as they can only face one direction in the code.

Describe the solution you'd like

Furniture currently has a nice dynamic rotation script that makes chairs face away from walls.

I would like the option to specify rotates_toward in a furniture or terrain object's JSON, with the accepted argument being a current connects_to group. This would override any other default rotation behaviour. For example:

"rotates_toward": [ "PAVEMENT" ]

--> causes a street light to face the nearest pavement.

"rotates_toward": [ "WATER" ]

--> could be used for dockside furniture and terrain

Complications

There are a few things I would like to be able to call here that are not connects_to groups and couldn't easily be. The main one is indoor floors. It would be nice if windows and doors could rotate to face indoor floors, because then we could put the blinds/shutters/boards on the correct side of the window. I am unaware of any other times we might want to do that but couldn't use a connects_to group.

Describe alternatives you've considered

Other ways of specifying rotation and connection, such as explicitly listing terrain a furniture should rotate towards

Additional context

If we could combine rotation with multitiles, we'd be able to do some other cool effects.

mlange-42 commented 2 years ago

Notice for subscribers: implemented in #60666. PR ready for review now.