Those bloody invalid pointers

The following two actions are assigned to two entities in the level. Yesterday they worked perfectly. But today, after changing something in the level at a totally different place, suddenly an "empty pointer" error message is spat out by the second action! How come?
entity* monster;

action become_monster { monster = MY; // set a global pointer, that can be used by other functions }

action get_monster_height { my.z = monster.z; // use the pointer to set my vertical position to the monster's }
The second action requires the monster pointer being already set. However this depends on whether the first action was started before the second - and there's only a 50% chance. It is not defined in which order the actions assigned to entities are started at level loading. Replace your second action by:

action set_monster_height
{
while (monster == NULL) { wait(1); } // wait until there is a monster
my.z = monster.z;
}

Remarks:

If using a pointer - even a simple one like MY or YOU - always think about the possibility that it could be undefined at that time!