Pfhortran Monster Control 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.

The following commands work on individual monsters:
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.
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.
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.

These are the names of the monster types, which correspond to the slots in the physics model.
minor_tick major_tick kamikaze_tick minor_compiler
major_compiler minor_invisible_compiler major_invisible_compiler minor_fighter
major_fighter minor_projectile_fighter major_projectile fighter green_bob
blue_bob security_bob explodabob minor_drone
major_drone big_minor_drone big_major_drone possessed_drone
minor_cyborg major_cyborg minor_flame_cyborg major_flame_cyborg
minor_enforcer major_enforcer minor_hunter major_hunter
minor_trooper major_trooper mega_cyborg mega_hunter
sewage_yeti water_yeti lava_yeti minor_defender
major_defender minor_juggernaut major_juggernaut tiny_pfhor
tiny_bob tiny_yeti green_vacbob blue_vacbob
security_vacbob explodavacbob

These are the names of the monster classes, which are used for the Friend and Enemy commands.
class_player class_bob class_madd class_possessed_drone
class_defender class_fighter class_trooper class_hunter
class_enforcer class_juggernaut class_drone class_compiler
class_cyborg class_explodabob class_tick class_yeti

These are the names of the damage types, for the immunity and weakness commands.
explosion staff projectile absorbed
flame claws alien_weapon hulk_slap
compiler fusion hunter fist
teleporter defender yeti_claws yeti_projectile
crushing lava suffocation goo
energy_drain oxygen_drain drone shotgun

Known Issues: