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.

Monday, December 25, 2006

Yet Another Lesson About the Smallest Things Can Become The Biggest Headaches

It's Xmas day and I did not end up getting NWN2, but I did get a new graphics card so that when I finally do pick it up, I'll (hopefully) be able to run it. But anyway, over the long weekend I put in some time on the module, and finally created two new areas and started work on a third. I would have had more done, but I got very caught up in mapping out the course of the module in Paint. Doing this was not only useful, but necessary, as I now have a sense of how many exterior areas I need, where different encounters will take place, and what the terrain should look like in each area. However, I got a little too obsessive doing the map, and spent way too much time tweaking it and changing it and so on.

The three areas I worked on were an outdoor area, an abanoned house, and a cellar for the house. One of the more frustrating things I had to deal with was setting up a few triggered encounters of the sort where "If the PC has variable X set to number Y, then trigger the encounter, and then change a different variable so that if the player passes over the trigger again, it won't go off again." I've done this a bunch of times, but I've done it in different ways, and part of the problem is that I don't fully grasp how if/else works in conjunction with "GetIs" functions. I know that sometimes you want "GetIs" before an if/else statement and sometimes you want "!Get/Is" before it, but I'm having trouble sorting out how it works. I recently discovered a trigger wasn't working because I had the former when I should have had the latter, but every other time i've used the former.

Anyway, as it turned out my real problems weren't with that, but with paying attention to the little things. I couldn't get the first trigger to work until I realized that I had typed the variable the script was looking for in all lowercase when, in fact, the first letter should have been capitalized. The second trigger, however, nearly gave me fits. The idea was simple: when the PC walks into the house, he gets a variable put on him set to the value of 1. When he walks out, he steps on a trigger that checks for that variable, and then activates the encounter. Since the PC won't have the variable on him until he goes inside, he can pass over that trigger on the way into the house without setting it off. It seemed simple enough - and in fact, I'd done it before - but I simply could not get the thing to work. At first I thought it had something to do with the arrangement of the code, and so I copied a script that worked exactly the same way as I wanted this trigger to work, but it still didn't work. The variables matched, and everything looked ok. I finally figured it out by accident: after the encounter didn't trigger for the 10th time, I didn't log out of the game for whatever reason. Suddenly, my PC was attacked, but the attackers came from the opposite direction of the spawn point. I tried it a few more times, and got the same results - the reason it took them so long to show was because they were stopping to attack a bird. Then, I finally figured out what happened: when I was setting up the spawn point, I accidentally moved it off the edge of the area, at which point the game automatically puts it in the lower right corner. Instead of deleting it, I just created a new spawn point, figuring that it would automatically eliminate the old one. It didn't, and the monsters kept spawning at the original point. At least a half-hour of agita could have been avoided had I not made this one tiny mistake.

Desigining the interior of the house was easy, and it also wasn't too hard to figure out how to set up a secret trapdoor to take the player down to the cellar. Designing the cellar was a lot tougher, because I couldn't find a tileset that I liked. I finally ended up going with the kitchen tileset, which wasn't ideal because I had to make the area much larger than I liked. I could have gone with a one-tile kitchen room, but that has a fixed doorway, which I didn't want. I tried using some placeable walls to cover it, but that just looked stupid in the game. I also tried partitioning off a smaller section of the larger kitchen room with placeable walls, but that looked even worse. So I'm stuck with a large cellar. It took a bit of trial and error to set up a placeable ladder that, when clicked on, would take the PC back upstairs; although the code is simple, I put it in the OnClick event instead of the OnUsed event, and then forgot to change the script to use "GetLastUsedBy" instead of "GetLastClicked." Ai yi yi! But I finally got it all working, and was pleased at having done something new. The last thing I did was start putting down some placeables. Next, I have to finish with the placeables, and then I want to set up an encounter with a ghost. I just haven't decided how to trigger it yet. I might have it go off when the PC opens a chest, or I might have it go off when the PC picks up a piece of jewelry, or I might just have it activate when the PC passes over a trigger, but have it delay 30 seconds before firing.

0 Comments:

Post a Comment

<< Home