[Question] Conditional Dialogue (Can this be done?)

Kefke

Steampunker
I've been playing around with the idea of seeing if I can make a mod that will roll variant NPCs, in the same way as there are variant ores and evils. So, for example, instead of a Painter, you might get an Artist. Or instead of a Stylist, you'd get a Barber. I'd be trying to make them different from what the base NPC offers, but mostly sidegrade. More something just to make worlds more interesting.

The thing I realized, though, is that there are a number of lines from many of the NPCs that relate to other NPCs. In particular, I remembered that the Clothier talks about leaving the Mechanic in the Dungeon. Now, I know that you can have a line based on which NPCs are already present, but is there a way to have a line based on which NPC is going to spawn? If not, I'd need to make sure that if I do an alt for the Mechanic, the Clothier's comments still apply.

Moreover, though, how difficult is it to add new lines to characters, so that they will talk about the alt NPCs if present?

(And yes, all of this is dependent on actually being able to mess with spawn conditions so that I can actually do variants in the first place, but there's no point in worrying about that if the much simpler task of writing dialogue has an insurmountable problem.)
 
You can add lines for alt NPCs without an issue, you'd just check to see if that NPC has spawned or not when choosing a dialogue line.

For checking on which NPC is going to spawn, if it's completely random, then no I don't think you can. If you set some type of variable for your world on generation to determine which NPC to will spawn later, you can base the dialogue on that variable as well.
 
What about adding conditions to existing lines? For instance, let's say I wanted to replace the Goblin Tinkerer with another type of monster, but then also wanted that to tie to swapping the Goblin Army with an invasion of that type of monster as well. Could I add a condition to the Princess' line, "Goblins are so cute! They are short, and have those little pointy ears, and they come in different colors!" so that she only says that if the variable is set to Goblins?
 
That's a quite interesting concept, and question, but doesn't it also brings up the question of compatibility with other mods? E.g. several mods have items that are sold by vanilla NPCs. If you replace the vanilla NPC with a different one, would they also have the cross-mod content, whatever items from another mod? That sounds like a difficult thing to make it work with all mods that do such things.
 
That's a quite interesting concept, and question, but doesn't it also brings up the question of compatibility with other mods? E.g. several mods have items that are sold by vanilla NPCs. If you replace the vanilla NPC with a different one, would they also have the cross-mod content, whatever items from another mod? That sounds like a difficult thing to make it work with all mods that do such things.
Definitely something I'm going to have to consider. Thanks for the feedback.
I'm thinking inherent compatibility should be doable if I can use the same shop list for both, and have any differences in the lists be set up as items that only show up when certain conditions are met, with one of those conditions being "Spawn flag set to NPC X/Y".
 
Back
Top Bottom