Jump to content
Sign in to follow this  
Clayn Sharkfin

wondering if this is possible or not

Recommended Posts

So i have 2 global string startanimation which holds the value of the animation to play and currentanimation which holds the current animation to play, i am using the second cause i have multiple animations i want to play so i need to start and stop them.

string startanimation = starting_animation;

string currentanimation;

Now within the script i want to have a section where the currentanimation is set with a string value, i then wanna use the currentanimation value within the start animation to point towards startanimation and use that value rather then the output of currentanimation, is that in anyway possible, cause if it is i can't figure out how to.

Share this post


Link to post
Share on other sites

I think we're gonna need to see some script to know specifically what you're trying to do.

You can certainly call llStartAnimation() with an animation name expressed either as a string literal or a string-valued variable. And of course you can set one string variable to the value of another.

(And if the named animation is in the object's inventory (or a built-in), and if the script has PERMISSION_TRIGGER_ANIMATION on the avatar, and the avatar is in the same region, the animation should play.)

It's not clear which part of this is giving you trouble, or what kind of error you're seeing.

Share this post


Link to post
Share on other sites

ok so what i am trying to achieve or do is following il show a example.

string animation = start_animation;

string currentanimation;

Now within the script i want to set the currentanimation with a string value which represents/ equal to animation

currentanimation = "animation";

After i have that set i want to play the Animation

llStartAnimation( currentanimation );

Now my problem is that i need to have the current animation point to start_animation rather then just be string value of animation, cause that doesn't work it only says that animation, animation can't be found in that case.

 

Share this post


Link to post
Share on other sites

if you put "animation" in quotation marks, you set the word "animation" as the value for the currentanimation variable, and not the value of string animation.

Share this post


Link to post
Share on other sites

yeah that is pretty much the issue, my only problem is since i have so many different animations the value i apply needs to be made out of 2 values, which of 1 is a string which seems to be the problem.

Share this post


Link to post
Share on other sites

llStartAnimation only takes a name of a single animation which will be in the objects inventory. I dunno what do you mean by "made out of 2 values" in that context? If you want to play another animation, you will have to do an additional llStartAnimation call.

Share this post


Link to post
Share on other sites

no i mean since my animations are called like ridewalk, riderun etc i was hoping i could use the ride as a string and add avalue behind it which then make it ridewalk, but since it's a string i suppose that doesn't work

Share this post


Link to post
Share on other sites

I see. you can combine strings indeed.

string sWalk = "walk";
string sNewString = "ride"+sWalk;
llOwnerSay(sNewString); will return "ridewalk".

Although, I still dunno how beneficial that would be in the context of playing animations.

  • Like 1

Share this post


Link to post
Share on other sites

string status = "walk";

but there is no way of using string currentanimation = "ride"+walk and then use that as the Play animation value, cause that just gives me no animation found

Share this post


Link to post
Share on other sites

To make it read "ridewalk" it would have to be "ride"+status. And of course there will have to be an animation with the name "ridewalk" in the objects inventory then.

Share this post


Link to post
Share on other sites

something like this perhaps?

string status = "walk"

if (status == "walk")
{
       currentanimation = "name_of_ridewalk_anim";
}

or,

list lAnims = ["walk", "name_of_ridewalk_anim", "run", "name_of_riderun_animation"];
currentanimation = llList2String(lAnims, llListFindList(lAnims, [status]) +1);

Edited by arton Rotaru

Share this post


Link to post
Share on other sites

i think the list version might be the closest to what i want, the reason i wanted something in this style was cause in the old version i felt like i had to repeat the same commands to often, like stop a animation start a new one etc etc, i just wanting something to make it more compact.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...