Blog from July, 2019

Before I get into this final part of the series, there is one thing you still need to do for your module. Open your module's properties and give it a description. There is nothing that screams newbie like seeing the message there is no description when you first load the module. At the minimum, it should have a brief description of what the module is about and the minimum level and preferred class needed to play it.

What Next

That is the question isn't it. You could say, "Well that's finally finished and it was too much like hard work" and simply never build another module. But I suspect that having got here, you are not going to do that. So now you need to decide what path you are going to take. You have a tiny working module. If you did the Extra Credit in Tutorial 7: Items and Inventory, there is a plot hole in your module. I am talking about the clue/MacGuffin of the "plan" note. The tutorial had you create this note and then... nothing. Now if you wanted (and let your story imagination run riot) you could use this as the springboard to a much larger adventure featuring a much larger conspiracy. You could also, with less work, just use it as the basis to unmask Veran and explore the consequences of that. This would mean editing parts of your module to make it more balanced (adjust the prices upwards in the store for a start). Also, you would need to edit (or maybe even remake) some of the conversations in the module. Alternatively, you may wish to write your own module from scratch. You have after all gained some insight into making a module now.

The thing is the tutorial we have both just finished building only scratches the surface of what there is to know about making a module. You're going to need some further resources to get you going. So, to help you with that I have some links for you. Some depend on where you bought NwN EE and some are more universal. Some of these are to the forums (you probably already know the one for where you bought the game) of the main sites that sell NwN EE. I will also, for what it's worth, add comments along the lines of how useful these sites are for module builders.

Before I get going, I will declare that I have an interest in the vault. I have been with this site since its inception and am a moderator on there. Having got that out of the way, on with the links -

The GOG NwN series Forums. To be honest I would leave this just for asking general questions about the game. Not only does it cover NwN, NwN EE and NwN 2, it also does not really cater for questions related to building. Assuming that GOG is where you bought the game, I would suggest that you try either the vault or the BeamDog forums instead.

The Beamdog NwN EE Forums. Probably the most active forums of all. Not surprising really as they are the maker of the game. Usually a friendly forum too and is well moderated. If you have any problems you will usually get people who will try to help you. In fact, the only downside to this site is that it is only a forum. They do not carry any downloadable resources on site.

The Steam NwN EE Community. If you bought your game through steam then this is your natural first port of call. As a forum this has one plus in that it has some useful pinned threads that relate to the Steam version of NwN. However, because it is not divided into sub-sections you will have to search through the forum to see if your current problem has been covered.

The Steam NwN EE Workshop. Assuming that you bought your game through steam, you will probably want to publish your finished module here. As a resource for builders though, it is sorely limited. At the time of writing this, it only has a single tutorial by Proleric on how to use horses in game.

The Vault Forums. As I have dealt with the forums for the other sites first, I'll deal the same for The Vault. A word of caution here. If you wish to post in these threads you will need to be logged into the vault itself first. Once you have done that you can log straight into these forums just by pressing the 'Log In' button. As the vault carries materials for NwN (Diamond aka 1.69) and NwN 2 as well as NwN EE specific materials, these forums reflect that. Also, while you will encounter more general posts here, the majority of the posts are concerned with building stuff for the game. These forums have a look that you may not have encountered before. This is because they are built using Discourse. As this system may be unfamiliar to you, I created a thread on how to get the best out of it.

Thread with links to tutorials. The vault is such a very large repository of files and articles spanning the very beginnings of user made content for NwN through to the present day. There are literally thousands of them on there. Because of that, this thread was created to help people locate tutorials for NwN (and hence NwN EE).

Books & Things. Because various things have already been built to try to make module building easier, this thread contains links to some of those that require little to no scripting. While that description doesn't really do justice to the things linked to, just take a look and you'll understand what I am talking about.


The Vault's Front Page. This site arose from the ashes of the old ign vault. Immediately prior to that sites demise, the community (with permission) 'rescued' the contents of that site. The vault is run by and for the wider NwN community. It is financed by voluntary contributions by members of the community and continues to expand. On it you will find (at the time of writing) over 17 years’ worth of material contributed by the community. That is literally thousands of files. Due to the foregoing it can sometimes prove difficult to find what you are looking for. If you find yourself in such a situation, just ask on the vault forums and people will try to help.

