This goes up an down, for example using this AlcScript, which defines a responder with actions for up and down:
- Code: Select all
Elevator:
animations:
- name: EL_Anim
autostart: 0
loop: 0
logic:
actions:
- type: responder
name: EL_Move
responder:
states:
- cmds: # Resp.Action 1: Elevator UP
- type: animcmdmsg
params:
receivers:
- 006D:Elevator
animname: EL_Anim
cmds:
- setforewards
- continue
waiton: -1
nextstate: 1
waittocmd: 0
- cmds: # Resp.Action 2: Elevator DOWN
- type: animcmdmsg
params:
receivers:
- 006D:Elevator
animname: EL_Anim
cmds:
- setbackwards
- continue
waiton: -1
nextstate: 0
waittocmd: 0
curstate: 0
flags:
- detecttrigger
No problem with this. The "down" animation part is simply the up animation reversed (- setbackwards).
BUT: What if I want an Elevator which can move to Level 1, 2 and 3, so it can move from 1 to 2, from 2 to 3, and from 3 to 1?
In other words, is it possible to define this using properly set responders and animations, or do I have to control it with Python?
(Actually I do know how I could do it with Python, just wondering if responders are an alternative here.)
The main problem is not how to define the responders, but how I could define the animation.
In other words, how could I define that there's a stop at level 2?
Edit: I should clarify this. With stop at level 2 I mean, the animation triggered by the first responder action completely stops here and does not continue until a next responder action is called (e.g. triggered by a region or button), which then makes the thing move from 2 to 3.
- Code: Select all
cmds:
- setforewards
- continue
always play from start to end. So how could I tell it to play only part of the animation in AlcScript?