|
Doctor Pidgeon
Registered User
Join date: 21 Dec 2006
Posts: 6
|
02-19-2007 09:34
Hi i've got a thew Qs regarding the scripting system of SL:
1. Can we assign & trigger scripts on avatars directly? in other words is it objects that can only be assigned scripts and triggered on.
2. Is it possible to start an animation which is not predefined, animations which are in the avatar's inventory list? the reason i ask is i do not see such functionaility exposed to scripts. llStartAnimation only takes predefined strings.
Thanks in advance.
|
|
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
|
02-19-2007 11:33
I'll try to answer those . . .
1. A script must reside in an object of some sort, which may or may not be attached to an avatar. There is some limited capacity to act upon the avatar, such as an animation, but for the large part, I guess the answer is no.
2. As far as I am aware, scripts cannot access the avatar's own inventory. llStartAnimation, as you say, uses a particular string. BUT, that string may be loaded by searching the inventory of the prim which contains the script, ie, it does not need to be defined IN the script. This allows for the addition or customization of animations without changing a script.
Baron H.
|
|
Doctor Pidgeon
Registered User
Join date: 21 Dec 2006
Posts: 6
|
02-20-2007 01:45
Baron thank you for the clarification, with the second question i'm not sure i fully understood what you where saying, did you mean you could give a string which contains the name of some animation in an object/entity's inventory list? also when you say "string maybe loaded" do you mean there is some global string property which can override the llStartAnimation function's behaviour of only accepting predefined strings? or will llStartAnimation accept other names contained in an object's inventory list? Maybe if i mention what it is i'm trying to do it might help others to help me  Basically second life has a limit of 30 seconds for custom animations (as far as i'm aware, i do not know for sure) so what i would like to do is write a script which triggers multiple animations in sequence (i.e. one after another) instead of manually doing it by hand.
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
02-20-2007 02:34
From: Doctor Pidgeon Baron thank you for the clarification, with the second question i'm not sure i fully understood what you where saying, did you mean you could give a string which contains the name of some animation in an object/entity's inventory list? also when you say "string maybe loaded" do you mean there is some global string property which can override the llStartAnimation function's behaviour of only accepting predefined strings? or will llStartAnimation accept other names contained in an object's inventory list? Maybe if i mention what it is i'm trying to do it might help others to help me  Basically second life has a limit of 30 seconds for custom animations (as far as i'm aware, i do not know for sure) so what i would like to do is write a script which triggers multiple animations in sequence (i.e. one after another) instead of manually doing it by hand. You can either give it the name directly as in string MyAnimationName = "Some Animation thats in object Inventory"; or, you can us the llGetInventoryName function to cycle through the objects inventory and dynamically obtain a name. integer index = llGetInventoryNumber(INVENTORY_ANIMATION); while(index >= 0) { string name = llGetInventoryName(INVENTORY_ANIMATION, inex); --index; }
As for stringing animation together that is indeed possible, just use a timer to stop the current and trigger the next animation. If your animations are of different durations then you will need to have some form of lookup, notecard or encoded into the animation name, to allow you to know how long to set the timer for. You will also need to make sure that the transition from one to the next looks ok, ideally have a end - start sequence that matches nicely. Artemis Winthrope produces a Yoga mat which I have scripted to do this.
|
|
Doctor Pidgeon
Registered User
Join date: 21 Dec 2006
Posts: 6
|
02-20-2007 03:02
Great guys, much appreciated thanks.
|