Verbs

TWIGZ Verb Files (".vrb"):
Whenever the Ego interacts with an object (or actor) the engine accesses the ".vrb" file for that room and says the appropriate dialogue. Below is the basic outline for a verb (".vrb") file:

"Open"
10
1,1,1,"I can't open a stick",0
4,4,-1,"It's locked",0
4,5,-1,"I'm gunna open this here gate",0
8,6,1,"Open this well cover?",0
8,6,-1,"It's already open",0
14,7,1,"I'll just slip in this here back door",0
14,7,-1,"It's already open",0
17,8,-1,"I will turn this knob and open the door",0
3001,0,0,"Ey, uh, Fred, uh ...~wanna go bowlin?",0
0,0,0,"I can't open that",0
"Close"
2
1,1,1,"",8
0,0,0,"I can't close that",0
"Pick Up"
4
1,1,1,"Ohhhh, a stick",3
2,2,-1,"I love rocks",4
3002,0,0,"I don't think he'd like that.",0
0,0,0,"I can't pick that up",0
"Look At"
3
3001,0,0,"That's Fred, he's a nice guy!",0
3002,0,0,"That's John, he can hold~his breath for over~10 minutes!",0
0,0,0,"That's a nice thing",0
"Talk To"
2
3001,0,0,"Starting conversation . . .",0,1
0,0,0,"I really don't want to talk right now",0,0
"Use"
1
0,0,0,"I don't think I should",0
"Push"
1
0,0,0,"Not right now",0
"Pull"
1
0,0,0,"No pulling for me right now",0
"Walk To"
2
7,0,0,"I'm leaving the room now!",3
8,0,0,"",3

The ".vrb" file is separated into verbs. Each verb name in quotation marks represents the start of the data for that verb. After each verb name is the total number of statements for that verb. Following that is the list of all the text that will be said by the ego (we call these lines "statements"). Any statement that starts with all zeros, like the one below, is the Default Statement for that verb.

Below is an example of a Default Statement:

0,0,0,"I don't think I should",0

What do all those numbers mean?:
Each "statement" is preceded by three (3) numbers and then followed by another (EXCEPT for "Talk To" that ends with 2 Integers!). A verb statement looks like this:

Object (or Actor) ID, Bin Variable, Bin Var Required Status, "Text", Script Number

A "Talk To" verb statement looks like this:

Object (or Actor) ID, Bin Variable, Bin Var Required Status, "Text", Script Number, Conversation Number
Notice the extra integer that goes on the end, this represents the CONVERSATION NUMBER to run. 0 mean no conversation.

When a object, say Object ID 10, is clicked on with the "Open" verb selected, the engine opens the appropriate verb file (for room 1, it would be "1.vrb") and scans the file until it reaches the "Open" verb. Then it searches for the appropriate Object ID. If the Object ID is found then the engine proceeds to check the appropriate Bin Variable's status with the Required Status. If these two are the same then the Ego will say the appropriate text and the script number (if it is not 0) will be executed.

If all criteria are not met then the Ego simply says the default statement.

How do I create a verb file?:
All verb files can be written in your favorite, simple, MS-DOS text editor (Windows Notepad works fine). Just make sure there are no extra spaces (unless they are in between quotation marks) between the commas separating the different parts of a statement or at the end of a statement. When you are finished save this as a ".vrb" file in your "TWIGZ SDK\Verbs" folder. You can do this from notepad by going to File, Save As, Choosing "All Files" from the "Save as type" drop-down menu. And naming the file "roomnumber.vrb" so if your room is room number 5, then save the file as "5.vrb"

Why is there a tilde ("~") between some of the text in a statement?:
A tilde ("~") represents a new line in a statement's text. Below is an example of a statement with several new line characters:

3002,0,0,"That's John, he can hold~his breath for over~10 minutes!",0

When the Ego says the appropriate text it will appear on the screen as follows:

That's John, he can
hold his breath for over

10 minutes!

Where as, without the new line characters it would appear as follows:

That's John, he can hold his breath for over 10 minutes!

Why are some Object IDs above 3000 & 4000?:
Every "object", whether it is an actor, object, or inventory item, is given a unique Global ID Number. All object IDs go from 1 to 3000, all actor IDs go from 3001 to 4000, and all inventory items (once collected and stored in the inventory) go from 4001 to 5000.

Note: When developing an adventure game with the TWIGZ SDK it is recommended that you keep track of which object IDs represent which objects using some sort of database or spreadsheet (Microsoft Excel works fine).

What characters are supported by the TWIGZ Engine for verb files?:
All letters A-Z and a-z, all digits 0-9, and the following special characters: ! $ * , . ? - " [to make a quotation mark ( " )] use the carrot ( ^ ) symbol]. Below is the default font file that is loaded when the engine starts:

