Page 1 of 1

Avatar animation in a subworld

PostPosted: Wed Oct 08, 2008 5:37 am
by Frits
When the avatar push a button in the subworld the callback does not work. The subworld start moving immediately while the avatar has not pushed the button yet.
Is it not possible to have a kind of wait command in AlcScript, lets say "wait: 3" (wait here for 3 seconds) or something like that?

Regards,
Frits

Re: Avatar animation in a subworld

PostPosted: Wed Oct 08, 2008 6:09 am
by boblishman

Re: Avatar animation in a subworld

PostPosted: Wed Oct 08, 2008 6:34 am
by Frits
Thanks, I have seen that topic, but that is not the solution to the problem.

Re: Avatar animation in a subworld

PostPosted: Wed Oct 08, 2008 7:31 am
by GPNMilano
Frits, are you using quickscripts or a full script for the animation? If you're using quickscripts and the buttontouch animation your animation won't work properly. You need to set a callback to wait for the avatar to finish the animation. which requires a full alcscript and the proper callback name to work.

Re: Avatar animation in a subworld

PostPosted: Wed Oct 08, 2008 7:46 am
by Frits
Thanks, I have a full AlcScript for the animation.
I have solved the problem for the first part; I did not set a waiton to 0. So now the start is ok, but when I want to return, the animation of the avatar works, only the platform won't move anymore.

I use the following script for the button and 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

Lift:
   type: subworld
   animations:
     - name: AnimLift
      autostart: 0
      loop: 0
   
LiftFloor:
   physical:
      subworld: Lift
   logic:
      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: 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:MoveFloor
                        user: 0
                  waiton: -1
                 - type: animcmdmsg
                  params:
                     receivers:
                       - 006D:Lift
                     animname: AnimLift
                     cmds:
                       - setbackwards 
                            - continue
                  waiton: 0
                 - type: soundmsg
                  params:
                     receivers:
                       - 0011:LiftButtonSndEm
                     cmds:
                       - play
                       - setvolume
                     volume: 1
                  waiton: -1
               nextstate: 0
               waittocmd:
                 - key: 0
                  msg: 0
            curstate: 0
            flags:
              - detecttrigger



I think there is a mistake somewere, but I can't find it.

Regards,
Frits

Re: Avatar animation in a subworld

PostPosted: Wed Oct 08, 2008 7:57 am
by D'Lanor
receiver: respondermod:MoveFloor

I think that should be MoveLift.

Re: Avatar animation in a subworld

PostPosted: Wed Oct 08, 2008 8:12 am
by Frits
Thanks D'Lanor, that was the mistake I overlooked like a thousend times, but now it works like a charm.
Now I have to figure out why I don't hear the sound of the button.

Regards,
Frits

Re: Avatar animation in a subworld

PostPosted: Thu Oct 09, 2008 5:26 am
by Frits
After spending a couple of hours trying to get the click sound for the button audible, I still don't hear anything.
I made an empty (LiftButtonSndEm) near the button, parented it to the lift empty and made an AlcScript for it;
Code: Select all
LiftButtonSndEm:
   type: soundemit
   sound:
      flags:
        - is3dsound
      file: click
      volume: 0.55
      mindist: 250
      maxdist: 250
      type: SoundFX
   physical:
      subworld: Lift

(and see the script in an earlier post)

Any ideas why I don't hear the sound?

Regards,
Frits

Re: Avatar animation in a subworld

PostPosted: Thu Oct 09, 2008 10:20 am
by Nadnerb
Spelling/Copy error.

"mindist" and "maxdist" should be "minfdist" and "maxfdist"

Re: Avatar animation in a subworld

PostPosted: Fri Oct 10, 2008 2:52 am
by Frits
Thanks Nadnerb, that was indeed a copy error. But in the same testing area there is a lever with the same error and you can head that sound well. Now I changed both scripts (with f), for the lever it makes no difference, but still no sound for my moving button.

Another idea what could be wrong?

Regards,
Frits

EDIT: Found the problem, I forgot to change the .wav into a .ogg file :oops: :oops: