Djinni Wiki

We’ve added and assigned files, and started the module. Now we need to test it. Why do we need to test it? First of all, because we want to see if it works properly. The main task is to find any errors that might occur in our adventure.

First I suggest moving a bit in the module. Make Geralt run to the places where Jethro, the bandit leader and wolves should be. What is happening? There is no one? There is only Jethro? Why? Have we done something wrong?

The answer is No! Everything is fine. Spawn sets are always off on their default setting. This does not include NPC spawn sets, which is why Siegfried is visible after starting the module. Our first task will be to activate the proper spawn sets so that any player who starts our module will see everything as planned. You can enable and disable spawn sets in two ways – by using the script or an easier way, by using a special quest.

We will do this in a moment, but for now we can approach the spawn sets differently since we’re testing the module. Open the Debug function which is available after starting the module. Select Spawnsets -> Module Spawnsets from the Debug menu:


The Module Spawnsets menu contains all the spawn sets that we assigned to the module. Remember that assigning a file to a module is completely different than adding a file to a module. First let’s start Jethro’s spawn set. To do this, select Spawnsets -> Module Spawnsets -> our_jethro from the Debug menu. A moment later Jethro should appear at his spawn point:


Have a look at the Debug -> Spawnsets -> Module Spawnsets menu:


Note that a “tick” has appeared next to our_jethro. This means that this spawn set has been enabled. If you select our_jethro from the Debug -> Spawnsets -> Module Spawnsets menu, Jethro will disappear from the module and the “tick” will disappear from the menu. All the commands from the Debug menu function as toggles, i.e. they can be turned on and off. Of course you can enable all the commands in the Debug menu.

If you select Disable all spawnsets:


Then all previously enabled spawn sets will be disabled.

Now let’s enable all the spawn sets by selecting them from the Debug -> Spawnsets -> Module Spawnsets menu:


A moment later all of our characters should appear on the enabled module. Since you can enable and disable spawn sets using quests (via the Enable spawnset and Disable spawnset actions in the OnPhaseFinished Actions and OnQuestFinished Actions sections), we can improve our quest.

How? The bandit leader and his guards will spawn in the module only when Geralt (the player) obtains the quest about killing the bandit leader from Siegfried. Why? This helps us avoid complications connected with the quest – for example, what would happen if Geralt killed the bandit leader without talking to Siegfried first? We would have to create other conversation nodes taking this into account. However, because we modified the quest earlier, by adding the second stage of the quest, we will avoid such complications.

Now we know how to enable and disable spawn sets while testing the module. While the module is working we can test much more things. In a moment further commands from the Debug menu will be described. Let’s have a look at the Resources Explorer window. This window has a number of interesting commands that we can use while testing out module. If the Resources Explorer window is disabled, select Utility Windows -> Resources Explorer from the View menu:


The Resources Explorer window will appear on the left side of the screen. Expand Cutscenes by clicking the small ‘+’ sign next to the folder name. Right-click on any .cut file:


A new Play cutscene command is available in the reference menu that will open. This command is only available when the module is running and it allows you to open a film. You can read about how to create cutscenes in another chapter of this manual.

Expand the Scripts tree and right-click on any .lua file:


A new command is available here too. This is the Play file command, which will enable scripts written in Lua. If you right-click on any .nss file, another new command will appear:


The command Run scripts allows scripts written in Neverwinter Nights Script to be run. More about scripts is covered in another chapter of this manual.

Finally, expand the Templates -> Characters tree choose, for example, NPC. Right-click on any .utc file. A new Debug command will appear, Spawn creature near player:


This command will spawn a specified character next to Geralt (as a reminder, .utc files are character templates). This is a very useful command.

Let’s expand the Templates -> Spawnsets -> Commoners tree and right-click on any .spn file. Another new command available, Debug -> Disable spawnset (or Enable spawnset):


This command has the same function as the one from the Debug menu. It enables or disables a spawn set. As a reminder, .spn files are the ones with spawn sets.

That’s it when it comes to the Resources Explorer window. Remember that all of these commands are available only when the module is running.

Now let’s return to describing other Debug menus. Select Quests from the menu:


