Choose Your Language

Tuesday, 23 October 2012

Show Me The Way (Misbehaving Waypoints)

Before discussing this post's topic, I just wanted to let people know that The Althéa Weather System is now on version 1.03. The latest version fixes things such as cloud height and splash heights, and also has other effects added such as fog and dust storms. All these settings are easily adjustable for those with even basic scripting knowledge - and if used in conjunction with a module, can add some great atmosphere to an area.

The Wayward Patrol

I have started to work on creatures that players can encounter. This includes creatures that can be spawned via an encounter trigger and those already placed within an area at build time. As soon as I tested my first patrol of goblins, I encountered two problems:

1) The goblins did not drop what I expected them to drop according to their templates.
2) The goblins had their own ideas of where they wanted to patrol, even after I added waypoints!

Talk about creatures having a mind of their own! Unfortunately, this meant what little time I normally spend trying to build was spent sorting out more official campaign script. After some experimenting, I soon discovered that "spawned" creatures act differently to "placed" creatures when it came to identifying items in their loot drops. Eventually, I managed to update my own creature spawn and death scripts to ensure they only dropped what I wanted them to drop and identify (or not) the items accordingly. There is also a trick I learned from the forums that said to place items you want the creature to drop in their inventory (and mark as droppable) and to make sure all equipped items (like weapons and armour they use) are always marked non-drop. (If you want the creature to drop equipped items, you needed to give the creature a droppabel non-equipped version in their equipment as well.) Now, I just need to add a routine that differentiates between which items I may want the creature to be able to use in their inventory, like potions!

The second problem was more annoying, as I could nto see any reason why my goblins would not follow their waypoint path. And neither could I find out anybody else who had the same problems. So, it meant I had to write the script myself to make sure they stuck to their patrol path. This meant also having to change some of the minor functions that WalkWayPoints (the main function) uses, and so also change the way scripted waypoints worked for some of my other creatures. Thankfully, it is a simple enough task when done over a few days, but it is frustrating that it robs me of being able to do more plot writing. I hope to have the amended scripts finished soon.

Toolset Plugins

The funny thing about both of these issues I had, is that I was pointed to NWN2 Legends and the great work of Marshall as an alternative means to solve these issues. And if my own code had not already been written the way it has been, I think I would have delighted in using some of his systems designed as plugins to the toolset. However, as much as I would have liked to do so, I do not believe I can due to the fundamental differences between how our two games work. That said, however, I was so impressed by Marshall's plugins and what they could do, it did spur my own interest to look at plugins for the toolset again. Not just in implementing them, but maybe (if I ever get the time) actually designing some of my own to help me build the module more easily - and make tasks simpler. The problem is, my health limits me as to how much I can do, and if I do spend some time designing a plugin, I have to weigh up if the time spent making it will be rewarded in the time it helps save me in further module development. Thankfully, MS C# is a free downloadable program nowadays, and so the tools are there ... it now depends on its overall benefit.

The Opening Screen of MS C#
I have enjoyed programming for as long as I have had a computer and still have copies of The Pawn and Adlan (Adventure Language) for my old Amstrad. I even recall a database program I wrote in BASIC once (many years ago when I was fit and healthy in body and mind) that handled monster combat for my D&D pen and paper game. As C# seems very similar to NWN Script, I thought I might be able to try to combine a hobby of old with that of what I can still do now ... but, as I say, I am yet to convince myself that the time spent making a plugin will be worth it. Still, I like the idea, and if I ever have an extra burst of inspiration and enthusiasm, I may have a play and see where it takes me.

2 comments:

Master Changer said...

Hi Lance,

The plugins discussion is very interesting to me. There have been a lot of plugins created and used for NWN2 all along, but at this point in the life of the game it really seems like they are the new frontier. You've been looking at toolset plugins to help in building while I had looked at NWNX plugins to extend the engine/client.

I had also worked through some of the Learned Visual Studios .NET lessons (I think you referenced those somewhere) -- they're very helpful. Still, I definitely would need a bridge to really learn how to develop C# plugins for NWN2 specifically. NWNX plugin development, especially, is way under-documented: for ex. how do the .cs, .h, and .dll files interact to create your plugin behavior?

I think there's a lot of potential here for nwscripters to grow into the next gen of plugin developers, but the learning curve is definitely a challenge.

Lance Botelle (Bard of Althéa) said...

Hi MC,

Having tried to look at some source code, I have to agree with you. There is a lack of information, and I have decided to put a hold on my interest here for the time being, as it would slow down what I am already trying to do - and it is already slow enough!

Maybe it is something I can return to when I have more time and energy to spend on it. At the very least, I would like to finsh my campaign!

Good to hear I am not the only one with an interest in this area as well. That suggests there is still enough interest to suggest there is life in the game yet!

Cheers!
Lance.