A starter Kit

Yes, I know that I have pointed you to forums and threads some of which contain oodles of links to things you can download. I realised that could prove a problem for someone whose only exposure to the toolset has been via the tutorials that we've followed (and I commented on). That being so, here are some direct links to what I consider to be the bare minimum you need to continue.

The Guide to Building Volume I – The Aurora Toolset Manual - This is (IMO) an essential reference that covers all aspects of the toolset except scripting.

The Lexicon website - A scripting treasure trove. This consists mainly of definitions for the built-in functions and constants. It also has scripting tutorials that should get you going with scripting. Especially useful for finding out about the functions added for the Enhanced Edition of NwN. This site is still maintained and errors are corrected.

The downloadable version of the lexicon - this is a chm version of the above that is updated only to the Diamond version of NwN. This is still useful as it is much faster for searching for what you want information on and you don't need to go on the internet to find that information. Contains the same tutorials as the web site.

TR's Basics - Variables, Types and Functions (TBC) - Before I say anything else, I have to admit that I wrote this one. While the tutorials in the lexicon (and elsewhere) are good and will get you writing scripts I didn't think they went quite deep enough. So, I wrote this primer for the absolute beginner to scripting. It seems to have been well received. So, if you want to know more than what the other tutorials tell you, try this. The download page also has links to the other (currently) three volumes in the series.

Lilac Soul's Script Generator, updated for NWN 1.69 (aka lstk) - This little tool can be thought of as being a step up from the built-in script wizard. It can generate a number of different types of small script including but not limited to, those that the script wizard creates. Now it may not always produce the most efficient code but the code it creates just works. Now you may think it a bit lazy to use such a tool. There is a better way to think of it - as an aid to learning how to script as well its practical application. Study the code it generates to see at least one way of doing things.

The scripting FAQs - Frequently asked questions with answers. As time goes by the same questions have been frequently asked and answered in the forums. These were collected together on an old (lost in the mists of time) thread and collected together into a couple of pdf documents. So, if you have a problem scripting wise, check here first as it may well have been asked and answered before.

Final thoughts

You finally create a module of your own. You've tested it and you think you've finished it. So, you decide it is ready for release. Stop. Instead of rushing to publish it consider doing this instead. Ask in your preferred thread (Beamdog and Vault are the best choice here) if anyone would be willing to test it out for you and report any problems they find. Fix problems they find and return to them again until they can't find any more issues. This is a form of quality assurance. Once that is done, then you can release it.

Now a plea to those that release their module on the steam workshop. Please consider releasing it on the vault as well. If you are worried about it not being as easy to download from there, don't be. There is an answer in the form of NIT.

And finally. I thank everybody who came on this journey with me. I hope you found my comments useful.

So long and thanks for all the fish. And, so it ends...

TR

Script me_acquireitem

void main()
{

// variable declarations

object oPC; // the PC that acquires the item
object oItem; // the item that was acquired

// get the item that was acquired

oItem = GetModuleItemAcquired();

// if this item is a valid object

if (GetIsObjectValid(oItem) == TRUE)
{

// if the valid item's tag is "it_RingJacen"

if (GetTag(oItem) == "it_RingJacen")
{

// get the PC that acquired the item

oPC = GetItemPossessor(oItem);

// on the PC, set the journal with the tag "jt_Falstadd"
// to its second entry

AddJournalQuestEntry("jt_Falstadd", 2, oPC);

} // if

} // if

}

Script at_falstadd03

void main()
{

// variable declarations

int iXP;

// determine how much experience this quest awards

iXP = GetJournalQuestExperience("jt_Falstadd");

// give the speaker some XP

GiveXPToCreature(GetPCSpeaker(), iXP);

}

Tutorial 9: Scripts

Let's be honest here. No tutorial of a few hundred words is going to teach you to script like a pro. What this little tutorial will do is to introduce you to the basic mechanics of using the script editor. However, even with such limited scope this tutorial still has problems. Anyway, onto the tutorial.

