Cataclysm-dda: Folding a Vehicle with solar panel and battery Bugs Electricity (Edit: Or Folding a Vehicle with Funnel and Tank At Rain)

Created on 16 Jul 2018  路  11Comments  路  Source: CleverRaven/Cataclysm-DDA

Game version:0.C-29073-g4e3224c (tiles) (Build 7573)

Operating system: windows 10

Tiles or curses: tiles

Expected behavior

When Folding a Vehicle With solar panel and any battery It should Keep the current electricity value of each battery Edit: Or Funnel And Tank installed Should maintain Tank Value

Actual behavior

Instead when Folding a vehicle with solar panel and any battery it Bugs it when unpacking gets all battery to 100% electricity Edit: Same

Steps to reproduce the behavior

Build a vehicle Like This (Look at Time And message Bar)

pic1

Vehicle Condition (Battery Electricity) Before

pic2

Folding Vehicle

pic3

UnPacking

pic4

Vehicle Condition (Buged Electricity)

pic5

<Bug> Battery / UPS Vehicles

Most helpful comment

Only small tanks (up to plastic jerrycan) are foldable, and small batteries aren't hard to have welded in or even just socketed in, where it remains when it folds up. There's simply no logic in "batteries/tanks shouldn't be foldable" when large tanks/batteries that really can't be, already aren't, and smaller ones that are lashed or welded to the frame can be easily placed to allow such. The problem here lies in foldable vehicles basically being destroyed and recreated from scratch every time you fold and unfold them (it erases "remember vehicle position" flag too). Just like how it remembers components and the name given, it needs to properly remember charge on batteries and liquids volume, as well as the position flag.

All 11 comments

Gonna see if same thing happens when there is a vehicle with Funnel + Metal Tank installed while raining

@Night-Pryanik The Same Bug to Same Vehicle With Funnel and Tank Folded in rain gives 100%

I would say vehicles with tanks and batteries should not be foldable at all.

If there is a Vehicle with no Tank then What would happen to cars BUT agree On Foldable Vehicles shouldnt have one tho

Also @ZhilkinSerg It didnt allow me to Fold Same Vehicle with 60L Tank applied Had to lower to 2L Tank

Only small tanks (up to plastic jerrycan) are foldable, and small batteries aren't hard to have welded in or even just socketed in, where it remains when it folds up. There's simply no logic in "batteries/tanks shouldn't be foldable" when large tanks/batteries that really can't be, already aren't, and smaller ones that are lashed or welded to the frame can be easily placed to allow such. The problem here lies in foldable vehicles basically being destroyed and recreated from scratch every time you fold and unfold them (it erases "remember vehicle position" flag too). Just like how it remembers components and the name given, it needs to properly remember charge on batteries and liquids volume, as well as the position flag.

Folding electric/petrol bikes exist... and are also possible/viable in game (volume for those parts stays the same, but can be attached to folding frames where the frame volume reduces when folding). Though how this can be tracked in code is obviously going to be difficult?

Could a quick swap battery slot and a quick swap fuel can slot be an option that requires less coding (use existing storage battery code?)?

Then a bike/generator when folded would drop the can/battery (this needs coding), but could be put back in quickly when unfolding.

Other option is the code it so charges are saved somewhere ready for when unfolded again.

I like that. If it's really quick and easy to drop in the battery or slot in the tanks into their holders like with the Swappable Storage Battery Case, but the batteries and tanks don't actually fold up with the foldable vehicle, I'm perfectly fine with that.

Let's not get off track, this issue is specifically for the bug that doesn't remember how many charges the vehicle battery has. It can be made into another issue if you want to change batteries and small tanks so they drop when the vehicle is folded.

Let's not get off track

Yeah, it was just an option of implementation. If they can keep their volume + charges when folded, and this is not a difficulty to program, there is no problem.

Let's not get off track, this issue is specifically for the bug that doesn't remember how many charges the vehicle battery has. It can be made into another issue if you want to change batteries and small tanks so they drop when the vehicle is folded.

We were discussing a possible method to address the issue without removing core functionality. How exactly is that off-track?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

2birdie picture 2birdie  路  3Comments

Tsunder picture Tsunder  路  3Comments

Taberone picture Taberone  路  3Comments

RogueYun picture RogueYun  路  3Comments

PlasmaChroma picture PlasmaChroma  路  3Comments