Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Getting an animation to change script action

Luke Rasikas
Registered User
Join date: 15 Sep 2006
Posts: 2
09-15-2006 19:57
Hi, I am completly new to scripting, and dont have the foggiest idea as to what I am doing. Anyways, I created some claws that go on my hands and I made an animation for extending claw effect. I want the claws to be invisible on my avatar untill I play my animation and stay there until I play a diffrent animation that would be for retracting the claws. Can anyone help me make a script that could do that or is that even possible. Thanks
Lee Ponzu
What Would Steve Do?
Join date: 28 Jun 2006
Posts: 1,770
Time for a short answer
09-16-2006 07:29
You can add a script to the claws. They start out invisible. They listen for a command in chat from you, such as

/1 claw

When they hear this, the become visible, play the clawing animations...

At this point, they could either retract (invisible again) or wait for you to type some command like

/1 retract

This is an easy script. I am willing to help for free, since it is educational for me. Can't promise when I'd do it though.
Luke Rasikas
Registered User
Join date: 15 Sep 2006
Posts: 2
09-16-2006 08:28
That would be great. I dont even know where to begin with this.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
09-19-2006 05:15
From: Luke Rasikas
That would be great. I dont even know where to begin with this.



try something like this

CODE


integer channel = 1;

ShowHide(integer Show)
{
if(Show == 1)
{
llSetAlpha(1,ALL_SIDES);
llSetStatus (STATUS_PHANTOM, FALSE);
}
else
{
llSetAlpha(0,ALL_SIDES);
llSetStatus (STATUS_PHANTOM, TRUE);
}
}

default
{
state_entry()
{
llListen(channel,"",llGetOwner(),""); //only owner can change it.
}
listen(integer chan, string name, key id, string message)
{
if("claws" == message)ShowHide(0);
else if("retract" == message) ShowHide(1);
}
}


The script could also trigger the animation and play a sound etc.
Lee Ponzu
What Would Steve Do?
Join date: 28 Jun 2006
Posts: 1,770
Typo??
09-19-2006 06:31
if("claws" == message)Show(0);
else if("retract" == message) Show(1);


I think it should be ShowHide()
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
09-19-2006 07:46
OOOPS, you're right. Serves me right for tidying up.