Follow instruction number one only of the OnAcquireItem Script section and then come back here. DO NOT DO INSTRUCTIONS 2 & 3! If you follow those instructions you will get a warning message about overwriting standard assets. Also, it is all too easy to save your new script with the name of the standard script. It is not the end of the world as your new version will only be available in your module but it is a bad habit nonetheless. Instead do this -

In the left-hand pane where the assets that your module uses are listed, right click on the word Scripts. This will bring up a context menu with a single option - New. Click on this and the script editor will launch. Follow instructions 4 and 5 in the tutorial. A word of warning here if you copy the script from the tutorial and paste it into the script editor you will lose the layout of the script (this is down to how it is stored in the pdf file). Each line will be hard against the left edge of the editor window. While it is true that this will not stop the code from being compiled it will make it harder for you to see what the script does. Being harder to see what the code does will also make it harder to find and correct any errors that may arise in your code. So, you may want to use the [Tab] key to correct the layout so it looks more like the code in the tutorial. If you do not want to go to the bother of correcting the layout, I have created a little addendum/appendix with both scripts correctly laid out.

Anyway, back to my instructions. Once you have saved your script and closed the script editor do the following. Open the module properties dialogue and click the Events tab. The very top event in the list here is the one we want - OnAquireItem. Between the drop-down box with the name of the standard script for this event and the [Edit] button there is another button with three dots on it. Click that button. This will open a file open button with a list of all the custom scripts in the module. Select me_acquireitem from this list and press the Open button. Once you do that, the script name in the drop-down box will change to me_acquireitem. Close the properties dialogue and save your module.

In contrast to the previous section, the A Custom "Action Taken" Script section has no problems at all. Well as long as you didn't miss specifying the amount of experience to give in the earlier tutorial on using the Journal editor. If you can't remember, just go and check.

Extra Credit. This final tutorial features the largest Extra Credit section of the entire document. Not only that it is quite detailed in what to do too. So, go ahead, make the conversation and create the first 2 scripts using the script wizard like the tutorial tells you to. Now at this point you may find yourself struggling because you don't quite understand what you are told to do for the third script. So, do this (have some means of recording information handy) -

  1. Save the conversation and exit the conversation editor.
  2. Assign the conversation to the miner blueprint.
  3. Update instances.
  4. Save the module.
  5. Open the fern area.
  6. Paint a waypoint near to Falstadd. This is what we'll be sending the miners to instead of Falstadd himself. It avoids the miners"harassing" Falstadd
  7. Set its Tag to "NW_Falstadd"
  8. Close the properties window.
  9. Reopen the conversation editor with the miner conversation in it.
  10. Choose the very node of the conversation branch that you are told to use.
  11. Select the Actions taken tab.
  12. Press edit.

If you have already created a script here to give the experience to the PC don't worry. We'll leave that piece of code intact and just add some more to it.

If the script that gives gold is elsewhere, again don't worry we're just going to create a new script.

Before we go any further, I'll just give you a quick tour of this editor. At the very bottom of the editor you will see 4 tabs. Currently the help tab is selected. For now, don't alter this. Above this there is a pane that is currently empty. We'll come back to that in a minute. On the right-hand side of the editor there is another pane, most of which is taken up with a list. Above the list there are 4 buttons. Currently the functions button is depressed (no, it’s not very sad, just pushed into the on position) which means that the list is a list of all the functions available to you. Above the buttons there is a textbox marked Filter. This is where it gets interesting. Referring back to the tutorial, you'll see that there are 3 functions that you are told to use. Copy the first one (GetObjectByTag) and paste it into the filter textbox. This makes the list reduce to just one function - GetObjectByTag. Single click on this function in the list. Now the pane that was empty has text in it. This text is actually information about the function GetObjectByTag. Repeat this copy and paste routine for the other 2 functions - AssignCommand and ActionMoveToObject. So now you know what they do, you might actually be able to figure out how to make the required script...

Or more probably not. This is because even the information given by the editor is still not really enough for a new scripter to be able to sensibly use. That being the case -

If you are editing the script that the script wizard created, use this version.

#include "nw_i0_tool"

