Dispatches From Neverwinter

A journal of my progress as I (attempt to) learn how to build modules for Neverwinter Nights.

Name:
Location: United States

Started playing Neverwinter Nights back in November '05 and got hooked. Tried to write my own module, but I just didn't have the time. Maybe I'll try again someday.

Tuesday, May 29, 2007

Contest

Spent a lot of time finishing up Bertram's conversation, which ended up being a little more complicated than I thought because I had to account for the fact that a player might go to the bandit camp before going to the monastery, pick up the cup, and then put it back. It's also possible that they might see the cup and not pick it up, but I'm not going to bother accounting for that. I also got another area 95% completed. I'm starting to find area creation tedious, mainly because I'm just recreating the same rural areas over and over again, and there's only so much I can do to make them look different when they're basically a bunch of flat plains with a road and a few trees. Fortunately, this is the last Kingsroad area I need to do, although there are still plenty of other rural areas to work on.

I just saw this weekend that Bioware is having a module-building contest with an eye toward hiring a world designer to work for them in Austin. As such, once I'm done this subquest with the bandit camp, I'm going to start working on the forest section - which I hadn't planned to get to for some time - next, but with a few changes. I'm going to build it as a self-contained module, and it won't have any custom content. The beginning is also going to be very different from what I originally planned - there will be a cutscene but there won't be any elves, and I'll probably replace the first challenge with something else. The other two challenges will probably be designed as I originally envisioned them, and I'll import them into my current module once I'm done with the module for the contest. I figure the chance of me winning is slim to none, since I don't really have the technical chops, but I do have the creativity, and I think I can do dialogue better than most. Besides, it's not like I have anything to lose.

Thursday, May 24, 2007

Simplification

After writing down everything I needed to do for the cupquest, I figured out a way to cut out a lot of the complexity by exploiting an aspect of my module usually not found in other modules. All (or almost all) of the north/south transitions along the Kingsroad will let the PC go north, but not south. Once the PC has left an area going north, he can never go back to that area again. The idea is that the PC is fleeing northward, and so they wouldn't ever want to go south. Because of this, I realized I could completely cut out the possibility of the PC killing Thaddeus and then going back to the monastery by placing the henchman interjection trigger in the area immediately north of the area with the monastery. That way, if the player decides to go north after accepting the quest, in the next area Thaddeus will abandon the PC, and the PC won't be able to go back to the monastery. More importantly, if the player decides to go north after retrieving the cup, Thaddeus will attack him, and if the PC kills him, he won't have the option of returning to the monastery.

This cuts out the need to keep track of all sorts of variables in all sorts of places, and also cuts out the need to write a big chunk of dialogue. Best of all, it prevents the player from doing something weirdly irrational. As such, the conversation nodes and variables I need to deal with are a lot simpler, and look like this:

1) The PC has accepted the quest, but hasn't completed it. (Cupquest = 1).
2) The PC has the cup, but hasn't finished the quest. (Cupquest = 2).
3) The PC has finished the quest (Cupquest = 4).
4) The PC has the cup, but never recieved the quest to begin with (Cupquest = 5).
5) The PC returned the cup, having never recieved the quest to begin with (Cupquest = 3).

Cupquest = 3 was originally supposed to be set if Thaddeus was killed by an NPC. However, I realized that wouldn't work and didn't make sense. Instead, I added a line to Thaddeus' OnDeath script that sets the variable "thad_dead" to 1. That way, when the PC returns the cup to Bertram, I can reference that variable to include a conversation thread that acknowledges that Thaddeus is dead.

I've modified the OnDeath script and the Acquire_Item script to account for the necessary changes. I also turned Bertram and the other monks into genuine clerics and assigned them to their own faction. I now have to write all the necessary conversations for Bertram and Thaddeus, and include scripts to make them go hostile, and to have Thaddeus run off, when necessary. I'll also need to create a new area and put the Henchman trigger for Thaddeus in there. Being able to cut out a lot of that chaff has definitely brightened my mood.

Wednesday, May 23, 2007

Conversation Complications

Working on the Cup sidequest last night, I began to see that the conversation with Father Bertram is going to end up being much more complicated than I thought. Initially, it seemed pretty straightforward: The PC talks to Bertram and is offered the quest. If he takes it, Brother Thaddeus offers to go with him as a henchmen. So the conversation nodes have to cover the following:

1) The PC meets Father Bertram for the first time.
2) The PC has taken the quest, but doesn't have the cup.
3) The PC has the cup, but hasn't finished the quest.
4) The PC has finished the quest.

All of these, except for the first, need to be tracked with a variable. 'The variable is called "cupquest," and right now the values assigned to it work out like this:

1 = The PC has taken the quest, but doesn't have the cup.
2 = The PC has the cup, but hasn't finished the quest.
3 = The PC has the cup, but hasn't finished the quest, and Thaddeus is dead.
4 = The PC has finished the quest.

