Logic Block Inputs

Each of the five inputs is identical and produces a character string (text). The source of the string depends on the "input-type" and possibly an "input-parameter". The parameter field may contain references of the form &A through &L. These references are replaced with the text from the input or gate labeled with that letter. The inputs, gates, and parameters are evaluated in alphabetical order so that it makes sense for the parameter in Input-D to reference &B but not the other way around because at the time parameter B is evaluated Input-D has not yet been computed.

Here are the Input Types along with an explanation of the parameter associated with each:

Literal
The resulting string is whatever you type into the parameter field.

Global ASL
The parameter names a global Associated String List (ASL) Entry. The resulting string is the value associated with that key in the global ASL. If no such entry exists then the result is an empty string.

Party Size
The result is a decimal number giving the number of characters in the party.

Character Info
This function is deprecated. The information about characters can be more easily gotten using the "Character Attribute" functions which are discussed a few inches down this page. No parameter. The result is an enormous string with information about all the characters in the party. The format is:
/first character//second character//third character/ etc
Each character's information is encoded as semi-colon delimited, tagged fields. For example:
name=Richard;age=89;STR=12;AC=2;
Note that the last field has a semi-colon to make it easier to do string searches.
So a complete string would be of the form:
/name=Paul;age=7;//name=Kevin;age=25//name=Alex;age=17;/
The following fields are currently included:
name
pos
THAC0
AC
age
maxage
HP
maxHP
enc
maxenc
maxmove
STR
INT
WIS
DEX
CON
CHA
race
gender
class
align

Direction Facing
No parameter needed. The result is an integer: 0=north; 1=east; 2=south; 3=west. Numbers are used so you can easily determine which direction is to the right, left, or rear by adding 1, 3, or 2 and then taking the remainder modulo 4. (Or doing a bitwise AND with the integer 3.)

Level ASL
The parameter is the level number and key for an entry in the level's Associated String List (ASL). The result is the value associated with that key or an empty string if no such key defined. The parameter is of the following form:
/level/key

Quest Stage
The parameter is the name of the quest. The result is the integer stage.

Item List
The parameter is the number of a party member. The first member is zero, the second is one, etc. Each items in that member's possession is added to the result in the form "slash item-name slash item-number slash". For example:
/Axe of Rain/0//Key of G/1//Toothbrush/2/

NPC List
No parameter. The result is a list of names and indexes of NPCs in the party. Each has the format "slash name slash index slash". For example:
"/Alex/0//Jon/1//Peter/2/"

Run Time Vars
The parameter is a character, game or party variable that is set during the game. A list of available variables is accessed by pressing the “...” button.

Character ASL
The parameter specifies both the character and the name of the attribute. The character selection is first and is contained in parentheses. There are three ways of specifying the character:
• By number. For example: (^3)
• By name. For example: (Gothmog)
• The active character. (^)
If Gothmog were the second character and highlighted then the complete parameter for obtaining his attribute named 'height' might look like any of the following:
• (^2)height
• (Gothmog)height
• (^)height
If no parenthesized selection appears before the attribute name then the active character is assumed.

Party ASL
The parameter names a party Associated String List (ASL) Entry. The resulting string is the value associated with that key in the party's ASL. If no such entry exists then the result is an empty string.

Wiggle
Use this input type to specify a subfield matched by a previous GREP expression. The parameter is the subfield number. For example, let us say that in Gate-C you searched the text:
"(X,3,7)(Y,8,2)(Z,1,3)"
using the GREP expression
"\(Y,([0-9]+),([0-9]+)\)"
The intent is to capture the two numeric values associated with the entry in the list which is named 'Y'. Here the two numeric values to be captured are surrouned by parentheses. The first will be called subfield 1 and the second will be called subfield two. Specifying 'Wiggle' with parameter "1" in input block D will result in "8" and using 'Wiggle' with parameter "2" in input block G will result in "2". Remember that the blocks in the LogicBlock event are evaluated in alphabetic order!

GPDL Function
This is really adding insult to injury for those of you who think that things are already too complicated. But here it is and it is another powerful tool. In a nutshell....You write a GPDL function that returns a value and that value is the value of the Logic Block input. The function has the form:

$PUBLIC FUNC input (A,B,C,D,E,F) { .......} input;
But you only have to write the '.......' part; the rest will be provided free of charge by the Logic Block Editor.

The formal parameters A through F will be set to the current values of the pieces of the Logic Block of the same names so that your GPDL function can reference the other values in the Logic Block. Wow! Now you can do anything.

So, let us say you wanted to write a function that returned the value of input A if input B was equal to "x67", else "buzzz". You would select 'GPDL Function' as the input-type and in the parameter area you might write:
$IF(B=="x67"){$RETURN A;}; $RETURN "buzzz";

The ampersand substitution does not work in the parameter field of this input block. However, the values of all the previously computed blocks are available to the GPDL function via its formal parameters 'A' through 'F'.

Temporary ASL
The parameter is the key for an entry in the temporary Associated String List (ASL). The result is the value associated with that key or an empty string if no such key is defined.

What Do You Need? No parameter. The result is an error during editing. This is here to remind you that you need to ask the development team to implement what you need to get your job done.


Back to Appendix B: Logic Blocks