Revised February 2, 2010

CMPUT 620 - Programming Languages and Environments for Computer Games

Exercise 2 - The Aurora Toolset and NWScript

This exercise is about how to use the Aurora Tooset to construct a module and how to script objects in the module using NWScript. You can start this exercise anytime after completing exercise 1. You should become comfortable with the non-scripting features of the Aurora Toolset as soon as possible. Although some time will be spent on NWScript in class near the end of January, you should start scripting now by learning how to script from mateirals available on the web.

Use the Aurora Toolset to create a module with a small area that contains a room with three or more doors. Script the doors so that when any one door is opened, all the room doors open. This should happen anytime one of the doors is opened (not just the first time). Put a container in the room with at least two items in it, where one of them is a book. Script it so that when the PC removes the book from the chest, all the doors close and lock and a creature is spawned in the room. However, if the PC removes any other item from the chest, nothing will happen. Note that if the PC drops the book on the ground and then picks it up, the doors should not close and no creature should be spawned. This should happen only when the book is removed from the chest. If the book is put back in the chest and removed again, the doors should close and a creature should be spawned.

Create a different room that contains a male human, a female human, a single door and a bench. The bench should be placed far away from the door. The male should repeatedly perform one of three actions: sit on a bench for a few seconds, move to a door and open it, walk near the female and speaks a one-liner. These actions should be selected randomly with probabilities, 40%, 20% and 40%, respectively. However, if the door is not closed, that action should not be selected and one of the other two actions should be selected instead (with equal probability). You should pick a new action, only after the previous action is complete. The female should select randomly between these two actions with 50% probabilities: 1) the female should walk directly away from the male until she is more than 1 meter away from the male and then walk near the bench, but not sit on it and 2) walk to a point near the centre of the room. However, if the door is opened (by anone), the female should immediately abandon any other action and walk to the door and close it.

NOTE that you should not use ScriptEase for this Exercise. All scripts should be hand written in NWScript.

IMPORTANT NOTE: Persistent files in CSC 167

Resources

BioWare Tutorials

NWN Lexicon - API documentation

Aurora-ScriptEase Tutorials (You could use these tutorial to learn about the Aurora Toolset, but you should not use ScriptEase for this exercise). Note that there is no separate icon on the desktop for the Toolset. Just double click on the NWN icon and select Toolkit instead of Play.

Demo Schedule

All demos will be in CSC 167. Please come early and ensure that your demo is loaded and ready to show at the scheduled time. We will alternate between two machines in one corner of the lab so that we do not interfere with other students in the lab. If you are the first demo of a day, pick a machine in a corner of the lab. If you are not the first, pick a machine beside the one that is being used to demo when you arrive.

Each student should register for a demo slot on the demo schedule by sending an e-mail to me with the subject line:

CMPUT 620 Demonstration request for exercise 2

and with an e-mail body that contains 3 preferred demo slots that are still available on the demo schedule below:

Demo Time Individual
February 2 - 10:00  
February 2 - 10:15  
February 2 - 10:30 Mokhtar M. Khorshid
February 2 - 10:45 Dave Churchill
February 2 - 11:00  
February 2 - 11:15 Andro Poon
February 2 - 11:30  
February 3 - 10:00 Andrew Cenkner
February 3 - 10:15  
February 3 - 10:30