Page 1 of 1

Subworlds: animation states saving problem

PostPosted: Tue Feb 03, 2009 7:04 am
by Corvus
I have to rides in my age (balloon and elevator) and made a sdl, a py.file and modified my alcscript. The animation doesn't "glitch" now any more, but when I link in, the elevator is always in the "up position" and the balloon at the opposite side of where I want it to be when you visit the first time, no matter where I left them. I changed my sdl file, but still the same. Could someone please help me with this?

This is my sdl file:
Code: Select all
STATEDESC Hayal
{
    VERSION 1
   
    VAR BOOL    Ride[1]   DEFAULT=0 DEFAULTOPTION=VAULT
    VAR BOOL    RideUp[1]   DEFAULT=0 DEFAULTOPTION=VAULT

}

STATEDESC Hayal
{
    Version 2
   
    VAR BOOL    Ride[1]   DEFAULT=1 DEFAULTOPTION=VAULT
    VAR BOOL    RideUp[1]   DEFAULT=1 DEFAULTOPTION=VAULT
}


This is my alcscript for the balloon (the one for the elevator is analogue):
Code: Select all
RgnEnterKorb:
   type: region
   regiontype: subworld
   region:
      subworld: SubworldKorb

         
RgnExitKorb:
   type: region
   regiontype: subworld
   region:
      onexit: 1
   physical:
      subworld: SubworldKorb
         
Korb:
   physical:
      subworld: SubworldKorb
    logic:
        modifiers:
          - tag: AutoClick
           cursor: poised
            flags:
              - localelement
            activators:
              - type: objectinvolume
                remote: RgnExitKorb
                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:$AutoClick
                  - type: string
                    value: Ride
                  - type: skip
                  - type: skip
                  - type: string
                    value: Ride
          - type: pythonfile
            tag: BoolRespond
            pythonfile:
                file: xAgeSDLBoolRespond
                parameters:
                  - type: string
                    value: Ride
                  - type: responder
                    ref: $AnimRide
                  - type: responder
                    ref: $AnimRide
                  - type: bool
                    value: false
                  - type: bool
                    value: true
         - type: responder
          tag: AnimRide
          responder:
               states:
                - cmds:
                   - type: animcmdmsg
                     params:
                        receivers:
                         - 006D:SubworldKorb
                        animname: Ride
                        cmds:
                   - setforewards
                         - continue
                waiton: -1
              nextstate: 1
              waittocmd: 0
                - cmds:
                   - type: animcmdmsg
                     params:
                        receivers:
                         - 006D:SubworldKorb
                        animname: Ride
                        cmds:
                   - setbackwards
                         - continue
                waiton: -1
              nextstate: 0
              waittocmd: 0
               curstate: 0
               flags:
                  - detecttrigger       

SubworldKorb:
   type: subworld
   animations:
      - name: Ride
        autostart: 0
        loop: 0

Re: Subworlds: animation states saving problem

PostPosted: Tue Feb 03, 2009 10:07 am
by D'Lanor
Possibly an indentation problem with the - setbackwards and - setforewards commands. They should go 6 positions to the right.

Re: Subworlds: animation states saving problem

PostPosted: Tue Feb 03, 2009 11:06 am
by Corvus
I checked, but in Blender it looks OK.
Image

Would it even work if the indentation were wrong?

I'm completely new to this kind of stuff. Is there anything else I should check?

Re: Subworlds: animation states saving problem

PostPosted: Tue Feb 03, 2009 11:37 am
by D'Lanor
Yes, the Python.0.elf logfile. That should tell you if anything is happening. It can be viewed with the ELF Viewer

Edit: Oh wait. You only have one responder. Cyan's global Python files need two responders. Let me rewrite your script...

Edit 2: Here we are. This should work.

Code: Select all
RgnEnterKorb:
    type: region
    regiontype: subworld
    region:
        subworld: SubworldKorb

         
RgnExitKorb:
    type: region
    regiontype: subworld
    region:
        onexit: 1
    physical:
        subworld: SubworldKorb
         
Korb:
    physical:
        subworld: SubworldKorb
    logic:
        modifiers:
          - tag: AutoClick
            cursor: poised
            flags:
              - localelement
            activators:
              - type: objectinvolume
                remote: RgnExitKorb
                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:$AutoClick
                  - type: string
                    value: Ride
                  - type: skip
                  - type: skip
                  - type: string
                    value: Ride
          - type: pythonfile
            tag: BoolRespond
            pythonfile:
                file: xAgeSDLBoolRespond
                parameters:
                  - type: string
                    value: Ride
                  - type: responder
                    ref: $AnimRideFW
                  - type: responder
                    ref: $AnimRideBW
                  - type: bool
                    value: false
                  - type: bool
                    value: true
          - type: responder
            tag: AnimRideFW
            responder:
                states:
                  - cmds:
                      - type: animcmdmsg
                        params:
                            receivers:
                              - 006D:SubworldKorb
                            animname: Ride
                            cmds:
                              - setforewards
                              - continue
                        waiton: -1
                    nextstate: 1
                    waittocmd: 0
                curstate: 0
                flags:
                  - detecttrigger
          - type: responder
            tag: AnimRideBW
            responder:
                states:
                  - cmds:
                      - type: animcmdmsg
                        params:
                            receivers:
                              - 006D:SubworldKorb
                            animname: Ride
                            cmds:
                              - setbackwards
                              - continue
                        waiton: -1
                    nextstate: 0
                    waittocmd: 0
                curstate: 0
                flags:
                  - detecttrigger       

SubworldKorb:
    type: subworld
    animations:
      - name: Ride
        autostart: 0
        loop: 0

Re: Subworlds: animation states saving problem

PostPosted: Tue Feb 03, 2009 3:23 pm
by Corvus
It works! Thank you so much for your help, D'Lanor! You brought my day to a very happy end.