Note: When using the Level Editor (included in the TWIGZ SDK) objects, actors and inventory objects can be named with ALL of the above characters and the following additional characters: / # + ; and © (use the "at" (@) symbol to make the copyright symbol).

© 2004 Shattered Realm Productions

 

Dialogue Files

TWIGZ Dialogue Files (".dia"):
Whenever there is a dialogue exchange where the player can select dialogue choices, we call this a "conversation." The TWIGZ Engine loads the appropriate dialogue file for the current room (i.e. Room 1's dialogue file would be "1.dia") and initializes the dialogue engine. Below is a sample of a dialogue file:

1
10
1
5
1,5
"Hello?"
"Excuse me."
"Guard! On your feet!"
"Cheesy's Pizza, I've got two large pepperoni here."
"I'll be going now."
"","What do you want?!",1,2,2,0
"","What do you want?!",1,2,3,0
"Guard, get on your feet Soldier!","Sir, is that you?",1,2,4,0
"Cheesy's Pizza, I've got two~large pepperoni here.~That'll be $16.95.","Mmmm, pepperoni,~I love pepperoni.",1,2,5,0
"","And be quick about it!",1,2,-1,0
2,1
"I, um, am here to inspect this gate."
"I, um, am here to inspect this gate.~Yep, open her right up and~I'll check her out!","Nice try, but I'm not supposed~to let anyone in.~So scram!",1,2,1,0
3,1
"It looks like somehow you locked yourself out."
"It looks like somehow you~locked yourself outside~the gate and locked me inside.~You better open up this gate~so we can switch places.","Well, how did that hap --~Wait a second! Nice try.",1,2,1,0
4,1
"You're darn right it's me."
"You're darn right it's me.~Why aren't you off somewhere,~patrolling something?","",1,2,1,5
5,1
"...and extra cheese?"
"","...and extra cheese, mmmm! Wait a minute, I~didn't order any pizza.~Go on, get outta here!",1,2,1,0

A Dialogue file is best explained by the steps the engine takes to read it, below is an outline of these steps:

The first thing the engine does is load the appropriate dialogue file. The first number it reads represents the Total Conversations stored in the file. If there are 5 conversations in this file then the next 5 numbers would represent the file offset where these conversations begin (this is called the "offset list").

Following the offset list, the conversation data begins. The first number in a conversation represents the conversation number. This is followed by the Total Number of Sets in the conversation. This information makes up the Conversation Header.

Following the Conversation Header is the Set data. All Sets begin with two numbers separated by a comma (Set Number, Total Dialogue Choices). Immediately after this comes the text choices for display in the GUI so the player can click on them (These are not necessarily what the character will say, see below).

What's the purpose of this, you ask? Lets say you are talking to a character who is very dangerous and evil, and he is asking you questions such as "I'm not such a bad guy though, right?" You can have a text choice that reads "Nooo, not too bad for an insane maniac bent on evil world domination." However, when the player clicks on the choice the Ego will say "Of course not!" (This gives you a deeper look into the inner-monologue of the Ego)

After the GUI text choices are read the dialogue engine waits for the users input. When the user clicks on a text choice, the engine goes to the corresponding choice in the file. A text choice looks as follows:

"Guard, get on your feet Soldier!","Sir, is that you?",1,2,4,0

The first string represents the actual text the Ego will say (if the text is the SAME as the GUI text, this can be written as an empty string and the engine will simply use the GUI text). The second string represents the actual text the other Actor will say. The first integer represents the first Actor ID number, the second represents the second Actor ID number, the third represents the next dialogue set to jump to (-1 will cause the Engine to end the conversation), and the final integer represents the script number to execute BEFORE jumping to the next set (0 represents no script).

How do I make a dialogue file?:
All you need to create your own dialogue file is the TWIGZ SDK and your favorite MS-DOS text editor (Microsoft Notepad works just fine). Just type the total number of conversations that will be in this file. For each conversation, start off with an integer representing the conversation number on one line and the total sets on another. For each set, start of with the GUI text choices, one on a line. For each choice type in the text choice data like shown above.

Repeat this process for all conversations in the dialogue file. When you have finished, simply place the text file in the "TWIGZ SDK\Dialogue" folder and run "RoomEdit.exe" and then Click on the "Conversations" Button (or you can just run "Convos.exe"). You will be prompted for the file name to "Load" simply type in the file name WITHOUT the extension (which should be ".txt") and press enter. Next type in the "New" file name to save it as (should be the number of your room). So if the room you are working on is room 5 then you should type "5" as the file name to save it as (the "NEW" file name) and the file "5.dia" will be created.

© 2004 Shattered Realm Productions