CleverRaven / Cataclysm-DDA

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

[RFC] Drawbridges for crossing multiple pits #24397

Closed mlangsdorf closed 6 years ago

mlangsdorf commented 6 years ago

I want to add a drawbridge, a construction similar to a palisade gate, but that would instead over multiple rows and columns of pits (including spiked or glass pits). Basically, I'd like to have a 2x7 row of pits with an easy way to get my vehicle across it.

I would need to add the following terrain:

controls_drawbridge would be a combination of the existing open_gate and pit_covered functions, converting the existing pit terrain to pit_bridged. unfortunately, there's no way to store a flag or quality for terrain, so there's no way to indicate that the drawbridge is N rows wide. short of creating t_drawbridge_up1 through t_drawbridge_up6 (or so) terrains and having controls_drawbridge know how many rows of spits to cover based on the number, which is inelegant at best.

acidia commented 6 years ago

If you're looking for easy but not-so-great suggestions, you can always implement it the way I was using computers to unlock doors in the labs. It would just convert all t_door_locked to t_door_closed_unlocked, or whatever, that fell within range x of the control device. You'd build your draw bridge on all the pit tiles and call them all up or all down. Works well for RPing but I doubt the players would like it since the bridge doesn't go "up" in a tile, it just disappears and re-appears.

Amariithynar commented 6 years ago

Perhaps a secondary "build" that counts as a Drawbridge Tile, but when you activate the Drawbridge Winch "folds" (like the Foldable Vehicles mod) all those tiles into a single length "Raised Drawbridge" band of tiles as wide as the Drawbridge Base tiles that you initially set, that counts as a wall, blocking line of sight as well as line of effect?

mlangsdorf commented 6 years ago

The trick is how to determine the number of tiles that a raised drawbridge supports, because there's no way to save state about a terrain tile. Furniture tiles can have inventories that are saved, but some of the furniture interactions are limited.

Amariithynar commented 6 years ago

That's why I suggested having it work like the Folding Vehicles mod; as far as I understand it, it remembers the vehicle blueprint in the folded vehicle's information, and upon unfolding it, recreates the vehicle. Or is that an impossibility?

mlangsdorf commented 6 years ago

Closing this because I don't have time to work on it.