Page 1 of 2

Callback nightmare

PostPosted: Tue Sep 23, 2008 10:29 am
by boblishman
OK...this is really weird ...

I have a perfectly working synchronised animation using the callback marker ....

Code: Select all
ButtonProxy1:
    visual:
        render: false
    logic:
        modifiers:
          - name: But1ProxLogMod
            cursor: poised
            flags:
              - localelement
            activators:
              - type: objectinvolume
                remote: StonesClickRgn
                triggers:
                  - any
            conditions:
              - type: activator
                activators:
                  - type: picking
              - type: objectinbox
                satisfied: true
            actions:
              - type: pythonfile
                ref: :cPythKeyPad
              - type: responder
                ref: :ButProx1resp
        actions:
          - type: responder
            name: ButProx1resp
            responder:
                states:
                  - cmds:
                      - type: oneshotmsg
                        params:
                            receivers:
                              - oneshotmod:Stone1Oneshot
                            callbacks:
                              - marker: "DoorButtonTouch"
                                receiver: respondermod:ButProx1resp
                                user: 0
                        waiton: -1
                      - type: animcmdmsg
                        params:
                            receivers:
                              - 006D:stonebutton1
                            animname: sbut1move
                            cmds:
                              - setforewards
                              - continue
                        waiton: 0
                      - type: soundmsg
                        params:
                            receivers:
                              - 0011:emit_stonepress
                            cmds:
                              - play
                              - setvolume
                            volume: 1
                        waiton: 0
                    nextstate: 0
                    waittocmd:
                      - key: 0
                        msg: 0
                curstate: 0
                flags:
                  - detecttrigger


and the oneshotmod

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


However, I do NOT want to use that animation ... I want to use "StepOnFloorPlate".

However, if I change the 2 instances of DoorButtonTouch in my script to StepOnFloorPlate ... then the avatar animation plays (he steps on the plate) ... BUT ... the object animation and sound called back by the marker never happen!! :shock: . It doesn't make sense (if the callback markers always have the same name as the animation) ...

Why does it stop working? (or am I missing something really dumb ?)

Re: Callback nightmare

PostPosted: Tue Sep 23, 2008 10:55 am
by D'Lanor
I do see one error but I don't think that could be the cause. You have the waiton states of both the animcmdmsg and the soundmsg set to 0. Only the one that comes first after the callback should be 0.

Re: Callback nightmare

PostPosted: Tue Sep 23, 2008 11:15 am
by boblishman
well...I gave it a try but still no joy :(

if I change them both to "ButtonTouch" (the flat button) it doesn't work either ...the only one that works (perfectly) is "DoorButtonTouch".

Re: Callback nightmare

PostPosted: Tue Sep 23, 2008 4:14 pm
by GPNMilano
Uh oh.

We have a problem now. I checked the animation Prps, the callback markers are not the same as the animation names. For some it is, but for instance: Bob's steponfloorplate, the marker is PlateDown. For DoorButtonTouch its the name of the animation. For ButtonTouch its TouchButton.

The markers aren't the same as the animation names. At least not for every animation.

I'll try and compile a list of which has different marker names.

Re: Callback nightmare

PostPosted: Tue Sep 23, 2008 4:32 pm
by boblishman
OHHH.... Thank you, thank you, thank you ...
I figured as much (nothing else made any sense, hence my comment in the original thread) ... the thing is, I don't know my way around the Prp's, so I couldn't check... :(

The animation & callback are now working PERFECTLY ... (my combination animated keypad is one step closer ... Thanks GPNMilano :))

Re: Callback nightmare

PostPosted: Tue Sep 23, 2008 4:42 pm
by GPNMilano
If I get the chance this week. I'll update the animation page on the wiki with the correct callbacks for Animations that don't use their names for their callbacks. I'm finding a few though that use more than one callback for an animation. (Like the rstrballpuzzle uses the pushball animations. Which have to callback markers for left and right.

Re: Callback nightmare

PostPosted: Tue Sep 23, 2008 5:22 pm
by D'Lanor
Oops indeed... :oops: The quickscript I made takes the animation name for the marker as well. I had no idea that the marker was a property of the avatar animation itself. I can see the inverted string at the end of the ATC Anim now that I know. And all this time I thought this was something we were free to define for our own responders. :(

Re: Callback nightmare

PostPosted: Tue Sep 23, 2008 5:36 pm
by GPNMilano
D'lanor. I'll take the time tomorrow and go through the global animation files and find the callbacks for the animations that don't use their names for their callbacks. I'll post the list to the animations page, along with a note that those animations aren't compatible with the quickscripts at the moment.

Re: Callback nightmare

PostPosted: Tue Sep 23, 2008 5:48 pm
by D'Lanor
Well, I just found out that you don't need to specify a marker. If you specify a non existing one Uru will choke on it but if you just use an empty string "" all will be fine. :)

Edit: Hmm, but that seems to cause some extra delay. My clicksound is running a little late now. Or is it my imagination? :?

Edit 2: Nope, not my imagination. For some animations the marker is definitely set at an optimal point. Conclusion: Use the marker if you can. Otherwise use this (not an empty string like I said before):

Code: Select all
                   - type: oneshotmsg
                     params:
                         receivers:
                           - oneshotmod:<oneshot name>
                         callbacks:
                           - receiver: respondermod:<this responder>
                             user: 0
                     waiton: -1


So that is how the quickscript is going to handle it. If you specify a marker the quickscript will use it, if not it uses the above script.

Re: Callback nightmare

PostPosted: Tue Sep 23, 2008 6:46 pm
by Paradox
As I recall, an empty string will cause the event to fire as soon as the seek is done and the animation starts.

Using a defined callback point will fire at that point.