Pfhortran current has a good number of instructions for manipulating the game environment and managing variables, as well as general script execution instructions. The following lists are divided into several categories: Variable Management, Game Environment, Cameras, Paths, and Script Execution.
Variable Management
|
INSTRUCTION |
|
OPERANDS |
|
DESCRIPTION |
Define
Def |
|
x |
|
Defines a new variable with starting value x. Must be preceded by a label to reference the variable by. Example: zippo: def 1 would define a new variable called zippo that had a value of 1. |
Add |
|
x, y |
|
Adds the value of y to variable x. |
Subtract |
|
x, y |
|
Subtracts the value of y from variable x. |
If_Equal
If_= |
|
x, y, label |
|
Compares x and y. If they are equal, execution jumps to label. |
Set |
|
x, y |
|
Sets the value of x to y. |
If_Greater
If_> |
|
x, y, label |
|
Compares x and y. If x > y, execution jumps to label. |
If_Less
If_< |
|
x, y, label |
|
Compares x and y. If x < y, execution jumps to label. |
If_!Equal
If_Not_Equal
If_!= |
|
x, y, label |
|
Compares x and y. If x does not equal y, execution jumps to label. |
|
Game Environment
|
INSTRUCTION |
|
OPERANDS |
|
DESCRIPTION |
Inflict_Damage |
|
x |
|
Inflicts x points of damage on the player. |
Hide_Interface |
|
|
|
Hides the HUD and player weapon graphics. |
Show_Interface |
|
|
|
Shows the HUD and player weapon graphics. |
Set_Tag_State |
|
x, y |
|
Sets the state of tag x to y. y may be TRUE or FALSE |
Get_Tag_State |
|
x, y |
|
Returns the state of tag x into y (TRUE or FALSE). |
Get_Life |
|
x |
|
Puts the player's life into x. |
Set_Life |
|
x |
|
Sets the player's life to x. |
Get_Oxygen |
|
x |
|
Puts the player's oxygen into x. |
Set_Oxygen |
|
x |
|
Sets the player's oxygen to x. |
Add_Item |
|
x |
|
Adds item x to the player's inventory. For a complete list of items, see the Pfhortran Mnemonics section. |
Select_Weapon |
|
x |
|
Forces the player to select weapon x. For a complete list of items, see the Pfhortran Mnemonics section. |
Teleport_Player |
|
x |
|
Teleports the player to polygon x. |
|
Camera Instructions
|
INSTRUCTION |
|
OPERANDS |
|
DESCRIPTION |
Init_Cameras |
|
x |
|
Initializes x number of custom cameras for use. |
Select_Camera |
|
x |
|
Selects camera x for editing. |
Set_Camera_Poly |
|
x |
|
Puts the currently selected camera in polygon x. |
Set_Camera_Pos |
|
x, y, z |
|
Sets the camera's position to x, y, z. |
Set_Camera_YP |
|
x, y |
|
Sets the camera's yaw and pitch values to x and y. |
Activate_Camera |
|
|
|
Activates the currently selected camera. |
Use_Camera |
|
x |
|
Selects and activates camera x. |
Start_Camera_On_Path |
|
x |
|
Start the currently selected camera moving on path x. |
|
Camera Path Instructions
|
INSTRUCTION |
|
OPERANDS |
|
DESCRIPTION |
Init_Paths |
|
x |
|
Initializes x number of custom paths for use. |
New_Path |
|
x, y |
|
Initializes path x to have y points. Note that paths start at 1. |
Dispose_Path |
|
x |
|
Frees path x from memory. |
Select_Path |
|
x |
|
Selects a path for editing. |
Set_Path_Move_Speed |
|
x |
|
Sets the movement speed of the current path to x. The lower the number, the faster the movement. |
Set_Path_Roll_Speed |
|
x |
|
Sets the rolling speed of the current path to x. The lower the number, the faster the movement. |
Select_Point |
|
x |
|
Selects a point from the current path to edit. Note that points start at zero. |
Set_Point_Poly |
|
x |
|
Puts the currently selected point in polygon x. |
Set_Point_Pos |
|
x, y, z |
|
Sets the current point's position to x, y, z. |
Set_Point_YP |
|
x, y |
|
Sets the points's yaw and pitch values to x and y. |
Monster Action Instructions
|
These are the monster control instructions for Pfhortran. Monsters are referred to in the game by index numbers, which usually fall into quite a narrow range. Most of these functions will only accept variables in some of their arguments. This was done to strongly encourage scripters to always use these commands with a monster index they got from Monster_Select. Any argument in italics must be a variable, failure to do this will result in the instruction having no effect and an error message being sent to your favorite debugger.
|
INSTRUCTION |
|
OPERANDS |
|
DESCRIPTION |
Monster_Select |
|
monster, type, polygon |
|
This command will return a reference to a monster of type type in polygon polygon, and put that reference into monster. If there is no monster of that type in the polygon, Monster_Select returns -1. If there is more than one monster, the monster chosen is random (sort of). A monster reference obtained through this command is valid while that monster is alive. Pfhortran has mnemonics for the various monster types, see below. |
Monster_Move |
|
monster, polygon |
|
This command will cause monster monster to try to go to polygon polygon. The exact path he takes may vary, as the effect of this command is identical to what would happen if the engine had decided he should go to that polygon for any other reason (goal polygon, chasing another monster, etc.). |
Monster_Sleep |
|
monster |
|
This command will deactivate the monster monster. He will stop moving, but can wake up if he sees a need to. |
Monster_Hurt |
|
monster, damage |
|
This command does damage points of Fist damage to monster monster. If appropriate, the monster will wake up, or die. The monster will react as if he had been dealt that much damage by a normal projectile, this may include being flung across the room for large amounts of damage |
Monster_Attack |
|
monster1, monster2 |
|
This command will cause monster1 to attack monster2. The friend/enemy settings are bypassed; any monster can be made to attack any other with this command. |
Monster Property Instructions
|
The following commands alter the properties of monsters. Since they effectively change the physics model while the game is running, they affect all monsters of that type. |
INSTRUCTION |
|
OPERANDS |
|
DESCRIPTION |
Monster_Get_Immunity |
|
monster, type, value |
|
This command will return the value of monster's invulnerability to damage of type type in value. Value is 0 if the monster is vulnerable to that damage type, 1 if he is immune. Pfhortran has mnemonics for the damage types, see below. |
Monster_Set_Immunity |
|
monster, type, value |
|
This command will turn on or off monster's invulnerability to damage of type type. Set value to 0 to make him vulnerable, 1 to make him immune. Sending any other value to this command causes an error. Pfhortran has mnemonics for the damage types, see below. |
Monster_Get_Weakness |
|
monster, type, value |
|
This command will return the value of monster's weakness to damage of type type in value. Value is 0 if the monster is not weak to that damage type, 1 if he is. Pfhortran has mnemonics for the damage types, see below. (FYI: Weakness causes a monster to take double damage from that type, and to always suffer hard death.) |
Monster_Set_Weakness |
|
monster, type, value |
|
This command will turn on or off monster's weakness to damage of type type. Set value to 0 to make him normal, 1 to make him weak. Sending any other value to this command causes an error. Pfhortran has mnemonics for the damage types, see below. (FYI: Weakness causes a monster to take double damage from that type, and to always suffer hard death.) |
Monster_Get_Friend |
|
monster, class, value |
|
This command will return the value of monster's friendliness to monsters of class class in value. Value is 0 if the monster is not friendly to that monster class, 1 if he is. Pfhortran has mnemonics for the monster class types, which are different from the basic monster types, see below. A monster will not wake up if he sees a friend, and he will ignore a friend who shoots him. |
Monster_Set_Friend |
|
monster, class, value |
|
This command will turn on or off monster's friendship of monsters of class class. Set value to 0 to make the monster non_friendly towards that class; set it to 1 to make him friendly. Pfhortran has mnemonics for the monster class types, which are different from the basic monster types, see below. A monster will not wake up if he sees a friend, and he will ignore a friend who shoots him. |
Monster_Get_Enemy |
|
monster, class, value |
|
This command will return the value of monster's hatred of monsters of class class in value. Value is 0 if the monster is not an enemy of that monster class, 1 if he is. Pfhortran has mnemonics for the monster class types, which are different from the basic monster types, see below. A monster will wake up and/or attack if he sees an enemy. |
Monster_Set_Enemy |
|
monster, class, value |
|
This command will turn on or off monster's hatred of monsters of class class. Set value to 0 to make the monster not hate that class; set it to 1 to make him hate it. Pfhortran has mnemonics for the monster class types, which are different from the basic monster types, see below. A monster will wake up and/or attack if he sees an enemy. |
Monster_Get_Item |
|
monster, value |
|
This command will return the item dropped by monster when it is killed. If there is no item, value will be 0. |
Monster_Set_Item |
|
monster, value |
|
This command will set the item dropped by monster when it is killed. Set this to 0 to cause it to not drop anything. |
|
Script Execution
|
INSTRUCTION |
|
OPERANDS |
|
DESCRIPTION |
Wait_Ticks |
|
x |
|
Forces Pfhortran to wait x ticks before executing the next instruction. |
Jump |
|
label |
|
Jumps to label. The instruction immediately following label will be the next instruction executed. |
Script_End |
|
|
|
Stops all Pfhortran script execution and frees the current script from memory. |
Call |
|
label |
|
Call a function. The same as Jump, but the calling position is saved, so the function can return to the call statement with the Return instruction. |
Return |
|
|
|
Return to the last call instruction. The next instruction after the call statement will be the next instruction executed. |
End |
|
|
|
End a procedure. The procedure will not be purged from memory and may be called again. |
Get_My_Value |
|
x |
|
Get the current "which" value associated with the current procedure and put it into x. |
Block_Start |
|
|
|
Begin a quick execution block. All code between Block_Start and Block_End will be executed in a single frame. |
Block_End |
|
|
|
End a quick execution block. All code between Block_Start and Block_End will be executed in a single frame. |
|
Misc Instructions
|
INSTRUCTION |
|
OPERANDS |
|
DESCRIPTION |
Change_Soundtrack |
|
x |
|
Changes the midi soundtrack to track x and plays it. |
Set_Fog_Depth |
|
x |
|
Sets the depth of OpenGL fog to x. |
s_Get_Fog_Depth |
|
x |
|
Returns the depth of the current OpenGL fog to x. |
Set_Fog_Color |
|
r, g, b |
|
Set the OpenGL fog color to r, g, b. |
Get_Fog_Color |
|
r, g, b |
|
Return the OpenGL fog color to r, g, b. |
|
|
|
|