Number 3 is where the complications start to creep in. Thaddeus is only meant to be a henchman for the duration of this one sidequest. I don't want the PC to be able to hire him, then ignore the sidequest and carry on with the main quest. So I set up a trigger similar to the one I set up for Jocen & Crissa, where if the PC makes like he's going to leave the area by following the road north, Thaddeus will interject and then leave. This itself isn't complex, except for the fact that I had to learn how to set up a non-random interjection trigger for the henchman, and I don't fully understand the instructions. What gets complex is if the PC recovers the cup and then decides to run off with it instead of returning it. Actually, this wouldn't be a big deal, except that he might have Thaddeus as a henchman. Not only will Thaddeus have to interject, but it'll have to be a different interjection than the one that comes up if the PC decides to bugger off before he gets the cup.

Now, if the PC tries to leave without the cup, then Thaddeus will simply return to the monastery. The variable won't change, and if the PC changes his mind, he can go back and rehire him, and there's no problem. However, if he tries to leave with the cup, Thaddeus will actually try to stop him, and may get killed. If the player does the logical thing and moves on, no problem. However, I have to allow for the fact that the PC might kill Thaddeus, then change his mind and go to the monastery and talk to Bertram anyway. This wouldn't make much sense, and in fact, I'm not sure how to write the dialogue for it, but a player could concievably do this, so I have to allow for it. And, in order to maintain some kind of realism, I have to allow that the PC might talk to Bertram after killing Thaddeus and then decide not to return the cup (if they kill Thaddeus, that is; if he just goes straight to the monastery to return it, I'm not going to allow for the option of the PC not returning it in this case, because if they wanted to keep it, there's no reason for them to go back to the monastery at all). In fact, since they'll only kill Thaddeus if they were planning to bugger off with the cup, there's no reason to assume they'd then give the cup back. In fact, it makes no sense that they'd go to the monastery at all, but again, I have to allow for this. My only other option is to simply not let them go back into the monastery after killing Thaddeus, but that isn't realistic either.

Anyway, I was simply going to add a bit of script to Thaddeus OnDeath event that would change the value of cupquest to 3 when Thaddeus was killed. Then I remembered that Thaddeus might very well be killed by an NPC. Obviously, I don't want dialogue to come up suggesting that the PC killed Thaddeus if they didn't, but I do want Bertram to ask about Thaddeus if he's dead, so in fact, I'm going to have to write a couple of scripts that essentially say the following:

1) If the PC tries to leave (i.e. follow the road north), but doesn't have the cup, Thaddeus will return to the monastery (if he's been hired as a henchman).
2) If Thaddeus is killed, set the value of cupquest to 3.
3) If the PC tries to leave, and has the cup, Thaddeus will attack the PC.
4) If the PC kills Thaddeus (which can only happen if #3 happens first), set the value of cupquest to 5.

Numbers 1 & 3 when the PC steps into a trigger, and I've already begun working on that. To handle this, the PC will be assigned the variable "quitter" with a value of 1 (if they try to leave without the cup), or 2 (if they try to leave with the cup) Numbers 2 & 4 will have to be written into Thaddeus OnDeath script, which will end up looking something like this.

If
Thaddeus is killed,
and the value of quitter is not 2
set the value of cupquest to 3.
Else
set the value of cupquest to 5.


This means I need the following conversation nodes for Bertram:

1) The PC meets Father Bertram for the first time.2) The PC has taken the quest, but doesn't have the cup. (cupquest = 1)3) The PC has the cup, but hasn't finished the quest, and Thaddeus is alive. (cupquest = 2)
4) The PC has the cup, but hasn't finished the quest, and Thaddeus was killed by an NPC. (cupquest = 3)4) The PC has finished the quest. (cupquest=4)
5) The PC has the cup, but hasn't finished the quest, and the PC killed Thaddeus. (cupquest = 5)

The last option is extremely annoying, because it might very well lead to the PC getting into a fight with Bertram, which means that now I have to recreate Bertram as an actual cleric, rather than as just a commoner.

Now, aside from all this, I just realized there's another possibility: the PC could wander into the area, and then decide to head west, toward the bandits, without going into the monastery first. That means the PC could get the cup without ever recieving the quest, and then they might decide to go to the monastery and talk to Bertram. At the moment, I have a script that triggers a journal entry for the quest when the PC acquires the cup. If the PC never got the quest, this won't make sense, so I'm going to have to rewrite it so that it looks like this:

If
the PC has the value of cupquest set to 1
set the value of cupquest to 2
and add the journal entry
Else
Set the value of cupquest to 6

Then, I have to add a sixth conversation node to Bertram to cover the PC having acquired the cup without ever recieving the quest. In this case, the PC might decide to mention the cup, or not. If they do, then they might decide to give the cup to Bertram, or not. If they don't, then I need a script which makes everyone in the monastery attack the PC.

