Invoking a GPDL Program

DungeonCraft Help Home

The compiled GPDL program must be named "talk.bin", a name that reflects its first use as a primitive conversation generator.

During gameplay, a GPDL function is invoked by special text in a text event. This method may seem a bit strange but, like the human appendix, it has a reason that can only be discovered by study of ancient history.

In a text event, you put:

**SHAZAM**functionname(parameters)

as the first characters. Anything after that will be ignored. The function must have been declared $PUBLIC and must have the same number of formal parameters as provided in the call.

For example:

**SHAZAM**checkForApples(3)Check for any apples in backpack

might be used to determine if the third player in a party has any apples. The text "Check for any apples in the backpack" will be treated as a comment.

In the program itself there must be a function of one paramter named checkForApples. Example:

$PUBLIC $FUNC checkForApples ( playerNum )
{
   $IF ( $IF_CHAR_ATTR(playerNum,"Apples") )
   {
      $SAY ( "Eat your apples, Stupid!");
   };
} checkForApples ;