# Extensibility for vehicle parts to have new tool features(flags)

**URL:** <https://discourse.cataclysmdda.org/t/extensibility-for-vehicle-parts-to-have-new-tool-features-flags/12127>\
**Category:** The Drawing Board\
**Created:** [June 29, 2016, 8:05am UTC](https://discourse.cataclysmdda.org/t/extensibility-for-vehicle-parts-to-have-new-tool-features-flags/12127 "2016-06-29T08:05:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![CodeSeg](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/codeseg/32/7247_2.png) [@CodeSeg](https://discourse.cataclysmdda.org/u/CodeSeg)\
**Post date:** [June 29, 2016, 8:05am UTC](https://discourse.cataclysmdda.org/t/extensibility-for-vehicle-parts-to-have-new-tool-features-flags/12127/1 "2016-06-29T08:05:12Z")

</div>

Currently, the features which vehicle parts might have are limited. A vehicle part could have one or more flags in

```auto

```

but not ones added in mods. I designed a new tool with a new flag “CHEMLAB\_ADVANCED” and realized I couldn’t design a new vehicle part having the same tool feature.  
So I thought allowing defining new vehicle parts’ FLAG in mods might be a cool idea.  
For example, a large keg installed allows you to make wine while you are driving around. 🙂

---

<div class="post-metadata">

**Author:** ![Coolthulhu](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/coolthulhu/32/2446_2.png) [@Coolthulhu](https://discourse.cataclysmdda.org/u/Coolthulhu)\
**Post date:** [June 29, 2016, 9:05am UTC](https://discourse.cataclysmdda.org/t/extensibility-for-vehicle-parts-to-have-new-tool-features-flags/12127/2 "2016-06-29T09:05:15Z")

</div>

Check out data/json/vehicleparts/engineering.json  
It has tool qualities on vehicle parts.

---

<div class="post-metadata">

**Author:** ![CodeSeg](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/codeseg/32/7247_2.png) [@CodeSeg](https://discourse.cataclysmdda.org/u/CodeSeg)\
**Post date:** [June 29, 2016, 2:08pm UTC](https://discourse.cataclysmdda.org/t/extensibility-for-vehicle-parts-to-have-new-tool-features-flags/12127/3 "2016-06-29T14:08:16Z")

</div>

[quote=“Coolthulhu, post:2, topic:12127”]Check out data/json/vehicleparts/engineering.json  
It has tool qualities on vehicle parts.[/quote]  
I mean, what about new tools that consume power?  
For example, I designed a tool named Advanced Chemistry Set(has lv3 “CHEM” quality), which is used to make Methanol and other chemicals added in my mod. And I want to implement a similar vehicle part which consumes vehicle’s power. However, when deciding tools on a vehicle, only these flags are checked: KITCHEN, FAUCET, WELDRIG, CRAFTRIG, CHEMLAB and CARGO.  
Here’s the codes in inventory.cpp, line 468:

```auto
        const int kpart = veh->part_with_feature(vpart, "KITCHEN");
        const int faupart = veh->part_with_feature(vpart, "FAUCET");
        const int weldpart = veh->part_with_feature(vpart, "WELDRIG");
        const int craftpart = veh->part_with_feature(vpart, "CRAFTRIG");
        const int forgepart = veh->part_with_feature(vpart, "FORGE");
        const int chempart = veh->part_with_feature(vpart, "CHEMLAB");
        const int cargo = veh->part_with_feature(vpart, "CARGO");
        if (cargo >= 0) {
            // ...
        }
        if(faupart >= 0 ) {
            // ...
        }
        .....
```

Earlier today, I saw your idea about separating “engine” and “game” and making the core game into a “core mod”. It is really a great idea!  
And it will definitely solve my problem, right? 🙂

---

<div class="post-metadata">

**Author:** ![Coolthulhu](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/coolthulhu/32/2446_2.png) [@Coolthulhu](https://discourse.cataclysmdda.org/u/Coolthulhu)\
**Post date:** [June 29, 2016, 2:34pm UTC](https://discourse.cataclysmdda.org/t/extensibility-for-vehicle-parts-to-have-new-tool-features-flags/12127/4 "2016-06-29T14:34:36Z")

</div>

Nope, those are hardcoded.

You can still have a CHEMLAB and chem 3 quality on the same part.
