'kickable' doors

If you feel like you're up to the challenge of building your own Ages in Blender or 3ds Max, this is the place for you!

Re: 'kickable' doors

Postby andylegate » Tue Jul 27, 2010 5:50 am

Ah ha! Thanks D'Lanor, you just helped me figure out what's wrong with one of my Doors in a new Age I'm working on!

Disabling and Enabling the responders is not that hard with Cyan's plugin, but I'm not sure how you'd do it with ALCScript. Here's a pic:

Image

This is one of my levers in Neolbah. As you can see, the clickproxy has 2 responders assigned to it, "psw2respA" and "psw2respB"
If you look where I've circled in green, the check mark says to enable the responder (it's defaulted with it there). If you remove the check mark, the the responder's default state is NOT enabled.
If you look, where the state is highlighted in blue, is a command to Enable/Disable a responder. I know it says "Enabled" but where the actual Enable/Disable takes place is down where I've circled in red, you click on the button and select the responder you want to affect, and then again, you have a checkmark in the box it will enable the responder or (as in my case here) no checkmark means the responder is disabled. As you can see in the State box, I'm enabling and disabling sever responders for the other switches.

That's something else I have no idea how to do with ALCScript: having more than one State for a responder. Here you can tell the responder that once it's performed all it's commands to proceed to State 2, where it will have other commands (and you can keep going, have State 3, 4, etc, etc) or you can have it revert back to it's first State.

Don't get me wrong, I'm not knocking ALCScripting. As a mater of fact, having spent so much time working with it, it made me understand Cyan's plugin better actually.
"I'm still trying to find the plKey for Crud!"
Image
Blender Age Creation Tutorials
3DS Max Age Creation Tutorials
User avatar
andylegate
 
Posts: 2348
Joined: Mon Oct 01, 2007 7:47 am

Re: 'kickable' doors

Postby D'Lanor » Tue Jul 27, 2010 7:29 am

By the looks of that screenshot Cyan's plugin also disables the activator for that particular responder, not the responder itself.

A simple multi-state responder in AlcScript would look like this:

Code: Select all
          - type: responder
            responder:
                states:
                  - cmds:
                      - type: soundmsg
                        params:
                            receivers:   
                              - 0011:MySoundemitter
                            cmds:
                              - play
                              - setvolume
                            volume: 1.0
                        waiton: -1
                    nextstate: 1
                    waittocmd: 0
                  - cmds:
                      - type: soundmsg
                        params:
                            receivers:
                              - 0011:MySoundemitter
                            cmds:
                              - stop
                        waiton: -1
                    nextstate: 0
                    waittocmd: 0
                curstate: 0
                flags:
                  - detecttrigger

This is pretty much what the old broken soundregion quickscript did before I somewhat improved it. Multi-state responders usually are not very reliable in a multiplayer environment if you don't use SDL states or at least some Python to control them.

The "nextstate" parameter must be what Cyan calls "At end, switch to state" in your screenshot.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: 'kickable' doors

Postby D'Lanor » Tue Jul 27, 2010 9:06 am

And here is Andy's concept applied to Justin's door:

Code: Select all
LDoorReg:
    logic:
        modifiers:
          - name: Enter_Door_Rgn
            flags:
              - multitrigger
            activators:
              - type: objectinvolume
                triggers:
                  - enter
            conditions:
              - type: volumesensor
                satisfied: true
                direction: enter
            actions:
              - type: responder
                ref: :DoorOpen
          - name: Exit_Door_Rgn
            flags:
              - multitrigger
            activators:
              - type: objectinvolume
                triggers:
                  - exit
            conditions:
              - type: volumesensor
                satisfied: true
                direction: exit
            actions:
              - type: responder
                ref: :DoorClose

