Crichton
Prophet
- Joined
- Jul 7, 2004
- Messages
- 1,214
So I've recently figured out how to make some simple procedurally generated quests in the NWN2 toolset. There are a few caveats; I can't journal entries on the fly, so each quest type from a given quest-giver use the same set of journal entries and are hence "one at a time".
Sample Code:
void main() {
object oPC = GetFirstPC();
int i, n;
string sTemplate, sNumber;
i = Random(2);
n = Random(10);
sNumber =IntToString(n);
if (i==0) {
SetCustomToken(1000, "Spears");
sTemplate = "nw_wplss001"; // Tag in Caps
}
if (i==1) {
SetCustomToken(1000, "Hides");
sTemplate = "n2_crft_hideleather"; // Also the tag
}
SetCustomToken(2000,sNumber);
SetGlobalInt("Number",n);
SetGlobalString("Template",sTemplate);
CreateItemOnObject(sTemplate,oPC,n, "", 1);
}
Convo line:
Very well, take these <CUSTOM2000> <CUSTOM1000> to the gnome.
Journal Entries:
I have been contracted to deliever <CUSTOM2000> <CUSTOM1000> to the gnome.
I have delivered <CUSTOM2000> <CUSTOM1000> to the gnome.
I have failed to deliever the <CUSTOM1000> and must make restitution.
My business with the Dwarf is finished.
My current module is just about finished and trying to add more quests to it at this point would require too much effort. But I plan to make procedural quests the backbone of my next mod. The big question is, how?
There weren't enough quest-types in Daggerfall to keep me interested (at least not with the scuzzy gameplay) and they all seemed to boil down to tromping through a nearly identical dungeon and stomping $Monster.
So what kind of quests should I try to create and how should I try to spice things up? Keep in mind that I want every quest to involve something more than walking to $NPC and clicking pickpocket.
Current prospective quest-type list:
Hunting (bring back $number $animal part)
Escort (spawn an NPC of $Type with $Name who wants to be taken to $Area)
Delivery (as above, with possible bandit attack on area transition where the PC can skip the fight and fail the quest by handing over the goods)
Bounty Hunting (Kill $Dude out in the wilderness)
Robbery (hold up $merchant on $road)
Sample Code:
void main() {
object oPC = GetFirstPC();
int i, n;
string sTemplate, sNumber;
i = Random(2);
n = Random(10);
sNumber =IntToString(n);
if (i==0) {
SetCustomToken(1000, "Spears");
sTemplate = "nw_wplss001"; // Tag in Caps
}
if (i==1) {
SetCustomToken(1000, "Hides");
sTemplate = "n2_crft_hideleather"; // Also the tag
}
SetCustomToken(2000,sNumber);
SetGlobalInt("Number",n);
SetGlobalString("Template",sTemplate);
CreateItemOnObject(sTemplate,oPC,n, "", 1);
}
Convo line:
Very well, take these <CUSTOM2000> <CUSTOM1000> to the gnome.
Journal Entries:
I have been contracted to deliever <CUSTOM2000> <CUSTOM1000> to the gnome.
I have delivered <CUSTOM2000> <CUSTOM1000> to the gnome.
I have failed to deliever the <CUSTOM1000> and must make restitution.
My business with the Dwarf is finished.
My current module is just about finished and trying to add more quests to it at this point would require too much effort. But I plan to make procedural quests the backbone of my next mod. The big question is, how?
There weren't enough quest-types in Daggerfall to keep me interested (at least not with the scuzzy gameplay) and they all seemed to boil down to tromping through a nearly identical dungeon and stomping $Monster.
So what kind of quests should I try to create and how should I try to spice things up? Keep in mind that I want every quest to involve something more than walking to $NPC and clicking pickpocket.
Current prospective quest-type list:
Hunting (bring back $number $animal part)
Escort (spawn an NPC of $Type with $Name who wants to be taken to $Area)
Delivery (as above, with possible bandit attack on area transition where the PC can skip the fight and fail the quest by handing over the goods)
Bounty Hunting (Kill $Dude out in the wilderness)
Robbery (hold up $merchant on $road)