Page 1 of 1

Could have been two rotating doors..

PostPosted: Sat Sep 27, 2008 2:08 pm
by Tinuviel
I'm back:-) And as always with some questions... This time I'm trying to make two rotating doors. There are probably some other and easyer way to do this, and if so: I would be very grateful for any help.
The problem is that I want to be able to press on any of the two doors and then both will open. (Not just the one I pressed.) The doors them self are the clickabol object, and I have an empty for each door, and a region for each door. The empty is also animated to follow the doors. The problem now is that when I enter my age the doors are open instead of closed and they are not clickabole. As always I guess the error on my part is something very simple, but right now I to tired to see it:-)
Here is the alcscript for one of the doors. I have the same alcskript for door two.
Code: Select all
TowerDoor1:
    animations:
      - name: TowerDoorOpen1   #name of animation
        autostart: 0
        loop: 0
    logic:
        modifiers:
            cursor: poised
            flags:
              - localelement
            activators:
              - type: objectinvolume
                remote: TowerDoorclick  #<click region>
                triggers:
                  - any
            conditions:
              - type: activator
                activators:
                  - type: picking
              - type: objectinbox
                satisfied: true
            actions:
              - type: responder
                ref: OpenBothDoors1
              - type: responder
                ref: CloseBothDoors1
        actions:
          - type: responder
            name: OpenBothDoors1
            responder:
                states:
                  - cmds:
                      - type: oneshotmsg
                        params:
                            receivers:
                              - oneshotmod:TowerButtonShot1  #<seek point name>
                            callbacks:
                              - marker: "DoorButtonTouch"
                                receiver: respondermod:OpenBothDoors1  #<responder name>
                                user: 0
                        waiton: -1
                      - type: animcmdmsg
                        params:
                            receivers:
                              - 006D:TowerDoor1
                            animname: TowerDoorOpen1
                            cmds:
                              - setforewards
                              - continue
                        waiton: 0
                      - type: animcmdmsg
                        params:
                            receivers:
                              - 006D:TowerButtonShot1
                            animname: emptyRotate1
                            cmds:
                              - setforewards
                              - continue
                        waiton: 0
                      - type: animcmdmsg
                        params:
                            receivers:
                              - 006D:TowerDoor2
                            animname: TowerDoorOpen2
                            cmds:
                              - setforewards
                              - continue
                        waiton: 0
                      - type: animcmdmsg
                        params:
                            receivers:
                              - 006D:TowerButtonShot2
                            animname: emptyRotate2
                            cmds:
                              - setforewards
                              - continue
                        waiton: 0
                    nextstate: 0
                    waittocmd:
                      - key: 0
                        msg: 0
                curstate: 0
                flags:
                  - detecttrigger
          - type: responder
            name: CloseBothDoors1
            responder:
                states:
                  - cmds:
                      - type: oneshotmsg
                        params:
                            receivers:
                              - oneshotmod:TowerButtonShot1  #<seek point name>
                            callbacks:
                              - marker: "DoorButtonTouch"  #<avatar animation marker name>
                                receiver: respondermod:CloseBothDoors  #<responder name>
                                user: 0
                        waiton: -1
                      - type: animcmdmsg
                        params:
                            receivers:
                              - 006D:TowerDoor1
                            animname: TowerDoorOpen1
                            cmds:
                              - setbackwards
                              - continue
                        waiton: 0
                      - type: animcmdmsg
                        params:
                            receivers:
                              - 006D:TowerButtonShot1
                            animname: emptyRotate1
                            cmds:
                              - setbackwards
                              - continue
                        waiton: 0
                      - type: animcmdmsg
                        params:
                            receivers:
                              - 006D:TowerDoor2
                            animname: TowerDoorOpen2
                            cmds:
                              - setbackwards
                              - continue
                        waiton: 0
                      - type: animcmdmsg
                        params:
                            receivers:
                              - 006D:TowerButtonShot2
                            animname: emptyRotate2
                            cmds:
                              - setbackwards
                              - continue
                        waiton: 0
                    nextstate: 0
                    waittocmd:
                      - key: 0
                        msg: 0
                curstate: 0
                flags:
                  - detecttrigger


TowerDoor2:
    animations:
      - name: TowerDoorOpen2
        autostart: 0
        loop: 0

TowerButtonShot1:  #<seek point object>:  #the empty
   animations:
     - name: emptyRotate1
       autostart: 0
       loop: 0
   logic:
        actions:
          - type: oneshot
            name: TowerButtonShot1
            oneshot:
                animation: DoorButtonTouch


Edit: Found some errors on my alcscript. Now my doors are clickable and they animate. But door 2 is not triggered by my clicking and the doors only open. They will not be closed. Alcscript above have been updated

Re: Could have been two rotating doors..

PostPosted: Sun Sep 28, 2008 11:05 pm
by Jennifer_P
Sorry I haven't been able to help out any with the alcscript yet, Tinuviel; the fact is, I haven't even been able to finish the regular assignments in my computer science class (eep!). :roll:

Re: Could have been two rotating doors..

PostPosted: Mon Sep 29, 2008 1:05 am
by Tinuviel
Oh, thats ok:-) I know you are full up. I have now got so far that both doors open, but my avatar insist on closing them imidiatly without asking for my permision :D

Re: Could have been two rotating doors..