Door1:
    animations:
        - name: DoorAnime
          autostart: 0
          loop: 0
    logic:
        actions:
          - type: responder
            name: DoorOpen
            responder:
                states:
                  - cmds:
                      - type: animcmdmsg
                        params:
                            receivers:
                             - 006D:Door1
                           animname: DoorAnime
                           cmds:
                             - setforewards
                             - continue
                        waiton: -1
                      - type: enablemsg
                        params:
                            receivers:
                              - logicmod:Enter_Door_Rgn
                            cmds:
                              - physical
                              - disable
                        waiton: -1
                      - type: enablemsg
                        params:
                            receivers:
                              - logicmod:Exit_Door_Rgn
                            cmds:
                              - physical
                              - enable
                        waiton: -1
                    nextstate: 0
                    waittocmd: 0
                curstate: 0
                flags:
                  - detecttrigger
          - type: responder
            name: DoorClose
            responder:
                states:
                  - cmds:
                      - type: animcmdmsg
                        params:
                            receivers:
                             - 006D:Door1
                           animname: DoorAnime
                           cmds:
                             - setbackwards
                             - continue
                        waiton: -1
                      - type: enablemsg
                        params:
                            receivers:
                              - logicmod:Enter_Door_Rgn
                            cmds:
                              - physical
                              - enable
                        waiton: -1
                      - type: enablemsg
                        params:
                            receivers:
                              - logicmod:Exit_Door_Rgn
                            cmds:
                              - physical
                              - disable
                        waiton: -1
                    nextstate: 0
                    waittocmd: 0
                curstate: 0
                flags:
                  - detecttrigger


Actually you don't need multiple regions or multi-state responders in Blender. Yeah, AlcScript is so much better. :lol:
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: 'kickable' doors

Postby Justintime9 » Tue Jul 27, 2010 9:16 am

Ok. I think I know roughly what Andy is saying, but not quite sure how to implement it. To clarify, here's the situation with my door: There is a tiny room that you link into. on one wall is the door. In order to give the illusion that the avatar is pushing it, the region is very close to the door. When the avatar opens the door, it will remain open until the avatar leaves the region.

However, due to the fact that I plan to give the illusion of pushing the door open, the door closing all by itself is unrealistic. With the "close" region I planned to put it where the door is located when open, so that the player must simply run up against the door to close it.

There is a flaw in this however, even if I pull it off: Once the door is closed there is no other way of getting into the room and activating the "open" animation, so the player is pretty much barred from that room until he re-links. Of course the only realistic way of fixing this is to make the avi pull the door open; something that no doubt would be a real pain in the neck.

Therefore I have two options: I can scale the single region to engulf the whole age except the link in room, so that it only closes when the avi enters the link-in room. OR I can create two regions and have the problem of it being stuck closed until re-linking. The prevalent problem either way is that the door will close all by itself if re-entering the link-in room.

Hopefully this provides a better picture of what I'm trying to do, and the problems that are there.

Edit: thanks for that D'lanor, I'll try that out as soon as I can.
User avatar
Justintime9
 
Posts: 1188
Joined: Sat Sep 29, 2007 5:37 am

Re: 'kickable' doors

Postby Justintime9 » Tue Jul 27, 2010 9:55 am

Ok, I put in that AlcScript over the old one and I don't see any difference. It still opens when I walk into it, and closes when I leave the region. Is there something I have to change in it to accomplish what I'm trying to do?
User avatar
Justintime9
 
Posts: 1188
Joined: Sat Sep 29, 2007 5:37 am

Re: 'kickable' doors

Postby D'Lanor » Tue Jul 27, 2010 10:26 am

It should not look any different unless you are in a multiplayer environment. :)

I posted before you wrote your clarification. It seems you want something different than you originally asked about.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: 'kickable' doors

Postby Justintime9 » Tue Jul 27, 2010 10:42 am

Ah, I see. That's great then, glad it's multiplayer compatible. I probably wasn't too clear the first time. Is there a way to accomplish what I want? If things get too complicated I could always just explain the behavior of the door in the commentary journal so it makes sense IC.
User avatar
Justintime9
 
Posts: 1188
Joined: Sat Sep 29, 2007 5:37 am

Re: 'kickable' doors

Postby Justintime9 » Fri Aug 13, 2010 5:59 am

Ok. I've had the one door working successfully for some time now. However, now I've created a new door, and the original door has completely ceased to work. Here's the original door script:

Code: Select all
LDoorReg:
    logic:
        modifiers:
          - name: Enter_Door_Rgn
            flags:
              - multitrigger
            activators:
              - type: objectinvolume
                triggers:
                  - enter
            conditions:
              - type: volumesensor
                satisfied: true
                direction: enter
            actions:
              - type: responder
                ref: :DoorOpen
          - name: Exit_Door_Rgn
            flags:
              - multitrigger
            activators:
              - type: objectinvolume
                triggers:
                  - exit
            conditions:
              - type: volumesensor
                satisfied: true
                direction: exit
            actions:
              - type: responder
                ref: :DoorClose

