Second enterregion subworld

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!

Second enterregion subworld

Postby Frits » Wed Oct 08, 2008 6:29 am

For testing I made the following subworld, a platform that can move from the left- to the right position and back after a push on the button;
Image
The selected one is the second enterregion. When you walk into this region, while the platform is still in the position on the left, you will fall through the surface. I there a way to avoid this?
I'm thinking of moving the second region out of reach and make an other button to call the platform and then, after the platform has arived, put the enterregion into place. But I don't think that this is the right solution.
Any advice please?

Regards,
Frits
Frits
 
Posts: 132
Joined: Sun Feb 10, 2008 7:00 am

Re: Second enterregion subworld

Postby Nadnerb » Wed Oct 08, 2008 11:23 am

Generally yes, disabling the entry regions based on the location of the subworld object is the solution that seems to work for now. I thought it might be interesting to parent the entry region to the subworld somehow, but I never did get that to work. >.>

Anyway, what you'd want to do is use an enablemsg to disable the physical on the entrance regions.
Image
Live KI: 34914 MOULa KI: 23247 Gehn KI: 11588 Available Ages: TunnelDemo3, BoxAge, Odema
Nadnerb
 
Posts: 1057
Joined: Fri Sep 28, 2007 8:01 pm
Location: US (Eastern Time)

Re: Second enterregion subworld

Postby Frits » Thu Oct 09, 2008 12:46 am

Nadnerb wrote:use an enablemsg to disable the physical on the entrance regions.


Thanks Nadnerb, but how do I do that, can you give me an example?

Regards,
Frits
Frits
 
Posts: 132
Joined: Sun Feb 10, 2008 7:00 am

Re: Second enterregion subworld

Postby D'Lanor » Thu Oct 09, 2008 4:28 am

Actually you already did that once. Remember the timer to disable the clickable?
"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: Second enterregion subworld

Postby Frits » Thu Oct 09, 2008 5:17 am

Thanks D'Lanor, yes I thought of that but I don't think that is the answer to the problem because the enter region must be deactivated until the platform has arrived. There is no time involved here, it depends on when the avatar calls the platform.

Regards,
Frits
Frits
 
Posts: 132
Joined: Sun Feb 10, 2008 7:00 am

Re: Second enterregion subworld

Postby D'Lanor » Thu Oct 09, 2008 8:13 am

You can use the enablemsg without the timer.
"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: Second enterregion subworld

Postby Frits » Fri Oct 10, 2008 7:35 am

For now I have resolved this by putting doors in front of the enter regions and let them move up after the platform has arrived and move it down before the platform leaves. I think this works nice.

But now, when the avatar is on the right and the platform is on the left, I want to call the platform, so it moves to the right and ofcource the other way around.
I made a button, a oneshotpoint and a region on the left and on the right outside the platform subworld and parented the regions to the doors so they move out of the way when the platform has arrived.

Image

Now I think I am in trouble with the scripting. Any idaes how to do this?

Regards,
Frits
Frits
 
Posts: 132
Joined: Sun Feb 10, 2008 7:00 am

Re: Second enterregion subworld

Postby Frits » Sat Oct 11, 2008 7:37 am

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
Frits
 
Posts: 132
Joined: Sun Feb 10, 2008 7:00 am

Re: Second enterregion subworld

Postby Frits » Sun Oct 12, 2008 2:33 am

Realy, has no one any idea?
I tried the physical part on the buttons, regions, oneshotpoints, and soundemitters, but that makes no difference, the same strange behaviour happens.

Regards,
Frits
Frits
 
Posts: 132
Joined: Sun Feb 10, 2008 7:00 am

Re: Second enterregion subworld

Postby D'Lanor » Sun Oct 12, 2008 4:00 am

Sorry, but I don't see what you are talking about in the script you posted. If you want help I suggest you post the full script.
"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

Next

Return to Building

Who is online

Users browsing this forum: No registered users and 7 guests

cron