Here you will see the Our_base database together with the Task (our_task.qst) quest. Using the Quests command we can test quests in the Debug menu. Now select Task (our_task.qst). A new Running quest: EMPTY[Read Only] window will open:


This window contains the quest that we created earlier started in the test run. This quest is read only in the test run (confirmed by the information [Read Only] displayed in the name of the window). This means that now we cannot modify it.

Note that the Quest Beginning is in a yellow frame. This means that the quest being tested is in the beginning phase and is not really active.

Let’s return to the module by clicking on the Game tab in the top part of the window:


Now approach Siegfried and talk to him. Accept the quest from him by selecting the proper conversation node. Once you’ve accepted the quest from Siegfried, return to the quest by clicking on the Running quest: EMPTY[Read Only] tab:


As you can see, there are changes:


The Quest Beginning is in a green frame. This means that this quest phase has been completed. Now the Professor phase is in a yellow frame, which means that the quest being tested is in this phase. If you return to the module and kill the bandit leader, then return to the quest tab, you will notice that the Professor phase has been completed (indicated by a green frame) and that testing has moved to the Siegfried phase (now in a yellow frame):


If you talk to Siegfried again and tell him that you’ve already killed the bandit leader, then return to the quest tab, you’ll see that the quest has been completed – the Quest Completed phase is now in a green frame:


This shows that both the conversation and the quest are working perfectly. Later we’ll introduce small changes connected with the spawning of the bandit leader. The remaining commands from the Debug menu are as follow: - God Mode. Makes Geralt immortal. This is very useful when testing fights. Geralt being immortal means there will be no need to repeat the test if he is killed. - Show game time. Displays the current game time in the bottom left corner:


- Report current kill list. Displays a list of currently dead characters in the Aurora log in the bottom part of the screen:


The character tag and the number of characters with that given tag which have been killed are displayed. If the Aurora log window is not available, select Utility Windows -> Aurora Log from the View menu:


- Show all journal entries. Displays all the journal entries in the Aurora log window:


- Draw Triggers. Displays triggers in the currently running module. - Show Perception Range. Displays the perception range of every spawned character:


More about perception has been covered in another chapter of this manual. - Show Attitude To PC. Displays a spawned character’s attitude towards Geralt. This is displayed in a colored circle which appears at the character’s feet:


Green circles mean that a character is friendly towards Geralt, red ones mean that a character is hostile towards Geralt, while blue ones mean that a character is indifferent to Geralt. - Show Affiliations. Shows a character’s faction affiliation. This is displayed in a circle which appears above the character’s head:


Characters belonging to the same faction have the same color circles above their heads. - Show Guarded Zone. Shows the zones which a particular character guards. In our adventure, however, none of the characters plays this role.

- Show Waypoint. Shows all waypoints. In our module there are no waypoints.

- Show Personal Spaces. Shows a how much personal space a character takes up in the module. This is displayed in a circle which appears by the character’s feet:


- Show Path Info. Shows the path to an action point to which a character is heading:


- Show floating text. Shows test information about the character. The text is displayed above the character’s head. Select the kind of information from the menu which will appears after choosing Show floating text from the Debug menu:


This menu functions work like toggles, i.e. each command from the menu can be enabled or disabled. You can also display all the information at once. - Hide all info. Hides all the test information. - AI level and Actions. Displays information about the AI level and actions:


- Combat distances. Displays the distance between characters during combat:


- Name. Displays the character’s name:


- Tag. Displays the character’s tag:


- Spawnset or NPC info. Displays information about a spawn set’s file name and about which story phase an NPC is in:


- NPC Action info. Displays the current action being performed by the character:


- Model Name. Displays the name of the character’s model:


Template. Displays the name of the character’s template:


The last command in the Debug menu is Best Performance. Selecting this command will reduce the graphic effects in the module to the required minimum in order to obtain the best efficiency while testing. This is a very useful command.

That’s it when it comes to the Debug menu. Let’s deal with the last tool for testing modules now, the Game Object Inspector. To display the window, select Utility Windows -> Game Object Inspector from the View menu:


