Putting the "character" back in "non player character"

Funny. I just thought about that when I began reading through the comments. My first thought was “why not make the topics based on what they lived like before?”.

Soldiers could explain how they escaped a FEMA camp or something. A nurse a hospital. Then variations on a theme. The nurse didn’t go to work “Lucky me…wonder how they managed?”. Crap like that. The 7 day week would be a interesting marker if we had that. “So there I was in the coffee shop and this tank rolls up with my military buddies yelling at me to get in…pfftt. It was the weekend guys! Screw working!”

1 Like

Update for the interested: thanks for the feedback, I remain excited about this. I am now compiling what I have into a JSON, after a week with very few breaks… I’ve finally had enough time to study the NPC_Traits mod and figure out how it does things, so now it should just be a matter of doing the copy-and-paste legwork.

I hope to be able to test a super-prototypical version of this by the end of my lunch break, just adding randomly selected background dialogue to the currently existing classes, with a couple of them (eg Doctor) getting unique options.

I can’t wait. I’m sure people more clever than me can use this as a useful framework for sure.

It does seem to be coming together smoother than I thought. It took me a while to understand what I was looking at, but now that I’ve got it, it makes quite a lot of sense and should make for a pretty reasonable framework for developing stuff later.

I’m already getting pretty excited about the prospect of adding more to this like personality traits that influence Snippet conversation, so that NPCs will use different phrases depending on who they are

OK! I have the traits made and the dialogue associated with them, and I can get the game running, and NPCs start with the correct traits for their professions.

All that remains is to make NPC party members populate with a dialogue option to just chat (talk_leader?) which will then feed into the various personal stories I’m adding via JSON. It would be good to keep this really open… Presently I’m adding the “survivor stories”, but I want to also add more types of stories under the same header later.

Also, I’d love it if just chatting with the camp manager was also an option despite them not counting as in your party…

I’m under the impression that this part has to be coded in. Is that right?

I’ll upload my prototypic files to my Google drive and share them in a bit. They’re still very basic, I haven’t finished adding all the stories in, wanted to get it to run first.

EDIT: zip of the json files, set up as a mod. It should work for any vanilla NPC class at this time, although the stories they get are pretty boring until I finish the legwork. Like I said above, this is not yet a functioning mod until the NPCs get a dialogue option to activate the talk trees, but they are in there.
https://drive.google.com/open?id=1D04RHfQIbxDQ40afSnMaq3Ptu3wmEc7k

1 Like

Please fork the main repo on github and make your changes in your forked repo. It’s much easier for everyone else to review your stuff that way.

Multiple talk_topics can use the same dynamic lines and responses. See data/json/npcs/TALK_COMMON_MISSSION.json for an example with the “About that job” responses. You just want to assign the basic dialogue to TALK_LEADER and TALK_CAMP_OVERSEER.

Off to go write some more support code.

Support code written:

2 Likes

Thanks for that. I guess there was no way around me learning how to GitHub. I’m sure it’s easier than deciphering json for the first time.

Github isn’t too bad, and you’ll need to learn it if you want your stuff accepted into mainline.

For the record, I’m still on this. Wrote another ten or so stories today. All my written stories are now translated to JSON, and my JSON files have been tested for bugs and run pretty well. I am certain they’re not as cleanly coded as possible (it has literally been twelve years and three degrees since I did any work scripting), but they run. I will be ready to set up a PR very soon… I want to make sure there’s a wide enough range of stories that every default NPC class has a few unique ones. Almost there.

Let me strongly recommend that you submit a work-in-progress PR now. People want to see what you’re doing and we can start review before you finish debugging.

I used to wait to submit my PRs until they were done and perfect, and I’ve since realized its better to submit them as soon as I have something. It doesn’t even have to work. Just be enough that other people can look at it and figure out what I’m trying to do.

Submit early, submit often. It really helps.

1 Like

I trust your experience in this. I’ll get a pr together.

Ok, honestly I think git was trickier than JSON in the end.

https://github.com/CleverRaven/Cataclysm-DDA/issues/26834 however, voila

3 Likes

Im just reading along and noticed something about missions somewhere, It would be appreciable if it NPCs were coded not to give me a mission that spawns a Jabberwock 1 tile away from us.
Solution: The kill Jabberwock could be coded to spawn the Jabberwock no closer than X tiles.

Dunno about the Jabberwock in specific, but at some point during all this I’m going to revisit NPC starting missions and have them gate to specific NPC backgrounds. Currently they may not make any sense to the NPC’s backstory.

Or like

“Your not nice but the fact that you have just turned into the perfect human (alpha) it’s a bit of a turn off”