J'Kla, that would still make the avatar do the button push animation on both sides of the door.
Justin, I believe this should do the trick. Use this AlcScript:
- Code: Select all
AnimDoor:
animations:
- name: DoorAnim
autostart: 0
loop: 0
logic:
actions:
- type: pythonfile
tag: BoolTagResp
pythonfile:
file: ZeforaBoolTagResp
parameters:
- type: string
value: DoorOpen
- type: responder
ref: $AnimFWOutside
- type: responder
ref: $AnimBWOutside
- type: bool
value: false
- type: bool
value: true
- type: string
value: inside
- type: responder
ref: $AnimFWInside
- type: responder
ref: $AnimBWInside
- type: responder
tag: AnimFWOutside
responder:
states:
- cmds:
- type: oneshotmsg
params:
receivers:
- oneshotmod:ButtonEmptyOutside
callbacks:
- marker: DoorButtonTouch
receiver: respondermod:$AnimFWOutside
user: 0
waiton: -1
- type: animcmdmsg
params:
receivers:
- 006D:AnimDoor
animname: DoorAnim
cmds:
- setforewards
- continue
waiton: 0
- type: soundmsg
params:
receivers:
- 0011:DoorCreakEmpty
cmds:
- play
- setvolume
volume: 1
waiton: -1
nextstate: 0
waittocmd: 0
curstate: 0
flags:
- detecttrigger
- type: responder
tag: AnimBWOutside
responder:
states:
- cmds:
- type: oneshotmsg
params:
receivers:
- oneshotmod:ButtonEmptyOutside
callbacks:
- marker: DoorButtonTouch
receiver: respondermod:$AnimBWOutside
user: 0
waiton: -1
- type: animcmdmsg
params:
receivers:
- 006D:AnimDoor
animname: DoorAnim
cmds:
- setbackwards
- continue
waiton: 0
- type: soundmsg
params:
receivers:
- 0011:DoorCreakEmpty
cmds:
- play
- setvolume
volume: 1
waiton: -1
nextstate: 0
waittocmd: 0
curstate: 0
flags:
- detecttrigger
- type: responder
tag: AnimFWInside
responder:
states:
- cmds:
- type: oneshotmsg
params:
receivers:
- oneshotmod:ButtonEmptyInside
callbacks:
- marker: DoorButtonTouch
receiver: respondermod:$AnimFWInside
user: 0
waiton: -1
- type: animcmdmsg
params:
receivers:
- 006D:AnimDoor
animname: DoorAnim
cmds:
- setforewards
- continue
waiton: 0
- type: soundmsg
params:
receivers:
- 0011:DoorCreakEmpty
cmds:
- play
- setvolume
volume: 1
waiton: -1
nextstate: 0
waittocmd: 0
curstate: 0
flags:
- detecttrigger
- type: responder
tag: AnimBWInside
responder:
states:
- cmds:
- type: oneshotmsg
params:
receivers:
- oneshotmod:ButtonEmptyInside
callbacks:
- marker: DoorButtonTouch
receiver: respondermod:$AnimBWInside
user: 0
waiton: -1
- type: animcmdmsg
params:
receivers:
- 006D:AnimDoor
animname: DoorAnim
cmds:
- setbackwards
- continue
waiton: 0
- type: soundmsg
params:
receivers:
- 0011:DoorCreakEmpty
cmds:
- play
- setvolume
volume: 1
waiton: -1
nextstate: 0
waittocmd: 0
curstate: 0
flags:
- detecttrigger
ButtonEmptyOutside:
logic:
actions:
- type: oneshot
name: ButtonEmptyOutside
oneshot:
animation: DoorButtonTouch
ButtonEmptyInside:
logic:
actions:
- type: oneshot
name: ButtonEmptyInside
oneshot:
animation: DoorButtonTouch
DoorButtonOutside:
logic:
modifiers:
- tag: StateAnim
cursor: poised
flags:
- localelement
activators:
- type: objectinvolume
remote: ButtonRegionOutside
triggers:
- any
conditions:
- type: activator
activators:
- type: picking
- type: objectinbox
satisfied: true
actions:
- type: pythonfile
ref: $BoolToggle
actions:
- type: pythonfile
tag: BoolToggle
pythonfile:
file: xAgeSDLBoolToggle
parameters:
- type: activator
ref: logicmod:$StateAnim
- type: string
value: DoorOpen
- type: skip
- type: skip
- type: string
value: outside
DoorButtonInside:
logic:
modifiers:
- tag: StateAnim
cursor: poised
flags:
- localelement
activators:
- type: objectinvolume
remote: ButtonRegionInside
triggers:
- any
conditions:
- type: activator
activators:
- type: picking
- type: objectinbox
satisfied: true
actions:
- type: pythonfile
ref: $BoolToggle
actions:
- type: pythonfile
tag: BoolToggle
pythonfile:
file: xAgeSDLBoolToggle
parameters:
- type: activator
ref: logicmod:$StateAnim
- type: string
value: DoorOpen
- type: skip
- type: skip
- type: string
value: inside
And make sure to replace the AlcScript for the AnimDoor object so that there are
no double references to the same object. I gave the other objects different names to indicate their inside or outside position.
Then (assuming this is still Zefora) add this Python file to the pak of your age: