Triggering animation

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!

Re: Triggering animation

Postby ardent red » Mon Aug 11, 2008 4:17 am

This paging method, if used in a multiplayer environment will break uru to the point that it will probably crash in many cases.


When Innocent Programming Goes Bad... coming soon to a shell near you (with MORE to come after that).

Also, if I have lots of objects which are animated at different times will this affect the lag - or is lag more to do with numbers of faces and numbers of simultaneous animations??

I'm pretty sure that if you play an insane amount of animations at once, the game will freeze up with lag or crash completely- an example of this would be (MORE/MOUL) Ae'gura filled to the brim with /dance-ing avatars, which you may have been unfortunate enough to encounter during Live >.>. It would be unlikley that you'd play enough animations at once to cause that amount of lag. Lag can also be caused by too many vertices, as you said. It's really about how much stuff, be it physics, lighting or animation, has to be computed (and/or sent over the internet) at a time by the server, and how fast that information can be interpreted. The more info, the laggier it gets.
ardent red
 
Posts: 150
Joined: Fri Apr 18, 2008 3:41 pm
Location: The big little New Zealand

Re: Triggering animation

Postby ekimmai » Mon Aug 11, 2008 5:09 am

To prove how helpful you've all been here is an update on my animation efforts: :P

I've had great success in getting the animation to start as my avatar approaches a certain point - the floor opens up, lights come on etc - works great! Minimal lagging during door animation but perhaps due to lots of simultaneously rotating wheels and quite a few faces to give good realism (-may eventually have to simplify things for performance sake). I used the idea of an animated trigger region so that this region itself rises out of reach once trigger initiated - hence no problems with resetting of the floor-opening animation (Thanks for the suggestion re this!). One of my next steps is to add some sound which I've not attempted before. Time to trawl the internet for some decent free mechanical-sound files......

One anomaly: When my door closes again (animations running backwards) the various components (lock system) all seem to start moving right away and not in the proper reverse chronological order. Do the "waiton" values need to be something different for the backwards phase? Otherwise I'll just have to prevent the door being closed from the same side which would be a shame.

Didn't really understand the post re global and non-global avatar animations: what is the difference?

One other non-related question: I added a lampshade with the Twoside option turned on in order to get texture on both inside and outside of the shade - but never seems to work. Managed fine to apply double-sided texture to a wall though. Is there a second option that needs to be on? I have used UV etc.

Appreciate the help,
Ekimmai
ekimmai
 
Posts: 79
Joined: Mon Apr 14, 2008 5:04 am
Location: Winchester, UK

Re: Triggering animation

Postby Jojon » Mon Aug 11, 2008 7:01 am

When using the "Texture Face" tab, the twoside flag is only set for the single currently active face, so you'll have to copy it to all the faces that you may have in secondary selection, by pressing ctrl-C (over the 3D view) and picking copy active mode.

Another useful thing, that used to be available under UV-select mode, is rotate- and mirror UV-coordinates -- these can now be found under "face specials" ( ctrl-F ). Actually, I just noticed that if you set the twoside- etc flags, using the "Face mode set" item in this menu, they WILL be applied to all selected faces, right away - yay!
Jojon
 
Posts: 1116
Joined: Sun Sep 30, 2007 5:49 am

Re: Triggering animation

Postby ekimmai » Mon Aug 11, 2008 8:36 am

Sounds simple enough, thanks Jojon.

And there I was highlighting ALL the faces and thinking Twoside would then apply to every one....
(doh! :roll: must have forgotten I was using Blender for a moment!)

E
ekimmai
 
Posts: 79
Joined: Mon Apr 14, 2008 5:04 am
Location: Winchester, UK

Re: Triggering animation

Postby ardent red » Tue Aug 12, 2008 12:28 am

Didn't really understand the post re global and non-global avatar animations: what is the difference?


From what I understand, a global animation is a general animation with no single use, eg. climbing, sitting, dancing. These animations are gloabl in the sense that they are hard-coded into every age, so can be used anywhere.

A non-global animation is an animation with a specific purpose which has been designed for one age, like the exit water animation in Ahnonay sphere 1, and which has only been coded into that particular age. The script which Grogyan pointed out allows you to use non-global animations in your ages other than the origianl non-global age. The only problem is working out which anim you require.
ardent red
 
Posts: 150
Joined: Fri Apr 18, 2008 3:41 pm
Location: The big little New Zealand

Re: Triggering animation

Postby Grogyan » Tue Aug 12, 2008 2:47 am

ardent red wrote:
Didn't really understand the post re global and non-global avatar animations: what is the difference?