void main()
{

// use the Tag of an object to get a reference to that object

object oFalstadd = GetObjectByTag("NW_Falstadd");

RewardPartyXP(50, GetPCSpeaker()); //created by the script wizard. gives the PC 50 XP

//tell the owner of the conversation to run to the location of the waypoint.

AssignCommand(OBJECT_SELF, ActionMoveToObject(oFalstadd, TRUE));

}

Whereas if you are creating a brand new script use this one.

void main()
{

// use the Tag of an object to get a reference to that object

object oFalstadd = GetObjectByTag("NW_Falstadd");

//tell the owner of the conversation to run to the location of the waypoint.

AssignCommand(OBJECT_SELF, ActionMoveToObject(oFalstadd, TRUE));

}

Remember, only use one of the scripts, not both.

Save your module again and test it. Assuming that everything worked I still have a comment. Because both versions of that script use the three functions that the tutorial told you to, you may experience some unexpected behaviour. When you have explored further into the mine and head back to see Falstadd it is possible that you will meet the miners heading back to the mine. Still dressed in their rags! What is happening here is that following performing your scripts in the conversation, they are going back to walking the waypoints because you haven't stopped them doing so. But as we have come to the end of the instructions, we'll leave it there. Which just leaves the very last section of the document.

But before I deal with that I just want to say, you can justifiably be proud of yourself. You have completed your first module. If you did all the extra credit sections too - I can see that you are truly dedicated as well.

Finally, I will deal with the What Next section in the final post of this series of blogs as I will have quite a few working links for you (hint - The website pointed to in the tutorial - http://nwn.bioware.com/buildershas not existed for quite some years now.

Tutorial 7: Items and Inventory

This is yet another relatively short tutorial that is quite straight forward. Before you start just a reminder. In the Enhanced Edition of NwN you can bring up the properties dialogue for creatures/placeables/etc. by double-clicking on their image in the main window of the toolset. Also, when in the tutorial they mention a script tag it actually means the Tag for that thing.

Onto the tutorial. I would recommend that you save the module after you have done each section of the tutorial. Follow the instructions to make Jacen's Ring and save. Next proceed to the Amulet of Protection +1 section. Follow these instructions all the way up to and including instruction 9. Before proceeding onto instruction 10 you really should select a different appearance for this amulet to make it more distinctive in the store. So, open the Appearance tab and select one of the icons on show here. This will be how it looks both in the store and in your inventory (should you buy it). Once you have done that you can continue with this section of the tutorial.

Save your work so far. Then continue with the tutorial all the way to the Extra Credit section. There really is nothing to add up to this point.

With the Extra Credit section, I just have a reminder for you. Where it says "Edit the instance of Veran and move the dagger from his right hand to his inventory." they mean first open Veran's properties and then click on the inventory button. At the top of the inventory dialogue there is an illustration of the items that Veran has got equipped and below that a list of all the rest of the things in his inventory. To follow their instructions here, all you need to do is to drag the dagger from the illustration and drop it on the list.

On the final paragraph of this section there is nothing to really say except be creative.

And that's tutorial 7 done.

Tutorial 8: Atmosphere

Another quite straight forward tutorial but I do still have some things to point out. Let's dive straight in.

So, make a start with the Area Lighting: Fern section and follow all the steps up to and including number 8. Just an observation here. Once you've viewed the fog as instructed, turn it off again. Should you enter either the mine or the inn with fog turned on in the toolset it just looks silly. So, make sure you turn fog off before you do that. Continue on following the instructions until you arrive at the Extra Credit section. There really are no issues to be aware of before that section.

Extra Credit. In this section you are told to add sounds to the inn interior and the mine. For the most part this should be OK. However, should you decide to add extra sounds to the Fern area you may come across a problem. In the Area Lighting: Fern section, instruction number 9 tells you to add the rain weather effect. Now this is all well and good but if you try to add either of the rain sound effects all you will hear is silence. Both of these appear to be missing in NwN EE at the moment. There are other sounds that appear to have gone missing too. My tip here is to open the properties of the sounds you want to add. On the Basic tab there is the facility to "try before you buy" so to speak. Beneath where it says "List of Sounds to Play" there is a large box with all the sound files used by a particular sound object. Highlight (i.e. click on it) a single one of these. Just to the right of this there is a play button. Press that to hear the sound selected. Pressing the Stop button stops the sound playing. If when you do this, you hear nothing it means that currently that sound is missing. Don't use any sound that you find to be "lost" in this way as it is pointless.

That's all for tutorial 8. Next the final tutorial. Tutorial 9 - Scripts (Don't Panic)

Tutorial 6: Journals and Conversations

Compared to the previous two (covered in Part 4) tutorials this one is quite big and in places it can be a little confusing. Having said that, the first part about the Journal editor is quite straight forward.
So, go ahead and follow the tutorial all the way until you reach the section marked "Conversation: Falstadd". Now before proceeding you need to be aware of this -

Important. There is a known bug in the conversation editor. What it does is to make conversation editing impossible by killing already written lines when you click on them (click and they’re gone, erased). The thing is that it doesn’t affect everybody but does affect a large proportion of users. The good news is that there is something that can be done to prevent it. To be on the safe side do the following -

  1. In the toolset open the options dialogue (Tools/Options).
  2. Select the Spell Checking option.
  3. At the bottom there is a section for spell-checking conversations with a number of check boxes. You need to disable spell-checking for the conversation editor which is turned on by default. Un-Check the topmost checkbox in this section. The one that says “Automatically check spelling when editing conversation nodes”.

For what it's worth, as far as I know, the spell-checker has yet to be implemented. At least I have seen no evidence of it actually working.

Once you have done that start the "Conversation: Falstadd" section. Now you may be tempted to copy/paste the text that you are given in the tutorial, into the conversation editor. However, you'll discover that there is no paste option on the context (aka right-click) menu. Don't panic. The standard Windows hot keys work here. These are -

[CTRL]+[A] = Select All
[CTRL]+[C] = Copy
[CTRL]+[X] = Cut
[CTRL]+[V] = Paste

For example, when you get to instruction number three you are told to create a new NPC statement and add the text "Hello again, <FirstName>. Have you learned anything about the mine?". So, proceed up to the point where you are told to enter this text. To copy & paste that text using the hot keys do the following. Highlight the text, hold down the [CTRL] key and press [C] to copy it (or use the context menu Copy option when viewing the tutorial). Switch to the toolset where you should have the toolset open with the conversation editor active. Press and hold the [CTRL] key and press [V] to paste the text into the text entry box. And that's all there is to using the hot keys. Incidentally this also works in the node text editing box at the bottom of the conversation editor.

Armed with that information you now have a little less work to do here. Still there is quite a bit to do. So, continue on all the way up to the Extra Credit section.


Now did you remember to "update instances" on both Falstadd and Veran? If not, when your PC runs up to them, they will just shuffle about and say nothing (guilty as charged m'lud - it happens to everybody so don't panic, just update instances now if you forgot).

That is almost that. However, I do strongly recommend that you do the extra credit section. Remember, if you are stuck on how to do something with the innkeeper's conversation, all the information you need is contained in this tutorial. Having said that, there is a subtle difference in the way you start the process of giving this conversation to the innkeeper, so I'll start you off.

Select the innkeeper from the Creatures/Standard/NPCs/Human part of the blueprints and paint it down where you are told to in the Extra Credit section. Now double-click this instance of an innkeeper you've just placed. This will open the properties dialogue for this instance of an innkeeper. Double-clicking to bring up the properties is a new feature of the Enhanced Edition. You can now proceed in the same way as for the previous conversations. Doing it this way means that the conversation will be unique to just this particular innkeeper. That being so, you have no other instances to update. Once you save the conversation (and any scripts associated with it) and the module you can try it out straight away with no further steps.

