I have tried to figure this out and made three scripts for the buttons;
Button on the platform
- Code: Select all
LiftButton:
physical:
subworld: Lift
logic:
modifiers:
- cursor: poised
flags:
- localelement
activators:
- type: objectinvolume
remote: LiftButtonRegion
triggers:
- any
conditions:
- type: activator
activators:
- type: picking
- type: objectinbox
satisfied: true
actions:
- type: responder
ref: :MoveLift
actions:
- type: responder
name: MoveLift
responder:
states:
- cmds:
- type: oneshotmsg
params:
receivers:
- oneshotmod:PushTheButton
callbacks:
- marker: TouchButton
receiver: respondermod:MoveLift
user: 0
waiton: -1
- type: animcmdmsg
params:
receivers:
- 006D:Lift
animname: AnimLift
cmds:
- setforewards
- continue
waiton: 0
- type: animcmdmsg
params:
receivers:
- 006D:LiftDoor1
animname: AnimLiftDoor1
cmds:
- setforewards
- continue
waiton: -1
- type: animcmdmsg
params:
receivers:
- 006D:LiftDoor2
animname: AnimLiftDoor2
cmds:
- setforewards
- continue
waiton: -1
- type: soundmsg
params:
receivers:
- 0011:LiftButtonSndEm
cmds:
- play
- setvolume
volume: 1
waiton: -1
nextstate: 1
waittocmd:
- key: 0
msg: 0
- cmds:
- type: oneshotmsg
params:
receivers:
- oneshotmod:PushTheButton
callbacks:
- marker: TouchButton
receiver: respondermod:MoveLift
user: 0
waiton: -1
- type: animcmdmsg
params:
receivers:
- 006D:Lift
animname: AnimLift
cmds:
- setbackwards
- continue
waiton: 0
- type: animcmdmsg
params:
receivers:
- 006D:LiftDoor1
animname: AnimLiftDoor1
cmds:
- setbackwards
- continue
waiton: -1
- type: animcmdmsg
params:
receivers:
- 006D:LiftDoor2
animname: AnimLiftDoor2
cmds:
- setbackwards
- continue
waiton: -1
- type: soundmsg
params:
receivers:
- 0011:LiftButtonSndEm
cmds:
- play
- setvolume
volume: 1
waiton: -1
nextstate: 0
waittocmd:
- key: 0
msg: 0
curstate: 0
flags:
- detecttrigger
For the other two buttons the same script (whitout the physical part) and a different 'title' CallLiftButton1 and CallLiftButton2.
changed oneshotmod into PushBtn1 and PushBtn2 and changed the names of the soundemitters and buttonregions.
And for the seeking points for the buttons outside the platform;
- Code: Select all
CallLiftOSP1:
logic:
actions:
- type: oneshot
name: PushBtn1
oneshot:
animation: ButtonTouch
CallLiftOSP2:
logic:
actions:
- type: oneshot
name: PushBtn2
oneshot:
animation: ButtonTouch
Now some strange things happen;
When the testage is loaded the right button is 'hot', but when clicked the avatar goes to the left button and performs his animation.
When the right button is 'hot' all is well.
When the platform is on the left and the button on the platform is clicked, the avatar goes to the 0,0,0 point of the age and performs there his animation.
When the platform is on the right and the button is clicked, the avatar goes to a point 50 units to the left of the 0,0,0 point and performs his animation there.
In the mean time the platform does what it has to do, it moves in the right way, only thing is the avatar is not on it.
When I commented out the scripting for the two 'call' buttons everything works like a charm.
Anyone an idea where I go wrong with the scripting?
Regards,
Frits