by andylegate » Mon Jul 26, 2010 7:18 pm
Several ways to accomplish what you are talking about. Unfortunately it's easier to say how I would do it with Cyan's plugin, than with ALCScripting, however, the principle is still the same:
First, obviously you are designing the Age for Multiplay, which is outstanding, as many people (including myself) have a tendency to make Ages with only single play in mind.
What you can do is this: Have more than one responder for the door, one opens it, the other responder closes it (IE sets the animation backwards and then plays it).
What I would do is create 2 regions that extend on either side of the door, and the avatar entering one region is what triggers the first responder. The 2nd region is the trigger when the avatar exits it. Have the first responder enabled, but the 2nd responder disabled.
The first responder will open the door, once it does, it also disables itself, and enables the 2nd responder.
The 2nd responder closes the door, then disables itself, and re-enables the first responder (again, this is how I did my lever puzzle in Neolbah).
So let's look at a scenario: 2 people are walking towards the door, one is about 20 feet back let's say. The first Avatar enters the "Enter" region. This triggers the first responder since it is enabled (the 2nd region has no effect because the detector for it is on Exit and not Enter, also, the 1st region is set for Enter detection, and not Exit).
The first responder will open the door (setting and playing the animation forward) and then disables itself, and also enables the 2nd responder (which will close the door when triggered).
If the 2nd avatar catches up to the first, before the first one exits the regions, there will be NO effect by that 2nd Avatar, because the first responder has already been disabled by the 1st avatar.
If the 1st avatar exits before the 2nd avatar catches up, the door will close (due to the 1st avatar exiting the "Exit" region), and that 2nd responder that closed the door will disable itself and re-enable the 1st responder. This sets the door up so that when the 2nd avatar get's there, it will start the sequence again, and open the door.
In either case, this will prevent the region from triggering either responder out of sequence and making the door "magically" reappear and suddenly open or close.
Sounds complicated, but it's not really (and again, I apologize for not knowing the ALCScripting for all this, but again, with Cyan's plugin, it's a snap to do).
You can also do it with one region, again making the trigger both Enter and Exit, but still making 2 different responders, each disabling themselves after the door animation and Enabling the other when complete.
You can also set up using Python to check the SDL state of the door.
There is also another way to do it using the python files (star trek doors) but I only know how to use those with Cyan's plugin. Someone here might know how to use it with the ALCScripting.