# Auto-battery converter!

**URL:** https://discourse.cataclysmdda.org/t/auto-battery-converter/5100
**Category:** The Drawing Board
**Created:** [February 16, 2014, 9:26pm UTC](https://discourse.cataclysmdda.org/t/auto-battery-converter/5100 "2014-02-16T21:26:34Z")
**Posts on this page:** 15
**Page:** 3

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex016/uploads/cataclysmdda/original/1X/21b5d044e8473b25d0bf905d60477e25f6fbe0cf.png) [@system](https://discourse.cataclysmdda.org/u/system)
#### Post date: [February 19, 2014, 2:03am UTC](https://discourse.cataclysmdda.org/t/auto-battery-converter/5100/41 "2014-02-19T02:03:45Z")

</div>

Yeah seriously.

---

<div class="post-metadata">

### Author: ![John\_Candlebury](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/john_candlebury/32/6437_2.png) [@John\_Candlebury](https://discourse.cataclysmdda.org/u/John_Candlebury)
#### Post date: [February 19, 2014, 8:16am UTC](https://discourse.cataclysmdda.org/t/auto-battery-converter/5100/42 "2014-02-19T08:16:39Z")

</div>

> [@HunterAlpha1](#):
>
> speaking of wondering zombies hordes, any timeline on their implementation?

I would say next release if being optimist or 3 releases from now (without counting 0.A) if being pessimist.

My point is that biofuel is something we should have, but it should relatively expensive and timeconsuming to manufacture, not just chop down a tree and run your car for 2000 miles, but rather harvest your corn farm, wait 5 days for the fuel to be produced in a tank and then run 2000 miles.

---

<div class="post-metadata">

### Author: ![Soyweiser](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/soyweiser/32/37_2.png) [@Soyweiser](https://discourse.cataclysmdda.org/u/Soyweiser)
#### Post date: [February 19, 2014, 1:35pm UTC](https://discourse.cataclysmdda.org/t/auto-battery-converter/5100/43 "2014-02-19T13:35:07Z")

</div>

> [@juliawang87](#):
>
> You’re missing the whole point. If you can’t play the game without habitually exploiting every unbalanced option, I’d argue that there’s something wrong with your manner of play.

So… I cannot tell others how to play, but you can tell me the way I play is wrong?

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex016/uploads/cataclysmdda/original/1X/21b5d044e8473b25d0bf905d60477e25f6fbe0cf.png) [@system](https://discourse.cataclysmdda.org/u/system)
#### Post date: [February 19, 2014, 2:24pm UTC](https://discourse.cataclysmdda.org/t/auto-battery-converter/5100/44 "2014-02-19T14:24:33Z")

</div>

It’s like using the debug system every time you see a zombie. Or always exploiting an infinite ammo bug. If it detracts from your fun why are you doing it?

---

<div class="post-metadata">

### Author: ![Soyweiser](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/soyweiser/32/37_2.png) [@Soyweiser](https://discourse.cataclysmdda.org/u/Soyweiser)
#### Post date: [February 19, 2014, 2:31pm UTC](https://discourse.cataclysmdda.org/t/auto-battery-converter/5100/45 "2014-02-19T14:31:01Z")

</div>

> [@gtaguy](#):
>
> It’s like using the debug system every time you see a zombie. Or always exploiting an infinite ammo bug. If it detracts from your fun why are you doing it?

I’m not doing that tbh. I’m just pointing out the flaws in the “don’t tell others how to play” argument as used here.

(If I find infinite ammo bugs, I fix them, or report them).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex016/uploads/cataclysmdda/original/1X/21b5d044e8473b25d0bf905d60477e25f6fbe0cf.png) [@system](https://discourse.cataclysmdda.org/u/system)
#### Post date: [February 19, 2014, 2:32pm UTC](https://discourse.cataclysmdda.org/t/auto-battery-converter/5100/46 "2014-02-19T14:32:41Z")

</div>

Soy.  
Is there any way to make an engine require two fuelsources?

---

<div class="post-metadata">

### Author: ![Soyweiser](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/soyweiser/32/37_2.png) [@Soyweiser](https://discourse.cataclysmdda.org/u/Soyweiser)
#### Post date: [February 19, 2014, 2:41pm UTC](https://discourse.cataclysmdda.org/t/auto-battery-converter/5100/47 "2014-02-19T14:41:20Z")

</div>

No idea. Using json files I think not yet.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex016/uploads/cataclysmdda/original/1X/21b5d044e8473b25d0bf905d60477e25f6fbe0cf.png) [@system](https://discourse.cataclysmdda.org/u/system)
#### Post date: [February 19, 2014, 2:52pm UTC](https://discourse.cataclysmdda.org/t/auto-battery-converter/5100/48 "2014-02-19T14:52:15Z")

</div>

Soyweiser.  
How do I re-use existing engine code? Can’t I just copy-paste at the end of the line?

---

<div class="post-metadata">

### Author: ![Soyweiser](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/soyweiser/32/37_2.png) [@Soyweiser](https://discourse.cataclysmdda.org/u/Soyweiser)
#### Post date: [February 19, 2014, 3:55pm UTC](https://discourse.cataclysmdda.org/t/auto-battery-converter/5100/49 "2014-02-19T15:55:39Z")

</div>

That depends a lot on which code you are using for what. So… cannot help you with specifics without a lot more explanations. (And I have not looked at the engine code).

Do you mean the c++ code (in cpp or .h files) or the .json code?

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex016/uploads/cataclysmdda/original/1X/21b5d044e8473b25d0bf905d60477e25f6fbe0cf.png) [@system](https://discourse.cataclysmdda.org/u/system)
#### Post date: [February 19, 2014, 4:00pm UTC](https://discourse.cataclysmdda.org/t/auto-battery-converter/5100/50 "2014-02-19T16:00:28Z")

</div>

The jsons.

---

<div class="post-metadata">

### Author: ![Soyweiser](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/soyweiser/32/37_2.png) [@Soyweiser](https://discourse.cataclysmdda.org/u/Soyweiser)
#### Post date: [February 19, 2014, 4:11pm UTC](https://discourse.cataclysmdda.org/t/auto-battery-converter/5100/51 "2014-02-19T16:11:41Z")

</div>

If you want a new engine you have to edit:  
vehicle\_parts.json for the vehicle object. (this is the part show on the examine vehicle screen ingame)  
(Just create a new engines description in the file, ideally after other related engines.)  
Like this:

```auto
... },{
        "type" : "vehicle_part",
        "id" : "engine_1cyl",
        "name" : "1-cylinder engine",
        "symbol" : "*",
        "color" : "light_red",
        "broken_symbol" : "#",
        "broken_color" : "red",
        "damage_modifier" : 80,
        "durability" : 150,
        "epower" : 0,
        "fuel_type" : "gasoline",
        "item" : "1cyl_combustion",
        "difficulty" : 2,
        "location" : "engine_block",
        "flags" : ["ENGINE", "VARIABLE_SIZE"],
        "breaks_into" : [
            {"item": "steel_lump", "min": 5, "max": 10},
            {"item": "steel_chunk", "min": 5, "max": 10},
            {"item": "scrap", "min": 5, "max": 10}
        ]
    },{
        "type" : "vehicle_part",
        "id" : "engine_GTA",
        "name" : "GTA ENGINE!",
        "symbol" : "*",
        "color" : "light_red",
        "broken_symbol" : "#",
        "broken_color" : "red",
        "damage_modifier" : 80,
        "durability" : 150,
        "epower" : 0,
        "fuel_type" : "gasoline",
        "item" : "gta_combustion",
        "difficulty" : 2,
        "location" : "engine_block",
        "flags" : ["ENGINE", "VARIABLE_SIZE"],
        "breaks_into" : [
            {"item": "steel_lump", "min": 5, "max": 10},
            {"item": "steel_chunk", "min": 5, "max": 10},
            {"item": "scrap", "min": 5, "max": 10}
        ]
    },{ ...
```

With the id being unique (no other vehicle object can use that name).  
The item field is the item used to install the object. Which you also need to define in items/vehicle\_parts.json (or var\_vehicle\_parts.json, but no idea how that works).

Then you can use the debug menu to spawn the new engine, and install it.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex016/uploads/cataclysmdda/original/1X/21b5d044e8473b25d0bf905d60477e25f6fbe0cf.png) [@system](https://discourse.cataclysmdda.org/u/system)
#### Post date: [February 19, 2014, 4:28pm UTC](https://discourse.cataclysmdda.org/t/auto-battery-converter/5100/52 "2014-02-19T16:28:52Z")

</div>

I looked, no way to define a new fuel type without going into actual C++ stuff.

---

<div class="post-metadata">

### Author: ![Ironstone](https://avatars.discourse-cdn.com/v4/letter/i/898d66/32.png) [@Ironstone](https://discourse.cataclysmdda.org/u/Ironstone)
#### Post date: [February 19, 2014, 11:01pm UTC](https://discourse.cataclysmdda.org/t/auto-battery-converter/5100/53 "2014-02-19T23:01:26Z")

</div>

> I looked, no way to define a new fuel type without going into actual C++ stuff.

Yeah, I found the same thing. Looks like we’re stuck on bio fuels or endurium until fuel usage is in jsons.

---

<div class="post-metadata">

### Author: ![wad67](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/wad67/32/7_2.png) [@wad67](https://discourse.cataclysmdda.org/u/wad67)
#### Post date: [February 20, 2014, 11:00am UTC](https://discourse.cataclysmdda.org/t/auto-battery-converter/5100/54 "2014-02-20T11:00:18Z")

</div>

I managed to add “steam” and “oil” as a fuel a while back for my incomplete steam engine mod. It’s fairly easy to do, but setting up a suitable environment to do so is much harder.

I had the fuel types working fine, and I was going to push them to github but I have no conception how.

---

<div class="post-metadata">

### Author: ![Soyweiser](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/soyweiser/32/37_2.png) [@Soyweiser](https://discourse.cataclysmdda.org/u/Soyweiser)
#### Post date: [February 20, 2014, 11:12am UTC](https://discourse.cataclysmdda.org/t/auto-battery-converter/5100/55 "2014-02-20T11:12:05Z")

</div>

[https://github.com/CleverRaven/Cataclysm-DDA/blob/master/CONTRIBUTING.md](https://github.com/CleverRaven/Cataclysm-DDA/blob/master/CONTRIBUTING.md) this should give a good starting guide.

[Previous page](https://discourse.cataclysmdda.org/t/auto-battery-converter/5100.md?page=2)
