# JSONization of NPC classes (skills, NC handling, etc)

**URL:** <https://discourse.cataclysmdda.org/t/jsonization-of-npc-classes-skills-nc-handling-etc/10760>\
**Category:** The Drawing Board\
**Created:** [October 28, 2015, 11:48pm UTC](https://discourse.cataclysmdda.org/t/jsonization-of-npc-classes-skills-nc-handling-etc/10760 "2015-10-28T23:48:02Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Random\_dragon](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@Random\_dragon](https://discourse.cataclysmdda.org/u/Random_dragon)\
**Post date:** [October 28, 2015, 11:48pm UTC](https://discourse.cataclysmdda.org/t/jsonization-of-npc-classes-skills-nc-handling-etc/10760/1 "2015-10-28T23:48:02Z")

</div>

So, this is one thing I was pondering might be a useful feature for future endeavors, but not really a must-have for me.

The way NPC classes are handled is currently (mostly) source-only. It rolls for total skill point allotment, assigns set bonuses to certain skills, alters AI personality properties, and tells it what NC itemgroups to use for weapons, clothing, and other starter gear.

It would be useful if these could be handled by JSON files, but I’m unsure how complex that would be. It might need to be handled in steps, I assume. Just expanding on the partially-JSONized NC files would be a good first step. The item groups themselves are accessible to be edited, but being able to have an NPC (or NPC class) reference other item groups would be a useful feature as well.

---

<div class="post-metadata">

**Author:** ![Noctifer](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/noctifer/32/458_2.png) [@Noctifer](https://discourse.cataclysmdda.org/u/Noctifer)\
**Post date:** [October 29, 2015, 1:07am UTC](https://discourse.cataclysmdda.org/t/jsonization-of-npc-classes-skills-nc-handling-etc/10760/2 "2015-10-29T01:07:38Z")

</div>

From total code neewb perspective, I would assume that making it so that you can alter attitudes by json file like how you can alter opinions would be a start. Clothing could be handled by making references to specific npc id.

---

<div class="post-metadata">

**Author:** ![Random\_dragon](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@Random\_dragon](https://discourse.cataclysmdda.org/u/Random_dragon)\
**Post date:** [October 29, 2015, 2:19am UTC](https://discourse.cataclysmdda.org/t/jsonization-of-npc-classes-skills-nc-handling-etc/10760/3 "2015-10-29T02:19:30Z")

</div>

> [@Noctifer](#):
>
> From total code neewb perspective, I would assume that making it so that you can alter attitudes by json file like how you can alter opinions would be a start. Clothing could be handled by making references to specific npc id.

Possibly. I’m not 100% sure either, but yeah. Turning it into a modular file that can be used to define custom NPC classes would be the most complete way to handle it.

Then one can have your bioweapon NPCs actually spawn with whatever stuff they need that isn’t covered by the scientist or doctor NPC classes.

And I could have NPCs in arcana mod not be fulla derp. For one, I wanted the new mapgen to have an NPC wielding a symbol of judgement, that could be talked out of a fight if you said the right thing.

There were still some hurdles in addition to that, though. .\_.

---

<div class="post-metadata">

**Author:** ![Noctifer](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/noctifer/32/458_2.png) [@Noctifer](https://discourse.cataclysmdda.org/u/Noctifer)\
**Post date:** [October 29, 2015, 2:53am UTC](https://discourse.cataclysmdda.org/t/jsonization-of-npc-classes-skills-nc-handling-etc/10760/4 "2015-10-29T02:53:10Z")

</div>

Jsoning a way to change npc attitudes would allow npcs to follow you or be hostile when specific conversation choices are made. The modular clothing file could be the NC\_“insert extra here”.json with a way to reference the npc ID so it knows which npc it is referring to. From my experince in batch files (WAY diferrent than c++ I know…) Once you have the string , the id in this case (we do) you can just refer your changes to it.

---

<div class="post-metadata">

**Author:** ![Random\_dragon](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@Random\_dragon](https://discourse.cataclysmdda.org/u/Random_dragon)\
**Post date:** [October 29, 2015, 2:55am UTC](https://discourse.cataclysmdda.org/t/jsonization-of-npc-classes-skills-nc-handling-etc/10760/5 "2015-10-29T02:55:52Z")

</div>

You can already set NPC attitude though, so you can make them try to start conversation, and set their opening conversation screen, and adjut their attitude during certain responses, etc. \>.\>

---

<div class="post-metadata">

**Author:** ![Noctifer](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/noctifer/32/458_2.png) [@Noctifer](https://discourse.cataclysmdda.org/u/Noctifer)\
**Post date:** [October 29, 2015, 2:59am UTC](https://discourse.cataclysmdda.org/t/jsonization-of-npc-classes-skills-nc-handling-etc/10760/6 "2015-10-29T02:59:23Z")

</div>

I can only make them start a convo and star with costume dialogue choices but when I ask them to follow me and are successful, the next time I talk to them they simply repeat the convo.

---

<div class="post-metadata">

**Author:** ![Random\_dragon](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@Random\_dragon](https://discourse.cataclysmdda.org/u/Random_dragon)\
**Post date:** [October 29, 2015, 3:01am UTC](https://discourse.cataclysmdda.org/t/jsonization-of-npc-classes-skills-nc-handling-etc/10760/7 "2015-10-29T03:01:17Z")

</div>

Right. I PM’d you a thing that might be useful to you. \<3

---

<div class="post-metadata">

**Author:** ![Noctifer](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/noctifer/32/458_2.png) [@Noctifer](https://discourse.cataclysmdda.org/u/Noctifer)\
**Post date:** [October 29, 2015, 3:06am UTC](https://discourse.cataclysmdda.org/t/jsonization-of-npc-classes-skills-nc-handling-etc/10760/8 "2015-10-29T03:06:22Z")

</div>

Thanks, I will have a look once I have time to work on npc in the morning.

---

<div class="post-metadata">

**Author:** ![Random\_dragon](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@Random\_dragon](https://discourse.cataclysmdda.org/u/Random_dragon)\
**Post date:** [October 29, 2015, 3:09am UTC](https://discourse.cataclysmdda.org/t/jsonization-of-npc-classes-skills-nc-handling-etc/10760/9 "2015-10-29T03:09:28Z")

</div>

No worries. Hope it proves useful. If I can figure out how to display the red text as well as success odds in a conversation option…

---

<div class="post-metadata">

**Author:** ![Noctifer](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/noctifer/32/458_2.png) [@Noctifer](https://discourse.cataclysmdda.org/u/Noctifer)\
**Post date:** [October 29, 2015, 3:11am UTC](https://discourse.cataclysmdda.org/t/jsonization-of-npc-classes-skills-nc-handling-etc/10760/10 "2015-10-29T03:11:17Z")

</div>

As in the intimidate options? I believe that is hard coded from my source code dig through.

---

<div class="post-metadata">

**Author:** ![Random\_dragon](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@Random\_dragon](https://discourse.cataclysmdda.org/u/Random_dragon)\
**Post date:** [October 29, 2015, 3:13am UTC](https://discourse.cataclysmdda.org/t/jsonization-of-npc-classes-skills-nc-handling-etc/10760/11 "2015-10-29T03:13:36Z")

</div>

Mierda. .\_.

Well, the skill trial effect looked hardocded too, but I got them to work in a JSON file, or at least SEEM to work. So it might be viable.

---

<div class="post-metadata">

**Author:** ![Noctifer](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/noctifer/32/458_2.png) [@Noctifer](https://discourse.cataclysmdda.org/u/Noctifer)\
**Post date:** [October 29, 2015, 3:17am UTC](https://discourse.cataclysmdda.org/t/jsonization-of-npc-classes-skills-nc-handling-etc/10760/12 "2015-10-29T03:17:56Z")

</div>

It could be if the color function is linked with intimidation process. Otherwise there needs to be a manual way to change color in the json files. Like how we can do this here. ``

---

<div class="post-metadata">

**Author:** ![Random\_dragon](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@Random\_dragon](https://discourse.cataclysmdda.org/u/Random_dragon)\
**Post date:** [October 29, 2015, 3:19am UTC](https://discourse.cataclysmdda.org/t/jsonization-of-npc-classes-skills-nc-handling-etc/10760/13 "2015-10-29T03:19:31Z")

</div>

Possibly, yeah. I’m not sure, I might have to toy with it some.