PostPosted: Mon Sep 29, 2008 9:29 am
by boblishman
Code: Select all
receiver: respondermod:CloseBothDoors  #<responder name>


should read CloseBothDoors1

Re: Could have been two rotating doors..

PostPosted: Mon Sep 29, 2008 12:47 pm
by Tinuviel
Thanks Boblishman. As said: I'm probably just doing something stupid again. Corrected my error but I still can't get it. My avatar clicks to open the doors, they open and then my avatar moves over to click on the doors again. And therby closing them:-) And now I can't get in to my tower :lol:

I guess I have to go back to using a button again. That I managed to work. (I know it's hard to belive, but honestly I did make that work!)

Re: Could have been two rotating doors..

PostPosted: Mon Sep 29, 2008 4:33 pm
by D'Lanor
Hmm yes, that is exactly what you are telling it to do by adding both responders as actions for the modifier. You need a state toggling mechanism as described on the wiki.

Edit: Here you go for the alcscript.

Code: Select all
TowerDoor1:
    animations:
      - name: TowerDoorOpen1   #name of animation
        autostart: 0
        loop: 0
    logic:
        modifiers:
          - tag: ClickMe
            cursor: poised
            flags:
              - localelement
            activators:
              - type: objectinvolume
                remote: TowerDoorclick  #<click region>
                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:$ClickMe
                  - type: string
                    value: <SDL Name>
                  - type: skip
                  - type: skip
                  - type: string
                    value: <SDL Name>
          - type: pythonfile
            tag: BoolRespond
            pythonfile:
                file: xAgeSDLBoolRespond
                parameters:
                  - type: string
                    value: <SDL Name>
                  - type: responder
                    ref: :OpenBothDoors1
                  - type: responder
                    ref: :CloseBothDoors1
                  - type: bool
                    value: false
                  - type: bool
                    value: true
          - type: responder
            name: OpenBothDoors1
            responder:
                states:
                  - cmds:
                      - type: oneshotmsg
                        params:
                            receivers:
                              - oneshotmod:TowerButtonShot1  #<seek point name>
                            callbacks:
                              - marker: "DoorButtonTouch"
                                receiver: respondermod:OpenBothDoors1  #<responder name>
                                user: 0
                        waiton: -1
                      - type: animcmdmsg
                        params:
                            receivers:
                              - 006D:TowerDoor1
                            animname: TowerDoorOpen1
                            cmds:
                              - setforewards
                              - continue
                        waiton: 0
                      - type: animcmdmsg
                        params:
                            receivers:
                              - 006D:TowerButtonShot1
                            animname: emptyRotate1
                            cmds:
                              - setforewards
                              - continue
                        waiton: 0
                      - type: animcmdmsg
                        params:
                            receivers:
                              - 006D:TowerDoor2
                            animname: TowerDoorOpen2
                            cmds:
                              - setforewards
                              - continue
                        waiton: 0
                      - type: animcmdmsg
                        params:
                            receivers:
                              - 006D:TowerButtonShot2
                            animname: emptyRotate2
                            cmds:
                              - setforewards
                              - continue
                        waiton: 0
                    nextstate: 0
                    waittocmd:
                      - key: 0
                        msg: 0
                curstate: 0
                flags:
                  - detecttrigger
          - type: responder
            name: CloseBothDoors1
            responder:
                states:
                  - cmds:
                      - type: oneshotmsg
                        params:
                            receivers:
                              - oneshotmod:TowerButtonShot1  #<seek point name>
                            callbacks:
                              - marker: "DoorButtonTouch"  #<avatar animation marker name>
                                receiver: respondermod:CloseBothDoors  #<responder name>
                                user: 0
                        waiton: -1
                      - type: animcmdmsg
                        params:
                            receivers:
                              - 006D:TowerDoor1
                            animname: TowerDoorOpen1
                            cmds:
                              - setbackwards
                              - continue
                        waiton: 0
                      - type: animcmdmsg
                        params:
                            receivers:
                              - 006D:TowerButtonShot1
                            animname: emptyRotate1
                            cmds:
                              - setbackwards
                              - continue
                        waiton: 0
                      - type: animcmdmsg
                        params:
                            receivers:
                              - 006D:TowerDoor2
                            animname: TowerDoorOpen2
                            cmds:
                              - setbackwards
                              - continue
                        waiton: 0
                      - type: animcmdmsg
                        params:
                            receivers:
                              - 006D:TowerButtonShot2
                            animname: emptyRotate2
                            cmds:
                              - setbackwards
                              - continue
                        waiton: 0
                    nextstate: 0
                    waittocmd:
                      - key: 0
                        msg: 0
                curstate: 0
                flags:
                  - detecttrigger


TowerDoor2:
    animations:
      - name: TowerDoorOpen2
        autostart: 0
        loop: 0

TowerButtonShot1:  #<seek point object>:  #the empty
   animations:
     - name: emptyRotate1
       autostart: 0
       loop: 0
   logic:
        actions:
          - type: oneshot
            name: TowerButtonShot1
            oneshot:
                animation: DoorButtonTouch

Re: Could have been two rotating doors..

PostPosted: Tue Sep 30, 2008 8:17 am
by Tinuviel
Thanks again, D'Lanor. I used that script when I had the button. But I thought I HAD to use a button for it to work. So I deleted everything when I took away the button :oops:
I think I have to ask Boblishman if I can use his signature. Seems like it fits me perfectly :P