Page 1 of 1

Need Animation Trigger Help

PostPosted: Tue Mar 01, 2011 8:11 pm
by Calena
Help :( . I've spent a week studying everything I can find on triggering a looping animation and it still won't trigger. The click button region is live, the animation will loop, but when I set loop = 0 and try running the responder script, the animation doesn't start. My code in the first version (Alscript) is:

Code: Select all
CaveDoorButton:
    physical:
        pinned: true
   quickscript:
        simpleclick:
            region: RavenBtnRegion
            animation: DoorButtonTouch
            animtarget: CaveDoorEmpty
            autorun: true

CaveDoorEmpty:
    logic:
        actions:
            - type: oneshot
              name: CaveDoorEmpty
              oneshot:
                animation: DoorButtonTouch

CaveDoor:
   animations:
       - name: CaveDoorOpen
          autostart: 0
          loop: 0
    logic:
        actions:
           - type: responder
              name: DoorOpen1
              responder:
                 states:
                - cmds:
                   - type: oneshotmsg
                 params:
                  receivers:
                   - oneshotmod:CaveDoorEmpty
                   callbacks:
                     - marker: DoorButtonTouch
                     receiver: respondermod:DoorOpen1
                     user: 0
                 waiton: -1
                - type: animcmdmsg
                      params:
                         receivers:
                          - 006D:CaveDoor
                         animname: CaveDoorOpen
                         cmds:
                          - continue
                      waiton: -1
                  nextstate: 0
                  waittocmd: 0
              curstate: 0
              flags:
                 - detecttrigger




I have a second version using quickscript which also doesn't work. The code there is:

Code: Select all
CaveDoorEmpty:
    logic:
        actions:
            - type: oneshot
              name: CaveDoorEmpty
              oneshot:
                animation: DoorButtonTouch

CaveDoor:
   animations:
       - name: CaveDoorOpen
          autostart: 0
          loop: 0
   
   
CaveDoorButton:
    physical:
        pinned: true
   quickscript:
        simpleclick:
            region: RavenBtnRegion
            animation: DoorButtonTouch
            animtarget: CaveDoorEmpty
            autorun: true
      stateanimation:
          objectname: CaveDoorOpen
          region: RavenBtnRegion
          sdlname: CaveDoorVis
          avatar:
             animation: DoorButtonTouch #optional
             animtarget: CaveDoorEmpty #optional
          forewards:
             animation: CaveDoorOpen
          backwards:
             animation: CaveDoorOpen #will be reversed if same as forewards
    


I'm working with Blender 2.49B, GOW PyPRP 1.6.0, Python 2.6.4, 32Bit Windows7. I have created an sdl file, but I've been unsuccessful in compiling the Python file for my age. I'm getting a "magic number" error (wrong version???).

I've downloaded the AvatarAnimations file and it works fine both in Blender and URU. I even tried copying the code from that file into a my age, still didn't work. I'm making a basic error somewhere and I can't find it.

Can someone help?

TIA

Re: Need Animation Trigger Help

PostPosted: Thu Mar 03, 2011 6:08 pm
by Calena
Our help appears busy elsewhere. That happens sometimes. So, in the meantime, I've made some progress, though the door still isn't opening. I know the "bad magic number" error code in PlasmaShop is caused by an incompatible version of Python. I downloaded Version 2.3, which at least helped create a good python file. It still won't pak.

The good news is, I'm using the quickscript and getting much closer to resolving this. Here is my latest export log file from PyPRP:

Code: Select all
[QuickScript - Simple Clickable]
Resulting Code for .logic.modifiers:
- tag: AutoClick
  cursor: poised
  flags:
    - localelement
  activators:
    - type: objectinvolume
      remote: RavenBtnRegion
      triggers:
        - any
  conditions:
    - type: activator
      activators:
        - type: picking
    - type: objectinbox
      satisfied: true
  actions:
    - type: pythonfile
      ref: $AutoClick
    - type: oneshot
      ref: $AutoClick

Resulting Code for .logic.actions:
- type: pythonfile
  tag: AutoClick
  pythonfile:
      file: Try31Grid.py
      parameters:
        - type: activator
          ref: logicmod:$AutoClick
        - type: string
          value: CaveDoorButton
        - type: skip
        - type: skip
        - type: skip
- type: oneshot
  tag: AutoClick
  oneshot:
      animation: DoorButtonTouch
      seektime: 1.0
      remote: CaveDoorEmpty

  [QuickScript - State Animation]
Resulting Code for .logic.modifiers:
- tag: StateAnim
  cursor: poised
  flags:
    - localelement
  activators:
    - type: objectinvolume
      remote: RavenBtnRegion
      triggers:
        - any
  conditions:
    - type: activator
      activators:
        - type: picking
    - type: objectinbox
      satisfied: true
  actions:
    - type: pythonfile
      ref: $BoolToggle

Resulting Code for .logic.actions:
- type: pythonfile
  tag: BoolToggle
  pythonfile:
      file: xAgeSDLBoolToggle
      parameters:
        - type: activator
          ref: logicmod:$StateAnim
        - type: string
          value: DoorOpen
        - type: skip
        - type: skip
        - type: string
          value: QuickScript_StateAnimation
- type: pythonfile
  tag: BoolRespond
  pythonfile:
      file: xAgeSDLBoolRespond
      parameters:
        - type: string
          value: DoorOpen
        - type: responder
          ref: $AnimFW
        - type: responder
          ref: $AnimBW
        - type: bool
          value: false
        - type: bool
          value: true
- type: responder
  tag: AnimFW
  responder:
     states:
       - cmds:
           - type: oneshotmsg
             params:
                 receivers:
                   - oneshotmod:CaveDoorEmpty
                 callbacks:
                   - receiver: respondermod:$AnimFW
                     user: 0
             waiton: -1
           - type: animcmdmsg
             params:
                 receivers:
                   - 006D:CaveDoor
                 animname: CaveDoorOpen
                 cmds:
                   - setforewards
                   - continue
             waiton: 0
         nextstate: 1
         waittocmd:
           - key: 0
             msg: 0
     curstate: 0
     flags:
       - detecttrigger
- type: responder
  tag: AnimBW
  responder:
     states:
       - cmds:
           - type: oneshotmsg
             params:
                 receivers:
                   - oneshotmod:CaveDoorEmpty
                 callbacks:
                   - receiver: respondermod:$AnimBW
                     user: 0
             waiton: -1
           - type: animcmdmsg
             params:
                 receivers:
                   - 006D:CaveDoor
                 animname: CaveDoorOpen
                 cmds:
                   - setbackwards
                   - continue
             waiton: 0
         nextstate: 1
         waittocmd:
           - key: 0
             msg: 0
     curstate: 0
     flags:
       - detecttrigger

Resulting Code for CaveDoorEmpty.logic.actions:
- type: oneshot
  name: CaveDoorEmpty
  oneshot:
      animation: DoorButtonTouch

Quickscripted CaveDoorButton
To: {'quickscript': {'stateanimation': {'backwards': {'animation': 'CaveDoorOpen'}, 'avatar': {'animtarget': 'CaveDoorEmpty', 'animation': 'DoorButtonTouch'}, 'objectname': 'CaveDoor', 'sdlname': 'DoorOpen', 'region': 'RavenBtnRegion', 'forewards': {'animation': 'CaveDoorOpen'}}, 'simpleclick': {'region': 'RavenBtnRegion', 'animation': 'DoorButtonTouch', 'animtarget': 'CaveDoorEmpty', 'pythonfile': 'Try31Grid.py', 'autorun': True}}, 'logic': {'modifiers': [{'cursor': 'poised', 'tag': 'AutoClick', 'flags': ['localelement'], 'activators': [{'type': 'objectinvolume', 'remote': 'RavenBtnRegion', 'triggers': ['any']}], 'conditions': [{'activators': [{'type': 'picking'}], 'type': 'activator'}, {'type': 'objectinbox', 'satisfied': True}], 'actions': [{'type': 'pythonfile', 'ref': '$AutoClick'}, {'type': 'oneshot', 'ref': '$AutoClick'}]}, {'cursor': 'poised', 'tag': 'StateAnim', 'flags': ['localelement'], 'activators': [{'type': 'objectinvolume', 'remote': 'RavenBtnRegion', 'triggers': ['any']}], 'conditions': [{'activators': [{'type': 'picking'}], 'type': 'activator'}, {'type': 'objectinbox', 'satisfied': True}], 'actions': [{'type': 'pythonfile', 'ref': '$BoolToggle'}]}], 'actions': [{'tag': 'AutoClick', 'type': 'pythonfile', 'pythonfile': {'file': 'Try31Grid.py', 'parameters': [{'type': 'activator', 'ref': 'logicmod:$AutoClick'}, {'type': 'string', 'value': 'CaveDoorButton'}, {'type': 'skip'}, {'type': 'skip'}, {'type': 'skip'}]}}, {'type': 'oneshot', 'oneshot': {'seektime': 1.0, 'remote': 'CaveDoorEmpty', 'animation': 'DoorButtonTouch'}, 'tag': 'AutoClick'}, {'tag': 'BoolToggle', 'type': 'pythonfile', 'pythonfile': {'file': 'xAgeSDLBoolToggle', 'parameters': [{'type': 'activator', 'ref': 'logicmod:$StateAnim'}, {'type': 'string', 'value': 'DoorOpen'}, {'type': 'skip'}, {'type': 'skip'}, {'type': 'string', 'value': 'QuickScript_StateAnimation'}]}}, {'tag': 'BoolRespond', 'type': 'pythonfile', 'pythonfile': {'file': 'xAgeSDLBoolRespond', 'parameters': [{'type': 'string', 'value': 'DoorOpen'}, {'type': 'responder', 'ref': '$AnimFW'}, {'type': 'responder', 'ref': '$AnimBW'}, {'type': 'bool', 'value': False}, {'type': 'bool', 'value': True}]}}, {'tag': 'AnimFW', 'type': 'responder', 'responder': {'states': [{'waittocmd': [{'msg': 0, 'key': 0}], 'cmds': [{'type': 'oneshotmsg', 'waiton': -1, 'params': {'callbacks': [{'user': 0, 'receiver': 'respondermod:$AnimFW'}], 'receivers': ['oneshotmod:CaveDoorEmpty']}}, {'type': 'animcmdmsg', 'waiton': 0, 'params': {'animname': 'CaveDoorOpen', 'receivers': ['006D:CaveDoor'], 'cmds': ['setforewards', 'continue']}}], 'nextstate': 1}], 'flags': ['detecttrigger'], 'curstate': 0}}, {'tag': 'AnimBW', 'type': 'responder', 'responder': {'states': [{'waittocmd': [{'msg': 0, 'key': 0}], 'cmds': [{'type': 'oneshotmsg', 'waiton': -1, 'params': {'callbacks': [{'user': 0, 'receiver': 'respondermod:$AnimBW'}], 'receivers': ['oneshotmod:CaveDoorEmpty']}}, {'type': 'animcmdmsg', 'waiton': 0, 'params': {'animname': 'CaveDoorOpen', 'receivers': ['006D:CaveDoor'], 'cmds': ['setbackwards', 'continue']}}], 'nextstate': 1}], 'flags': ['detecttrigger'], 'curstate': 0}}]}, 'physical': {'pinned': True, 'physlogic': 'detect'}}


To think, a week ago I didn't want to touch my URU installation. Now, I'm breaking into everything. Whatever it takes ;) .

Re: Need Animation Trigger Help

PostPosted: Thu Mar 03, 2011 7:04 pm
by Tsar Hoikas
PotS uses Python 2.2. You might want to try that ;)

Re: Need Animation Trigger Help

PostPosted: Fri Mar 04, 2011 5:06 pm
by Calena
Tsar Hoikas wrote:PotS uses Python 2.2. You might want to try that ;)


THANKS! That did the trick. Door still doesn't open, but PlasmaShop compiled my file into the .pak file. One step closer :) .

Re: Need Animation Trigger Help

PostPosted: Sat Mar 05, 2011 1:47 am
by dendwaler
For creating and editing the .pak files i personally prefer using URUPython3.1 above plasmashop.
You can find it in the wiki "tools" somewhat further.
Give it a try.
http://lontahv.googlepages.com/UruPython31.zip

Re: Need Animation Trigger Help

PostPosted: Sun Mar 06, 2011 6:51 pm
by Calena
THE BUTTON WORKS! I'm doing a happy dance :lol: . The timing's a bit off, but I'll get to that.

BTW, the Elf viewer with the Python load file (python.0.elf) is a wonderful thing. It told me exactly what the problem was.