Trying to create NPCs

Post » Sat May 28, 2011 7:14 am

Hi, I hope you can help - I'm tentatively trying my hand at the Oblivion construction set, and it's all a bit, well, overwhelming...

I dabbled with the CS for morrowind several years ago, and made a simple quest, but I never really got it working the way I wanted.

Several years later, and with 250 active mods, it's about time I gave something back to the community!

What I'm trying to do I *think* should be pretty simple, but I'm following the advice http://cs.elderscrolls.com/constwiki/index.php/How_do_you_set_up_a_scripted_conversation_between_two_or_more_NPCs%3F and getting confused.

I have various mods that add NPCs, but what I'm trying to do is to create some that actually go shopping! Enter shops, browse and appear to buy, then move on to the next shop. Even with Extended Imperial City, FCOM and TIE, I've never seen any NPCs already shopping when I get there.

What I've done so far is to create a new NPC and set up a schedule to find a target vendor, stay there for an hour, then move onto the next shop. All appears to work fine, the shopper finds the target vendor and usually chats with them. What I'm now trying to do is to force a conversation between the shopper and the vendor, so I hear them bartering. Ideally I'd like to use the voiced dialogue from the Player/Vendor barter settings (eg "I can't afford that!", etc) if I could find it, but I'm fine with silent subtitled conversation. Even better, I'd like to set it up so that if the player interrupts them, the vendor's disposition will go down and he will refuse to deal with the player until he has finished serving the NPC.

Am I asking too much, or is there a simple way of creating this?
User avatar
Charlie Ramsden
 
Posts: 3434
Joined: Fri Jun 15, 2007 7:53 pm

Post » Sat May 28, 2011 2:35 am

If you create a GREETING for the NPC with a condition of the target being a merchant, you should be able to get the conversation started the way you want. If the merchant starts the conversation, it won't be business, but that's not unreasonable.

Then looks at the NQDxxxx quests to see how Non-Quest Dialog is set up and use that pattern to organize your conversations. In general, each conversation has a quest variable to show it's running and how far along it's gone, which gets set bck to zero when the conversation is over.

You should then be able to check those variables to see if any dialog is in progress to achieve your "no interruptions" objective. However, that may mean changing the merchants in ways that cause mod incompatibilities, so I'd leave this to last!
User avatar
Emmanuel Morales
 
Posts: 3433
Joined: Sat Oct 06, 2007 2:03 pm

Post » Fri May 27, 2011 9:00 pm

Great, thanks for the advice - I'm looking at the NQDQuests right now, but I'm afraid I can't make heads or tails of it! I can't even see what I should be looking at. :(

I think this is far too advanced for my understanding of the construction kit - I've got a few NPCs now scheduled to go to different shops at different times, but after staring blankly at the CS wiki and google for the past couple of hours, I can't seem to work out how to use the Oblivion dialogue system.

Would anybody be able to talk me through step-by-step what I should be doing next, or at least point me to a "dialogue for dummies" page other than http://cs.elderscrolls.com/constwiki/index.php/How_do_you_set_up_a_scripted_conversation_between_two_or_more_NPCs%3F?

Thanks again
User avatar
Sammygirl500
 
Posts: 3511
Joined: Wed Jun 14, 2006 4:46 pm

Post » Sat May 28, 2011 12:21 am

I posted a tutorial at ORE on this because someone was trying to the same sort of thing for a house mod. http://ljosa.proboards.com/index.cgi?board=npc&action=display&thread=3410 is only useful if you're a member there, but I can probably put a version somewhere else if it would be useful.
User avatar
Catherine Harte
 
Posts: 3379
Joined: Sat Aug 26, 2006 12:58 pm

Post » Fri May 27, 2011 9:34 pm

Aha! Thank you very much! I've just registered with ORE, and am now following the tutorial :)
User avatar
Steve Bates
 
Posts: 3447
Joined: Sun Aug 26, 2007 2:51 pm

Post » Fri May 27, 2011 10:31 pm

Ok, so thanks to the tutorial, this is what I did next:

1) Created new faction "NQD-NPCBarterFaction"
2) Created new quest ID "NQDNPCBarter" (named "NQD NPCBarter Quest")
3) Created new script "NQDNPCBarterQuest" with just the one line "Scriptname NQD-NPCBarterQuest"
4) Under Quest data, set GetPlayerInSEWorld=0 with target set to 0 and function info none
5) Under Quest data, set GetIsPlayableRace=1 with target set to 0 and function info none
6) Under Quest data, set GetInFaction=1 with target set to 0 and function info "Faction:'NPCBarterFaction'"
7) Under Quest data, set GetInFaction=1 with target set to 1 and function info "Faction:'NPCBarterFaction'"
8) Under Conversation, select the "Hello" editor ID

I'm kind of foggy on what I should be doing next...

I'd like my shopper, Selvia Vitellius, to speak with (for example) Jensine the merchant at the market district. Do I need to make them both members of the same NPCBarterFaction for this to work?
How do I control their conversation (or a selection of options for appropriate responses to the conversation), so for example Selvia or Jensine say "Hello", the response being either "Do you have any new wares today" or "That looks interesting, how much do you want for that?" to which the response would be along the lines of "Nothing new for sale" or "I'd be selling my soul to let this go" and so on.

Thanks again!
User avatar
Toby Green
 
Posts: 3365
Joined: Sun May 27, 2007 5:27 pm

Post » Sat May 28, 2011 4:46 am

I'd forget about having a Barter Faction. The factions just help select who can say the line, and it's usually easiest to have those global to the quest, but not necessary, especially if you want an individual NPC to say them. Just use GetIsId on the Topic instead of the GetInFaction test on the whole quest. The conditions on the quest apply to ALL the topics, and you really do not want to edit the existing merchants, so I'd leave those off at the quest level for your case. You may be able to use (GetMerchantContainer != 0) to identify merchants in general, or someone else may suggest a better way - I think there are one or two merchants who don't have a container, and would give a false negative this way.

The example I used in that tutorial was a situation where any person who lived in AnyTown could start a conversation with any other resident, and talk about local things, and the quest variable was used to control what they talk about. Your case is easier, because the specific merchant is enough to control the topic of conversation, you just need to have GetIsId testing the right end of each info to make the conversation appropriate. It's probably also possible to devise a test (maybe using GetClass?) to match any weapon merchant, for example, instead of an individual, but if you're doing this for one location, such as the IC Market District, it doesn't give much benefit over GetIsId.

If you need to have a conversation longer than one prompt/response pair, you need a variable to measure how far along the dialog has reached, so that the info's come out in the right sequence. They're also needed if you have more than one dialog for a given NPC, to select which one you're following.

The important thing to note is the "Link To" and "Link From" topics, which determine the list of possibles that the game looks in next. They're what allows it to continue a conversation, and conversely, tells it when it can break off to a GOODBYE, or switch topic to "other provinces" or whatever. During a haggling session, you want the links to be on-topic, but you'd allow others at the start and end.
User avatar
Alada Vaginah
 
Posts: 3368
Joined: Sun Jun 25, 2006 8:31 pm


Return to IV - Oblivion