Peter's Resource system for Conversations
version 8 (upd Nov 2009)
(created by Peter Fryxelius, AKA Sir Vendel)
Ever tried making conversations where a lot of things are meant to happen? A conversation where nodes fire only if certain prerequisites are met (the PC has a certain alignment, has a certain item, has done something special before...)? Then you may be aware of the problem that beset me:
Each conversation node has several script slots: "Text Appears When" (a conditional for showing the node), and "Actions Taken" (upon choosing the node). Also, there are "Current File: Normal/Aborted", for behavior when conversation ends.
It all comes to an awful lot of scripts. Deekin as a henchman, in SoU and HotU, is a good example of just how many special scripts that can be attached just to one conversation (take a look at this; we're talking a three-digit number!).
The problem is the sheer number of scripts, as well as logistics (naming them in a comprehensive manner)! Builders with large worlds out there may dread the maximum number of scripts allowed in a module.
PRCONV offers the following solution: Import this .erf (including 44 scripts), then utilise them over and over again, handling each conversation with ONE new script (albeit large and ungainly, sometimes).
If you only use it one or two times in a module, or if your conversations are mostly informational and not meant to interact greatly with the PCs, you do not reap any benefit from PRCONV. It also takes some getting used to, I know.
On the other hand, I could rewrite Deekin's dialogue (a pain, but if I really needed to, I could) to one script, and all new conversations similarily would become one script each.
Download the "prconv.txt" for more information. The same information can be found at the end of the "prconv_include" library script.
Update May 2009: Added a generic lists conversation (which I have used often). Added override for spellscript to TalkTo intelligent weapon (x2_s3_intitemtlk). Setting proper PRCONV variables AS CONTROL STRINGS (includes PSTR for persistant saving of item info, local vars are no good here) will make items fire conversations.
Update Nov 2009: Thanks to CalSailX, prconv_converse has some added functionality, when used with NPCs. See script notes for more.
@ calsailx: Thanks for your heartening words of praise, sir!
v6 is uploaded. It contains minor changes, plus:
* Conversation "generic_lists", that I have often used to display lists of unknown lengths, and other conversations. The beauty of it is, that not only conditions and events can be stored in the conversation script, but even the conversation itself (as long as using English letters) can be setup, using Custom Tokens.
* Overriding spellscript for the itemproperty IntelligentWeaponTalkTo. This makes Talking To an item fire the prconv-style scripts, if variables are set properly. Uses pStr system for retaining information on items, even past character exports. Awkward, but I use it a lot.
Posted by calsailx at 2009-04-27 17:48:20 Voted 9.75 on 04/27/09
I've grown to love prconv, only reason
I needed to use the wrapper function
for my ncp's using prconv is I'm picking the tlk file to use on the
fly... if your know to the npc and
and your rep is good you might get a
random quest handed to you, if you
have one of thier quest you'll get a
quest status tlk. Other wise just
a getting to know you tlk. Random
chatter and rumors included.
If you Included a Demo module to
make the learning curve a bit less
steep for this handy program I'd give
it a 10!
Thanks for sharing this with the rest
of us, most of my convo starting
conditionals now live in a include file
thanks to this set of scripts!
@calsailx:
Hey! Glad you used it! It takes some effort to learn, but saves a lot once you do!
"prconv_converse" is the least elegant feature, I admit. But you do not need to use it with NPC, usually, as you can put conversation in their convslot. Only "PRCONV_SCRPT" var need then be set.
Posted by calsailx at 2008-09-01 03:24:30 Voted 9.75 on 04/27/09
Not a engine bug, if prconv_converse is
called from OnConversation of NPC you
get a loop as ActionStartConversation()
will fires OnConvo Event again.
Posted by calsailx at 2008-09-01 00:37:23 Voted 9.75 on 04/27/09
This is pretty sweet, but I did run into one problem not sure why but the call to ActionStartConversation() in prconv_converse would leave PC calling it again and again, if oSelf was a
NPC. If oSelf is a Placeable it didn't
happen. Ended up writing a little wrapper function that calls BeginConversation()
sending it sDialogue and oSelf as arguments. Worked like a charm after
that. 1.69 nwn and don't have an
another machine to test with an earlier
version to see if it's just a 1.69
engine issue that bit me.
If you had a small module with a NPC
set up using it, that would go a long
way in helping new users adopt it.
Just wondering if anyone else has had
this issue pop up?
Didn't forget to vote, would just like
a bit more time to work with it so it gets the vote it deserves!