Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

override + walk

Tony21 Jonesford
Registered User
Join date: 17 Sep 2007
Posts: 16
09-22-2007 18:46
Hi

I try to override the walk animation

I write this script

integer have_permissions = FALSE;
string anim = "Tufif Walk 4 (copy only)";

default
{
state_entry()
{
if (!have_permissions)
{
llRequestPermissions(llGetOwner(),
PERMISSION_TRIGGER_ANIMATION| PERMISSION_TAKE_CONTROLS);
}
}

attach(key attachedAgent)
{
//
// If attached/detached from agent, change behavior
//
if (attachedAgent != NULL_KEY)
{
// Bow has been attached or rezzed from inventory, so
// ask for needed permissions.
llRequestPermissions(llGetOwner(),
PERMISSION_TRIGGER_ANIMATION| PERMISSION_TAKE_CONTROLS);
}
else
{
// Bow has been detached from avatar, so stop animation and release controls
if (have_permissions)
{
llStopAnimation(anim);

llReleaseControls();
have_permissions = FALSE;
}
}
}

run_time_permissions(integer permissions)
{
if (permissions == PERMISSION_TRIGGER_ANIMATION| PERMISSION_TAKE_CONTROLS)
{
llTakeControls(CONTROL_FWD, TRUE, FALSE);

have_permissions = TRUE;
}

}

control(key name, integer levels, integer edges)
{

if( (edges & levels & CONTROL_FWD) == CONTROL_FWD)
{

llStartAnimation(anim);
}

if( (levels & CONTROL_FWD) == CONTROL_FWD)
{

}

if( (edges & ~levels & CONTROL_FWD) == CONTROL_FWD)
{
llStopAnimation(anim);

}


}


}


I start my animation but my avatar don't move.

How to move my avatar? And where in the script?

thanks
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
09-22-2007 19:28
Probably want the last argument to llTakeControls() to be TRUE, unless the plan is to do some special motion in addition to overriding the anim. May want to just pick up a ZHAO or Franimation overrider in-world for an example script from which to start (although, for a walk AO, they're kinda overkill).