Scripting idea for triggers
Posted: Sun Oct 12, 2003 7:07 pm
Don't know if anyone has thought of or done this already, but it occured to me that you could make a "directional trigger" (i.e. to tell which direction a player/party was walking in when they triggered the trigger.
Place 2 triggers directly adjacent to each other somewhere where they will get stepped on, e.g. a corridor. Let's say the corridor runs East-West. The 2 triggers will be next to each other one slightly to the East of the other.
Using a simple script to set flag when the triggers are stepped on, it is possible to know which trigger was stepped on first, and therefore tell which direction the player/party is moving in (.e. Eastwards or Westwards)
This could be used, for example, to make an encounter always spawn ahead of the party (whichever way they were walking), or behind, or whatever. If used at the entrance to a room or sub-area, it could be used to do different things depending on whether the player/party was entering or leaving ... etc.
Just a thought.
Place 2 triggers directly adjacent to each other somewhere where they will get stepped on, e.g. a corridor. Let's say the corridor runs East-West. The 2 triggers will be next to each other one slightly to the East of the other.
Using a simple script to set flag when the triggers are stepped on, it is possible to know which trigger was stepped on first, and therefore tell which direction the player/party is moving in (.e. Eastwards or Westwards)
This could be used, for example, to make an encounter always spawn ahead of the party (whichever way they were walking), or behind, or whatever. If used at the entrance to a room or sub-area, it could be used to do different things depending on whether the player/party was entering or leaving ... etc.
Just a thought.