The Game Object Inspector window will appear on the left side of the screen:


This window displays all the necessary information about what is happening on the module being tested. The information is displayed in the form of a tree. Expand the NPC and Spawnsets branches by clicking on the small ‘+’ signs next to the names of the branches:


The NPC branch displays information about all the NPCs in the running module. There is only one NPC in our adventure, Siegfried. As a reminder, we saved his spawnset in the our_siegfried.npc file. Let’s expand this branch:


A variety of information about Siegfried is displayed here: - Story phase¬ – the story phase our NPC is in, - Spawn phase – the spawn phase the NPC is currently in, - Conversation – the conversation currently assigned to the NPC, - Template – the name of the character’s template, - AI system control – whether a particular character is being controlled by the computer (true) or the player (false).

Right-click on the our_siegfried branch and select Open in editor:


This opens Siegfried’s spawn set. You can also right-click on other branches of the tree. This brings up additional commands. For example, right-click on Story phase and select Modify value:


This opens the Select new story phase window, which can be used to change the character’s story phase. In our case this is impossible, however, because Siegfried has only one story phase, Orders.

Now right-click on Conversation and select the Open in editor command:


This opens a conversation file.

The command Refresh view will refresh the content of the Game Object Inspector window. The command Remove all creatures removes all the characters from the Game Object Inspector window, meaning the characters will not be inspected any more.

Let’s expand the next part of the our_siegfried branch. This time it refers to Siegfried’s tag. Information about the character will be displayed:


A lot of branches are displayed. They contain information on practically every subject, from life and energy points to assigned abilities and profiles. To display detailed information, expand whichever branch interests you.

Right-clicking on a sub-branch will bring up commands like Modify value, etc. Now right-click on the branch containing Siegfried’s tag and select Teleport player nearby:


This moves Geralt close to Siegfried. This is useful because it provides a shortcut to a particular character without having to waste time running there. Select Relevant files from the menu:


This display the list of all files linked to the specified character:


Each file can be opened by selecting it from the menu.

Let’s return to the Spawnsets branch, though. Expand the our_jethro branch (which displays the file name of Jethro’s spawn set):


This reveals another branch called poker. As a reminder, poker is the name of a spawn entry in Jethro’s spawnset. Expand the poker branch. This contains other information about Jethro:


- Slots – the number of characters that will be spawned, - Spawned – the number of characters that have already been spawned, - Time to next spawn – the time left until the next spawn, - Killed – the number of characters that have been killed.

Now right-click on the our_jethro branch and select Open in editor:


This opens Jethro’s spawnset. Right-clicking on the poker branch and selecting Open in editor will open Jethro’s template.

Now place Geralt so that he sees a character (but not an NPC). This can be Jethro. Then click on Add Visible Creatures at the top of the Game Object Inspector window:


This adds new sub-branches to the Visible creatures branch, which lists characters currently seen on the screen:


This gives you access to the same data as in case of NPCs.

That’s almost everything when it comes to testing the module. There are a few tricks that you can use, though. Moving the mouse a character and clicking on Y will kill the character. Pressing SHIFT + Y will kill all the characters near the cursor, but remember that you cannot kill NPCs. Placing the cursor on a place and pressing ‘+’ on the numerical keyboard will immediately move Geralt to that location.

Now let’s introduce the changes which have been mentioned. First we’ll change our quest so that the bandit leader and his guards will spawn when Geralt has the quest from Siegfried. As has been explained before, after adding the file to the module we must introduce all the changes at the Module Explorer level. Go to the Module Explorer window. If the window is closed, select Utility Windows -> Module Explorer from the View menu:


The Module Explorer will open on the left side of the screen:


Expand the Quest Definitions branch by clicking on the small ‘+’ sign next to the name of the branch. Then double-click on our_base:


This opens Quests Explorer tab with our quest database:


Double-click on the row containing our quest:


This opens the our_task.qst window containing our quest:


Now we need to introduce the aforementioned changes. Open the Properties window. To do this, select Utility Windows -> Properties from the View menu:


The Properties window will open on the right side of the screen. Now click on Quest Beginning:


