Monster Placement

At the beginning of a combat event we need to determine the initial positions of all the monster combatants. Here is how we go about it:


The script can control the placement of the monsters in that one direction. It can place the monsters wherever it chooses but it can only control those monsters that the editor said should be placed in the one particular direction.


The script controls monster placement by controlling a 'virtual' turtle. The turtle starts at the location of the party. It may very well be that there is no party member at that location (See Party Arrangement). The script can tell the turtle to take a step forward, backward, left, or right. We avoid absolute directions like 'North' so that the same turtle commands will work for any of the four directions from the party. The turtle can also cause a monster to be placed at the turtle's current position.


For example, to place three monsters in a single rank six cells from the party the instructions might be:

The script issues these commands by executing $MonsterPlacement(string). The string contains single character commands which are executed one-at-a-time:


Any of the commands can also be preceded by an integer telling how many times to repeat the next step. The string for our example would be: “6FPRPLLP”.


The script can call this function as many times as is needed to position all of the monsters in a single direction.


Status Codes


$MonsterPlacement() returns a string as status. A '0' (zero) indicates that the command contained a 'P' (to place a monster) but that there were no more monsters available to be placed.


Responses to the '? command. If the turtle size is other than one-by-one then it is possible that more than one status could apply. But you only receive the the one we discover first.


Hook Parameters


None

Context


None