For the conversation I would suggest that you make it one (like Falstadd's) with a part that is only spoken the first time the PC speaks to the innkeeper. Other than that, I am saying nothing. It's good practice and will give you experience of actually typing in the conversation editor along with using the script wizard for yourself.

And that's that. See you in Part 6.

Before I begin, just a quick reminder. Where in the tutorials they say "object's script tag" they mean the Tag of the object and that where they say to close the toolset in order to test your module this is unnecessary. Just press the F9 key instead.

Tutorial 4: Create the Cast

There are no glaring issues with this particular tutorial but I still have a few comments. So, let's make a start. I would suggest that you save the module after each creature that you create for the reasons given earlier in this series. Follow the instructions all the way to number 4 for Gnashgab. Before you get onto number 5 there is something to be aware of.

Should you have given Gnashgab any equipment (weapons/armour/whatever) before you came to this particular tutorial, you will get a surprise. Instead of what you are told in the tutorial, you will be presented with a small dialogue box. This dialogue will tell you that because Gnashgab has custom items you will need to create custom blueprints for them as well - [Yes][No][Cancel]. This in spite of the fact that you only gave Gnashgab standard items. I suspect that this occurs because it is no longer just a standard creature. While I regard this as a bug, it appears that BeamDog disagree. Anyway, if you press [Yes] you will get an additional property box for each of the items before Gnashgab is added to the palette in the way described in the tutorial. So, the moral of the story here is if you are going to use this method of adding a custom creature/NPC to the palette don't give them any equipment until after you've actually added them.

Anyway, continue on with the tutorial all the way up to and including to step 4 under Veran. The statement "WARNING: All creatures, doors and place-able objects require a portrait." requires some clarification. For the purposes of this tutorial I will agree with that but when you come to your own module(s) I would modify it slightly with regards to doors and placeables. In their cases I would only make sure they have portraits if they are to have conversations with the PC. As otherwise you are wasting your time because you will never be shown portraits for them.

Other than that, I nothing to add for this particular tutorial so go ahead and complete it including the Extra Credit section.

Tutorial 5: General Attitudes: Factions

This is actually quite a good tutorial on factions and the faction editor. Just be careful when you are following the instructions as at first glance it may appear that in a couple of places, the same instruction is repeated twice. It isn't. If you should come across this just re-read the pair of instructions until you understand what you are actually being told to do. Anyway, do everything up to the Miner Group Encounter section.

Before you proceed any further with the Miner Group Encounter section, it is a good idea to check the location of any spawn points for goblin encounters in the cavern with the mine shaft. Otherwise there is the danger that when you follow the instructions in this section of the tutorial, that you will place the miners encounter spawn point too close to the goblins one. You will notice that the spawn points appear to be invisible in the toolset. To remedy this all you have to do is to select the trigger for that encounter which will reveal the spawn point. You can, if necessary, now move the spawn point. Now that you are aware of this follow the instructions up to the Extra Credit section.

The Extra Credit section is split into two parts, the first of which deals with map notes. This is a pet peeve amongst some players. A lot of the early user made modules suffered from a general lack of them. These are quite important for making getting around in an area more pleasant ("Which of these 40 buildings is the $!#!!$ inn!!!"). Having said that the instructions in the tutorial, for using them are slightly misleading, so here is how.

We're going to add a map note to the interior of the mine at the entrance/exit, so obviously you need that area open in the toolset. In the blueprint section of the toolset, the waypoints are indicated by an icon that looks like a small flag on a short pole. Click that and make sure you open the standard (not custom) blueprints. Select a Map Note from the (middle of) list and paint it down next to the entrance/exit of the mine. Now open its properties. While not essential it is a good idea to change the name and the tag. So, change the name to Mine Exit and the tag to NW_MAPNOTEMineExit (this will make it easier to find in the left pane of the toolset) but do not click OK just yet. Select the Advanced tab. At the bottom you will see a pair of pre-checked checkboxes. Leave those well alone. Between them you will see a text box that has the words "Map Note Text" to the left of it. Currently in the text box you will see "<Place text here>". We are going to change that. So, delete "<Place text here>" and replace it with the words Mine Exit. Now press OK. That's it. Save your module and test it in game. Remember to have your mini-map open otherwise you won't see it.

So now that you know how it's done open the Fern area and add map notes for the mine entrance/exit and the inn. If you wish you can add other map notes for this area but as it is only one room, I wouldn't bother doing so for the interior of the inn. When you've finished and tested those, you'll need to re-open the mine area in order to proceed with Extra Credit section.

The second part of the Extra Credit section deals with using waypoints to set up a repeating patrol by the miners when they spawn in. My only comment here is that you may wish to rotate some of the waypoints so that you have an impression of the route that will be travelled by the miners. Anyway, when you have followed the instructions, save and test your module again.

End of Part 4.