Then go to the Properties window. We’ll introduce the changes in the OnPhaseFinished Actions section:


Why there? Because all the actions from the OnPhaseFinished Actions section will occur after the completion of the task. In this case, Quest Beginning is responsible for the actions will occur when Geralt gets this quest from Siegfried. Click the right-hand column opposite the Available Actions attribute and select Enable spawnset from the list:


Then click on the blue ‘+’ sign:


This adds the Enable spawnset action to the OnPhaseFinished Actions section:


Now click on the small yellow icon in the right-hand column opposite the spn_resref attribute:



This opens the standard Windows window used for loading files. Load the spawn set for the Professor, the leader of the bandits. Go to the Data\Templates\Spawnsets\Enemies folder, where the spawn set is saved. Select the file called our_professor.spn and click Open. The our_professor.spn spawn set will appear opposite the spn_resref attribute:


Now we need to do the same for the Professor’s personal guards. For each, add the Enable spawnset action the OnPhaseFinished Actions section. Click on the small yellow icon in the right-hand column opposite the spn_resref attribute, and assign the file called our_bandit.spn:


That’s it. The changes have been made but still need to be saved. We need to save both the updated action and the module. Start with the quest. In the File menu, choose Save our_task.qst:


If Save our_task.qst does not appear in the drop down menu, or if a different file name is displayed, it means that the our_task.qst window is not active at the moment. To activate it just click the window’s title bar and then choose Save our_task.qst in the File menu. Now save the module. To do this, choose Save Module in the Module menu:


We still need to create the second quest, however. This is the so-called “initiating quest”, which will activate along with our adventure when the game launches. Naturally, the player will not even be aware of the quest’s existence – it just turns on the necessary character spawn sets.

Now we’ll discuss how to create a special quest which is automatically added to the quest database. To do this, go to the Quest Explorer window. Right-click any row and choose Add New Quest To -> our_base from the menu:


This opens the standard Windows window used for saving files. Go to the Data\Quests folder, type in our_init and click Save. The Enter Quest Name window will appear:


Type the quest name in the Name field. Type in initialization and click OK. The initialization quest will now be automatically added to our database.


Double-click the new quest:


This opens a new window called our_init.qst:


Because the quest is simply required to start our adventure, we do not need to type in any quest phase names, etc. The quest needs to possess one conditional phase, though. To do this, right-click Quest Beginning and select Insert Phase -> Conditional Phase from the menu:


A new Enter name window will appear. Leave the proposed name as Phase 1 and just click OK. Now go to the Properties window and open the OnPhaseFinished Actions section. Because the Quest Beginning does not have any actions assigned to it, this means that this quest will become active upon the loading of the module and will automatically execute all the actions found in the OnPhaseFinished Actions group.

This quest is used just to turn on the spawn sets for Jethro and the wolves. To do this, go to the Enable spawnset action in the OnPhaseFinished Actions section. Click the right-hand column opposite the Available Actions attribute, choose Enable spawnset and then click the blue “+” sign next to the chosen action:


Now click on the yellow icon in the right-hand column found opposite the spn_resref attribute. This opens the standard Windows window used for loading files. Go to the Data\Templates\Spawnsets\Commoners folder, choose our_jethro.spn and click Open:


The file our_jethro.spn is now assigned to the spn_resref attribute.

We still have to add one more Enable spawnset action for the wolves. Assign the our_wolf.spn file found in the Data\Templates\Spawnsets\Enemies folder to the spn_resref attribute:


That’s it for this task. Remember that the changes still need to be saved, however. Open the File menu and choose Save our_init.qst:


If Save our_init.qst does not appear in the drop down menu, or if a different file name is displayed, it means that the window our_init.qst is not active at the moment. To activate it just click the window’s title bar and then choose Save our_init.qst in the File menu. That’s it.

With this we end a certain phase in the creation of our adventure. Everything is now in place to make our adventure work. If you’ve read the manual attentively up to now, you should be capable of creating adventures on your own. Don’t be discouraged if your first adventures are fairly simple – with time and experience with the D’jinni Editor your proficiency and ingenuity in using it will inevitably grow.