EDIT2: Looks like the others beat me to it, heh- I take far too long to write posts. Anyhow, good luck, and like Nadnerb's, this script only opens a door- if you want to close it too, use D'Lanor's script.
I'm trying to do this at the moment as well ekimmai, and I'm not exactly an AlcScript wizard either

. If you want the script without the information on how I worked it out (which could be useful when you're trying to stick scripts together in the future), it is located right at the bottom of this post. Triggering regions with AlcScript may sound impossible, but luckily for us, it can be done- Robert the Rebuilder used some code to open a door an Ahra Pahts when the avatar enters a region. Now, his AlcScript looks like this:
- Code: Select all
Portal13To44:
physical:
physlogic: detect
logic:
modifiers:
- tag: mod
flags:
- multitrigger
activators:
- type: objectinvolume
triggers:
- enter
conditions:
- type: volumesensor
satisfied: true
direction: enter
actions:
- type: pythonfile
ref: $click
actions:
- type: pythonfile
tag: click
pythonfile:
file: LinkTest01Portal
parameters:
- type: activator
ref: $mod
- type: string
value: Portal13To44
There is one main difference between this script and the one we want to make- this one sends a message out to a python script which does all the animation and the paging code. The script was written when python had to be used for animations, and the door separates the regions of Pahts so that it doesn't get to laggy, which is the function of the paging code. Now, my age isn't going to be huge, so I don't need the python file, and therefore the python-related code is redundant for our purposes.
We're going to keep most of the first bit, which just details that the things after that section need to happen after the avatar enters the region. So, our AlcScript looks like this (but it's not done yet):
- Code: Select all
Portal13To44:
physical:
physlogic: detect
logic:
modifiers:
- tag: mod
flags:
- multitrigger
activators:
- type: objectinvolume
triggers:
- enter
conditions:
- type: volumesensor
satisfied: true
direction: enter
actions:
Now we're going to attempt to make franken-script (it lives, Igor!) by splicing the animation trigger script with the region script, and then eventually joining that up that with the animation saving script ([gwiki=Saving_Object_Animations%27_States]here[/gwiki]), once I work out how to use it by itself.
As you probably know, the AlcScript for triggering an animation with a button push is the following:
- Code: Select all
<object>:
logic:
actions:
- type: responder
name: <responder name>
responder:
states:
- cmds:
- type: animcmdmsg
params:
receivers:
- 006D:<name of animated object>
animname: <name of animation>
cmds:
- continue
waiton: -1
nextstate: 1
waittocmd: 0
curstate: 0
flags:
- detecttrigger
The region script already contains the object.logic.action bits, so we're only going to add on the part after action. In the script below, I've removed all the refernces to Robert's objects- you need to rename all the things between the <> tags to the object/animation/region name.
- Code: Select all
<region name here>:
physical:
physlogic: detect
logic:
modifiers:
- tag: mod
flags:
- multitrigger
activators:
- type: objectinvolume
triggers:
- enter
conditions:
- type: volumesensor
satisfied: true
direction: enter
actions:
- type: responder
name: <region name>
responder:
states:
- cmds:
- type: animcmdmsg
params:
receivers:
- 006D:<name of animated object>
animname: <name of animation>
cmds:
- continue
waiton: -1
nextstate: 1
waittocmd: 0
curstate: 0
flags:
- detecttrigger
And there you go, one (hopefully) working trigger script

. Remember to assign the animation to an object using AlcScript too:
- Code: Select all
<object>:
animations:
- name: <animation name>
autostart: 0
loop: <[0 | 1]>
loopstart: <start time in seconds>
loopend: <end time in seconds>
Oh, and one more thing: the region will work forever (muahahaha), so when you step back through the region after exiting it, the object animation will jerk back to frame one and play again. I found a rather longwinded way of preventing this by making the region animate itself into a position 100 feet into the air when you step into it, assuring that the animation would play once only. There is proabably a simpler way involving OneShotMods- if only I knew exactly what they were, other than that they're related to playing animations.
EDIT: big thanks to all the people who posted in
this thread!