And finally, theres the matter of the reward: a holy symbol which only works if the PC is one of the faithful or is favored by Naamar. I wrote it this way because the PC could concievably kill Thaddeus and take his holy symbol, and it didn't seem right to me that Naamar would offer his protection to the PC after the PC just killed one of his servants. If the PC takes the quest and returns the cup (without killing Thaddeus), he gets this boon. If he kills Thaddeus... well, I might not put in the option to return the cup. Or maybe the PC feels remorse and does have the option to return the cup, but if he does, the holy symbol won't work (I think I'll need a journal entry to explain this, since the PC could lie to Bertram about killing Thaddeus). If the PC brings back the cup without ever having taken the quest, he doesn't get the holy symbol at all.

Oh, and on top of all that, I need to make a custom faction for Bertram, Thaddeus, and the monks, so that they can all go hostile if need be.

So to sum up, I need to include scripts and/or conversation nodes to handle all of the following:

The PC has Thaddeus as a henchman and tries to leave before acquiring the cup.
(req: henchman trigger, conversation node)
The PC has Thaddeus as a henchman and tries to leave after acquiring the cup.
(req: henchman trigger, conversation node, Thaddeus turns hostile, set variable "quitter" to 2)
The PC kills Thaddeus.
(OnDeath script, set variable "cupquest" to 5)
Thaddeus is killed by an NPC.
(OnDeath script, set variable "cupquest"to 3)
The PC talks to Bertram after he has the cup, and Thaddeus is alive.
(Conversation node, set variable "cupquest"to 4)
The PC talks to Bertram after he has the cup, and Thaddeus was killed by an NPC.
(Conversation node, set variable "cupqest" to 4)
The PC kills Thaddeus and refuses to return the cup, and Bertram turns hostile.
(Conversation node, set variable "cupquest" to 7)
The PC kills Thaddeus, but then decides to return the cup anyway.
(Conversation node, set variable "cupqest" to 4 (?))
The PC acquires the cup after recieving the quest.
(OnAcquire script, set Journal entry, set variable "cupquest"to 2)
The PC acquires the cup without recieving the quest.
(OnAcquire script, set variable "cupquest"to 6)
The PC returns the cup without recieving the quest.
(Conversation node, set variable "cupqest" to 4 (?))
The PC refuses to return the cup, and has never recieved the quest, which makes Bertram and everyone else in the monastery turn hostile.
(Conversation node, set variable "cupqest" to 7 (?))
The PC acquires a holy symbol without accepting and finishing the quest, so it doesn't work.
(On acquire script, journal entry)
The PC acquires a holy symbol, having accepted the quest, but then having killed Thaddeus, so it doesn't work.
(On acquire script, journal entry)
The PC acquires a holy symbol, having accepted and finished the quest, and it does work.
(On acquire script, journal entry, set variable "favored" to 1)
(There is no way for the PC to get a holy symbol if they returned the cup without having accepted the quest first).

I think that about covers it.

Tuesday, May 22, 2007

Henchmen

Achieved a small success last night in that I figured out how to add an NPC as a henchman while in a conversation with a different NPC. It was actually pretty simple to do. What threw me off is that I used the Module Builders Henchman Kit, which, in retrospect, was a mistake. It's a useful system for a module that relies heavily on henchmen, but mine only uses them in a limited way, and so I don't need the level of complexity it offers. Also, because I'm new to this, I couldn't really understand the scripts used in the kit, which are very advanced. In fact, I ended up slightly modifying the basic add henchman script from the game and using that instead.

I also added in a new bit where one of the NPCs walks over to a holy water basin, does a short animation, and then returns and gives the player two vials of "blessed water," which are basically just cure light wounds potions. I was able to re-use an older script, so that was easy, but I also had to add a few new conversation lines, then cut the remainder of the conversation and paste it to the last new line. This, unfortunately, broke all the links in that part of the conversation, so I had to waste time recreating them all. Other than that, I had to do a bunch of tweaking so that the NPC who gets the water actually faces and stands near the basin, and I also so that the second NPC doesn't come over too soon (because it looks odd with him just standing there), or too late (because then he starts talking before he's next to the PC).

Overall, though I didn't work on it long, I felt like I achieved something positive, and that my momentum is returning.

Monday, May 21, 2007

Long Hiatus Over

After neglecting the module for a long time, I finally got back to work on it this weekend. Most of that work involved working on a complex conversation. It's mostly done, though I might add a little more to it. Also, I might break it into two different conversations. As it stands, a second NPC interrupts the first conversation and starts a new conversation with the PC. However, since the first NPC doesn't talk again, I may as well just make it a seperate conversation. More to the point, the PC has the option of adding the second NPC as a henchman, but since the conversation begins with the first one, the PC ends up hiring him instead. So I either have to figure out how to change the script so that the PC hires the right NPC, or I just have to split the conversation. The second option doesn't require any script changes, but I may have to rewrite a lot of the conversation, since I don't think I can copy nodes from one conversation to another.

Other than that, I did a bunch of minor things: fixing up things that broke when I had to reinstall the game, figuring out how to have a magic item only work when used by an NPC, and other stuff like that. It feels good to finally get back to work on this project.