Privacy Statement | About Us | Contact Us
©2008 Patrick Costello

July 26, 2008

Medieval Mechanics Version Update

Here is the brand new alpha version of Medieval Mechanics, now version 0.4.

This version adds the new feature of a helpful scholar to help students with questions about physics.

Problems from version 0.3 that are addressed are:
-Music in the Nexus
-First and second gate have no differences (confusing)
-Escape from conversation with the guards
-Made bad guys tougher
-Gender mistype with Librarian
-Same conversation for both library helpers
-First conversation with Artemis not firing
-Archery assistant not calling out distances
-Cannot get the bow from Montoya after he takes it away once
-Engineer continues to ask for wall height
-Time at the start of the module
-Speaking to one of the castle guards transports all the way to inside the Kings Court
-No path to archery range
-Chandeliers in library not walkable

The module and hakpak are available in this zip file.

Please comment here to any bugs/suggestions for v0.5. Major planned additions to v0.5 is a paper detailing the study of the archers and bows of the time. This is placed as an alternative to going to the archery range.

July 18, 2008

Conditional statements in convos

This probably was the most frustrating part of making the entire module. When you write a script to be a conditional in a conversations (for example: dont say this conversation node until the player has the scroll in his inventory), you need to begin the script with
int StartingConditional() rather than void main().

The most important part of this is the capitalization. It MUST be StartingConditional, not startingConditional. The compiler will NOT throw an error, but the entire conversation and game-play will change. Doing this will make the entire module act strange.

Text input boxes

Text input boxes can be very useful, especially when you are creating a module to help teach physics (multiple choice doesn't really cut it). Here is a helpful overview of the DisplayInputBox function that I found on the NWN Vault:

Calls up a string input box, with text description field and script callback for the results

Usage:


This script function displays a text input box popup on the client of the player passed in as the first parameter.

oPC - The player object of the player to show this message box to
nMessageStrRef- The STRREF for the Message Box message.
sMessage - The text to display in the message box. Overrides anything
- indicated by the nMessageStrRef
sOkCB - The callback script to call if the user clicks OK, defaults
- to none. The script name MUST start with 'gui'
sCancelCB - The callback script to call if the user clicks Cancel, defaults
- to none. The script name MUST start with 'gui'
bShowCancel - If TRUE, Cancel Button will appear on the message box.
sScreenName - The GUI SCREEN NAME to use in place of the default message box.
- The default is SCREEN_STRINGINPUT_MESSAGEBOX
nOkStrRef - The STRREF to display in the OK button, defaults to OK
sOkString - The string to show in the OK button. Overrides anything that
- nOkStrRef indicates if it is not an empty string
nCancelStrRef - The STRREF to dispaly in the Cancel button, defaults to Cancel.
sCancelString - The string to display in the Cancel button. Overrides anything
- that nCancelStrRef indicates if it is anything besides empty string
sDefaultString - The text that gets copied into the input area,
- used as a default answer
sVariableString- Doesn’t do anything right now

void DisplayInputBox( object oPC, int nMessageStrRef,
string sMessage, string sOkCB="",
string sCancelCB="", int bShowCancel=FALSE,
string sScreenName="",
int nOkStrRef=0, string sOkString="",
int nCancelStrRef=0, string sCancelString="",
string sDefaultString="", string sVariableString="" );


Example script and callback, where “gui_input_ok” is the callback script activated when the user presses “OKAY”:

script input_test::
void main()
{
DisplayInputBox( OBJECT_SELF, 0, "Test Message", "gui_input_ok", "", 1,
"SCREEN_STRINGINPUT_MESSAGEBOX", 0, "OKAY", 0, "CANCEL", "DefaultSTR", "VariableSTring" );
}

script gui_input_ok::
void main( string sInput )
{
ActionSpeakString( sInput );
}

An important thing to note is that the script called when the user clicks "OKAY" is that the script's name must begin with "gui_". In this example it is called "gui_input_ok".

Lovely descriptive properties

My first real problems became obvious when trying to make a simple walkway under a ramparts. I had definite problems with walkable vs. dynamic collisions vs. static non-walkable. "Walkable" means that you can walk through the object, NOT that you can walk on it. "Dynamic collisions" result in a collision that is actually farther away from the object. However this is useful if you want to be able to change an object in game (for example I had to scale my walls based on user input), because in this case, dynamic collisions are required.

Another important note when it comes to collisions is that the walkmeshes are all 2-D. This means it is impossible to allow, for example, someone to walk over a bridge and then later walk under the bridge.

My first post

Well I've been trying to get a blog up for a while to document problems that I have run into and the solutions that I have found in order to help other people, but getting the blog up was a whole issue in itself. It took at least a month to get the Stanford version of movabletype, but now it seems to be working fine, so we'll see. I will just start off with a lot of different posts trying to reconstruct the problems I faced while using the NWN2 game engine over the last month or so.