Door1:
    animations:
        - name: DoorAnime
          autostart: 0
          loop: 0
    logic:
        actions:
          - type: responder
            name: DoorOpen
            responder:
                states:
                  - cmds:
                      - type: animcmdmsg
                        params:
                            receivers:
                             - 006D:Door1
                            animname: DoorAnime
                            cmds:
                             - setforewards
                             - continue
                        waiton: -1
                      - type: enablemsg
                        params:
                            receivers:
                              - logicmod:Enter_Door_Rgn
                            cmds:
                              - physical
                              - disable
                        waiton: -1
                      - type: enablemsg
                        params:
                            receivers:
                              - logicmod:Exit_Door_Rgn
                            cmds:
                              - physical
                              - enable
                        waiton: -1
                    nextstate: 0
                    waittocmd: 0
                curstate: 0
                flags:
                  - detecttrigger
          - type: responder
            name: DoorClose
            responder:
                states:
                  - cmds:
                      - type: animcmdmsg
                        params:
                            receivers:
                             - 006D:Door1
                            animname: DoorAnime
                            cmds:
                             - setbackwards
                             - continue
                        waiton: -1
                      - type: enablemsg
                        params:
                            receivers:
                              - logicmod:Enter_Door_Rgn
                            cmds:
                              - physical
                              - enable
                        waiton: -1
                      - type: enablemsg
                        params:
                            receivers:
                              - logicmod:Exit_Door_Rgn
                            cmds:
                              - physical
                              - disable
                        waiton: -1
                    nextstate: 0
                    waittocmd: 0
                curstate: 0
                flags:
                  - detecttrigger



Here's my new door script:


Code: Select all
QDoorReg:
    logic:
        modifiers:
          - name: Enter_Door_Rgn
            flags:
              - multitrigger
            activators:
              - type: objectinvolume
                triggers:
                  - enter
            conditions:
              - type: volumesensor
                satisfied: true
                direction: enter
            actions:
              - type: responder
                ref: :DoorOpen
          - name: Exit_Door_Rgn
            flags:
              - multitrigger
            activators:
              - type: objectinvolume
                triggers:
                  - exit
            conditions:
              - type: volumesensor
                satisfied: true
                direction: exit
            actions:
              - type: responder
                ref: :DoorClose

QuarryDoor:
    animations:
        - name: QDoorAnime
          autostart: 0
          loop: 0
    logic:
        actions:
          - type: responder
            name: DoorOpen
            responder:
                states:
                  - cmds:
                      - type: animcmdmsg
                        params:
                            receivers:
                             - 006D:QuarryDoor
                            animname: QDoorAnime
                            cmds:
                             - setforewards
                             - continue
                        waiton: -1
                      - type: enablemsg
                        params:
                            receivers:
                              - logicmod:Enter_Door_Rgn
                            cmds:
                              - physical
                              - disable
                        waiton: -1
                      - type: enablemsg
                        params:
                            receivers:
                              - logicmod:Exit_Door_Rgn
                            cmds:
                              - physical
                              - enable
                        waiton: -1
                    nextstate: 0
                    waittocmd: 0
                curstate: 0
                flags:
                  - detecttrigger
          - type: responder
            name: DoorClose
            responder:
                states:
                  - cmds:
                      - type: animcmdmsg
                        params:
                            receivers:
                             - 006D:QuarryDoor
                            animname: QDoorAnime
                            cmds:
                             - setbackwards
                             - continue
                        waiton: -1
                      - type: enablemsg
                        params:
                            receivers:
                              - logicmod:Enter_Door_Rgn
                            cmds:
                              - physical
                              - enable
                        waiton: -1
                      - type: enablemsg
                        params:
                            receivers:
                              - logicmod:Exit_Door_Rgn
                            cmds:
                              - physical
                              - disable
                        waiton: -1
                    nextstate: 0
                    waittocmd: 0
                curstate: 0
                flags:
                  - detecttrigger


If the scripts aren't the problem I don't know what it is, because both doors and regions have the same properties as they should, and I didn't change the original door at all, so I don't know why it'd just stop working :P.
User avatar
Justintime9
 
Posts: 1188
Joined: Sat Sep 29, 2007 5:37 am

Re: 'kickable' doors

Postby D'Lanor » Fri Aug 13, 2010 8:22 am

You are using the same names for both doors. Names must be unique.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: 'kickable' doors

Postby Justintime9 » Fri Aug 13, 2010 9:55 am

What do you mean? My original door is called "Door1" and the other door is called "QuarryDoor".
User avatar
Justintime9
 
Posts: 1188
Joined: Sat Sep 29, 2007 5:37 am

PreviousNext

Return to Building

Who is online

Users browsing this forum: No registered users and 1 guest