From what I understand, a global animation is a general animation with no single use, eg. climbing, sitting, dancing. These animations are gloabl in the sense that they are hard-coded into every age, so can be used anywhere.

A non-global animation is an animation with a specific purpose which has been designed for one age, like the exit water animation in Ahnonay sphere 1, and which has only been coded into that particular age. The script which Grogyan pointed out allows you to use non-global animations in your ages other than the origian non-global age. The only problem is working out which anim you require.


That is correct, though I err on the side of caution till I hear from Cyan whether we can use non global animations as "semi" global in MORE, for example exiting a pool of water without a ladder or stairs, the tumble roll that you get when you've returned all 4 pillars and jumped into the fissure

I simply put that in for you to get an idea of what you want to achieve.

Unless you want to trigger an animation that you have created, in which case that code would be next to useless, you can still try and play with it and see if it does what you want

On a side note I have also noticed that in the SVN there is a quickscript to execute a animation, though I havn't tried it yet
Better to have loved and lost than never to have loved at all
User avatar
Grogyan
 
Posts: 1203
Joined: Thu Oct 11, 2007 1:27 am

Re: Triggering animation

Postby D'Lanor » Tue Aug 12, 2008 2:55 am

ekimmai wrote:One anomaly: When my door closes again (animations running backwards) the various components (lock system) all seem to start moving right away and not in the proper reverse chronological order. Do the "waiton" values need to be something different for the backwards phase? Otherwise I'll just have to prevent the door being closed from the same side which would be a shame.

They are the same for the backwards phase. None of the examples here has a waiton set though. The value -1 means no waiting. I have used waiton for oneshot messages (avatar animations) but not for any other animations yet. I imagine it would work the same way though. You need to set up a callback message.

Here is an example adapted from this wiki article, that makes an animation wait for an avatar animation. You have to set waiton for the next animation to 0.

Code: Select all
<object>:
    logic:
        actions:
          - type: responder
            name: <responder name>
            responder:
               states:
                - cmds:
                   - type: oneshotmsg
                     params:
                        receivers:
                         - oneshotmod:<empty avatar animation target>
                        callbacks:
                         - marker: <avatar animation>
                           receiver: respondermod:<responder name>
                           user: 0
                     waiton: -1
                   - type: animcmdmsg
                     params:
                        receivers:
                         - 006D:<animated object>
                        animname: <animation name>
                        cmds:
                         - setforewards
                         - continue
                     waiton: 0
                  nextstate: 1
                  waittocmd:
                    - key: 0 #cmds with waiton of 0
                      msg: 0 #wait for callback for user 0
               curstate: 0
               flags:
                 - detecttrigger


<empty avatar animation target>:
   logic:
       actions:
          - type: oneshot
            name: <oneshot name> #same as empty avatar animation target
            oneshot:
                animation: <avatar animation>


I am not sure if the receiver should be the <empty avatar animation target> or the <oneshot name> but if we keep them the same like the wiki example does we can avoid that choice. ;)
"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: Triggering animation

Postby ekimmai » Tue Aug 12, 2008 4:35 am

Thanks for all the contributions and the clarification re global animations.

D'Lanor, I think I am already using callbacks as I have just adapted original oneshot code but I'll have to recheck on that when I am next using Blender.

Spent a while last night trying to apply the Twosided texture to a lampshade: Used Ctr-C to copy Twoside from active face to secondary-selected faces (so that each of those also shows as Twoside if I make it active) - but when I export and enter the age I can still only see the outside of the object. I've applied UV wrapping (else Twoside option vanishes) and deleted and reapplied textures etc but nothing makes the slightest difference. Screenshot below might not help much.

twoside.jpg
twoside.jpg (69.92 KiB) Viewed 4092 times
ekimmai
 
Posts: 79
Joined: Mon Apr 14, 2008 5:04 am
Location: Winchester, UK

Re: Triggering animation

Postby Jojon » Tue Aug 12, 2008 6:35 am

Hmm, odd... What if you also set "Shared" (..as in "use the same texture on both sides")? I don't believe we need that one, but maybe..?
Jojon
 
Posts: 1116
Joined: Sun Sep 30, 2007 5:49 am

Re: Triggering animation

Postby D'Lanor » Tue Aug 12, 2008 7:39 am

On the subject of callback messages, I could not get them working for object animations. And glancing at the PyPRP code I get the impression that this feature has only been implemented for oneshot messages.
"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

PreviousNext

Return to Building

Who is online

Users browsing this forum: No registered users and 0 guests