another. For example: Two friends might bump into one another at the
night before a burglery to arrange who does what.
and call ConvScriptStart(). Instead, conversation scripts can be set up
when a PC enters/leaves a room, or when the NPC is bored.
-
Add the conversation script object to the
NPC's pAIConvScripts property.
If you want all NPCs in a specific faction to use the conversation
script, such as a secret greeting to one another, then
modify the faction's pAIConvScripts property.
Alternatively, if you want conversation scripts associated with
certain classes, such as all cRaceElf characters using a type
of conversation script, modify the AIConvScripts() method
for the class.
-
If the conversation requires more than two NPCs,
it must have pConvScriptNPCs. It must also have
a ConvScriptAutoPermutations() written. This method will
be called with a list of players and NPCs in the room. It must
return a list of all the "possible" conversations that could result.
Since there aren't that many possibilities with only two (or one) NPC,
the method is trivial and automatically handled. However, if you have
ten NPCs sitting in a room, the number of possible groups of three
NPCs to sing as a trio is astronomical.
-
You need to specify some constraints that limit what two NPCs will
join together. For example: While all NPCs might have your fish-monger
conversation at the ready, they'll only use it when they're in
the fish market. The following properties and methods help limit
the possibilities.
pConvScriptAutoFactions will limit the conversation so that
the main NPC (NPC #1) will only use the conversation with NPCs from
the specified faction(s).
pConvScriptAutoNPCs will limit the conversation so that
the main NPC (NPC #1) will only use the conversation with NPCs
listed in pConvScriptAutoNPCs. Example: Applying this to the fish monger
might mean that Betty would only talk about fish to a handful of
her friends.
pConvScriptAutoListenersExclude can be used to NOT play
the conversation if certain NPCs are in the room. This can be used to
ensures that rumors about NPC X aren't spoken while NPC X is in the room.
pConvScriptAutoKnowledge will only have the conversation
spoken if the player character doesn't know the specified
knowledge object. You would use this, for example, to have a pair of NPCs
speak a rumor only once in the precense of a specific
player. pConvScriptAutoKnowledgeFlip inverts the test,
causing the NPCs to speak the script only if the player has the given
knowledge.
pConvScriptAutoFracture will only allow the conversation
script to be spoken when the player is in the given fracture.
This is passed to IsInDifferentFracture() and FracturerQuery().
pConvScriptAutoPriority controls which automatic
conversation script has higher priority.
pConvScriptAutoRelationship lets the conversation script
only happen if a specific relationship exists.
pConvScriptAutoRequiresIntelligent ensures that conversations
only happen between intelligent creatures.
These properties won't be enough, though. You'll need
to write your own ConvScriptAutoValid() method for
many conversation scripts. The method is called whenever a conversation
script is "proposed" by ConvScripts() to see if it
would work in the given situation.
-
You will need to set the liklihood of the conversation happening
depending upon the circumstances. If you don't set at least one
of these properties to non-zero then your conversation will never
be randomly selected.
pConvScriptProbBored - The probability of the conversation
script being activated when the NPC is sitting around bored (with
the oAIGoalBoredConvScript activated). Example: Use this if the NPC
brings up the "Ever wonder what's up there?" when sitting outside
on a starry night.
pConvScriptProbNPCEnters - The probability of the conversation
script being activated when the NPC enters a room. Example: Use this if the NPC
says, "Hello everyone!" every time it enters the room.
pConvScriptProbNPC2Enters - The probability of the conversation
script being activated when a second NPC enters a room. Example: Use this if the
first NPC says, "Hi %2!" every time a second NPC enters the room.
pConvScriptProbNPC2Leaves - The probability of the conversation
script being activated when a second NPC leaves a room. Example: Use this if the
first NPC says, "That idiot has finally left." every time a second NPC leaves the room.
pConvScriptProbPCEnters - The probability of the conversation
script being activated when a PC enters a room. Example: Use this if the NPC
says, "Hey, it's the town hero!" every time the PC enters the room.
pConvScriptProbPCLeaves - The probability of the conversation
script being activated when a PC leaves a room. Example: Use this if the NPC
says, "Finally got rid of him!" every time the PC leaves the room.