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, March 27, 2007

Has It Been a Month?

I guess it has been a month since I last wrote something here. It's not that I haven't been working on the module, I just haven't been writing about it. I started this blog because, when I first started work on the module, I really wanted to have a place to write about the things I was learning and doing, and now I guess I feel less of an urge to do so.

Anyway, in the last few weeks I created two new areas: an outside area with a monastery, and the monastery interior. Creating the latter was kind of frustrating because of the lack of options in the tile sets. I could either use one of the prefab interiors, none of which were really to my liking, or I could use something from the castle interior tileset, which also wasn't to my liking. I finally went with one of the prefabs, then played around with the tile properties to create a sort of dim, candlelit interior. I think I eventually went with "interior: sewers" to get the effect I wanted.

The scene inside the monastery is that it's been attacked by brigands, and several of the monks have been killed or wounded. So first, I put in a couple of dead monks. I already knew how to make face-down corpses, but I wanted some of them to be face-up, so I consulted the scripting guide. Turns out that the script in the guide had an error in it (not the first time this has happened), so with some help from the forum, I figured out how to make that work. Then I added in a few other monks: some tending to the wounded monks, one of them praying over a dead monk, and one just sitting against the wall in a daze. Getting each to work quite right was a minor challenge. For the sitting monk, I wanted to make sure he stayed seated when the PC talked to him, and I wanted him to reply with just one line. That wasn't hard, but when I tested it out, the monk turned toward the PC addressing him while remaining seated. I eventually solved this by applying a paralysis effect to him, though when I first tried that, he wouldn't say his line. I can't remember how I resolved this, but I did. I'll have to look at the script again.

For the other monks, I first tried putting the requisite animation scripts in their OnHeartbeat slot, but that didn't really give me the effect I wanted. So I put it in the OnSpawn script, and that made it work. The only reason I didn't try that at first was because I had tried it previously in another area, and it hadn't worked, but looking back now, I realize the problem was that I had set the duration way too low, so that by the time the PC got in range of the NPC, the NPC had already finished performing the animation. Anyway, once I got that done, the next step was to set up how they'd interact with the PC. I wanted them to speak one line without interupting their animation and without turning to face the PC. I tried a one-line conversation first, but the problem was that they would turn to face the PC, so I switched to a ActionSpeakString script in the OnConversation event. Then they wouldn't change facing, but also wouldn't speak at all. Finally, I figured out that the animation script in their OnSpawn was overriding the OnConversation script, so I put ClearAllActions at the start of the OnConversation script, and everything worked fine.

Oh, and I also learned how take the candle placeable - which appears as lit - and make it unlit.

I also worked on creating what will be the first of two, limited-term henchmen in the module. The first is a 3rd-level cleric that will accompany the PC for one sidequest. Because henchman creation seemed very daunting, I decided to go with one of the pre-made ones on the Vault, and I ended up choosing the Module Builder Henchman's Kit because it was the most popular one available. This may or may not have been a good choice. It's a very full-featured system that allows henchmen to do a lot of things and gives me a lot of control over how they behave. However, it's possibly a bit too full-featured for my needs, considering the henchmen aren't going to be a big part of the module. I'm going to have to do a whole lot of editing on the conversation that came with it to eliminate all the options I don't need, and it might have been easier just to write the conversation and then put in the scripts I need. I also might just write the conversation and then copy over only the scripts I need, rather than trying to cut down and rewrite the one that comes in the system. I also had to mess with some of the module scripts to integrate my changes with the changes in the henchman system, but I think that may have been mostly unnecessary, as I simply don't need all the functionality the system offers.

Finally, I also learned how to incrementally increase the value on a variable. This was actually one of the more frustrating things because it looked simple, and I felt like it was something I should have been able to figure out on my own, but I couldn't. I tried following the example in Celowin's tutorial, but the problem was that I followed it too closely without truly understanding it, so as a result, it didn't work because it wasn't written to do something similar to what I wanted to do, which isn't the same as doing what I wanted it to do. It turned out that the problem was simple - the script was refering to the trigger when it should have been refering to the player character - and someone on the forum showed me how to rewrite it both to make it work and make it more elegant.

I'm actually trying to focus a lot more intently on this project now. I'm trying to work on it after work, instead of just on the weekends. To that end, I'm actually taking a bit of a break from playing NWN, because when I'm in the process of playing a module, I find that it tends to suck up a lot of my free time.