Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

typing AO troubles

Felix Stourmead
Registered User
Join date: 7 Dec 2008
Posts: 6
03-23-2009 22:07
I think ive got the animation set correctly but even if i can keep a still pose when played in world im having trouble overriding the default animation. The animation that im using still is interrupted by the default animation and doesnt stay in a pose while im typing. Heres what ive got so far.

// Adapted from a freebie typing AO script

integer keyboard_status = 0;


default
{
state_entry()
{
llRequestPermissions(llGetOwner(),PERMISSION_TRIGGER_ANIMATION);
}
run_time_permissions(integer mask)
{
if(mask & PERMISSION_TRIGGER_ANIMATION)
{
llSetTimerEvent(0.5);
}
}

attach(key attached)
{
if(attached != NULL_KEY)
{

}
}


timer() {
integer are_we_typing = llGetAgentInfo (llGetOwner()) & AGENT_TYPING;

if (keyboard_status != are_we_typing ) { //keyboard_status changed since last checked?
if (are_we_typing)
{
llStopAnimation("type";);
llStartAnimation("typing override";);
llSetTimerEvent(0.25);
}
else
{
llStopAnimation("type";);
llStopAnimation("typing override";);
llSetTimerEvent(0.5);
}

keyboard_status = are_we_typing;//save the current keyboard_status.
}
}
}

Unfortunately i didnt backup a copy of the original script that i used to make a texture muzzle talk script. So im basicly left with this after modifying. My animation is set to priority 4, loop, in% 100 out %100, hand pose typing. Can anyone help me with this?
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
03-23-2009 22:57
You won't get away with these lines, just remove them and you should be closer to where you want:

llStopAnimation("type";);

Instead, leave the default type animation playing and play yours over it. The reason is that AGENT_TYPING doesn't really tell you if the avatar is typing, it really only checks if the default typing animation is running :o
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
03-24-2009 07:28
you also might want to remove the state entry and move the permission request to the attach event. the state entry only runs once, and as far as i know permissions are released when the object is derezzed. you could however add an on rez event and have it reset the script each times it's rezzed, but for attachments i prefer doing that in the attach event
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Felix Stourmead
Registered User
Join date: 7 Dec 2008
Posts: 6
03-24-2009 16:18
I heard that stoping the default animation just before you play yours helps but i guess it wont in my case. I tested it again only this time my animation is playing in conjunction with the default and it looks like im holding out my right arm and typing with my left and my right arm isnt even held out like in my original animation ><. Ill try some other things but i think im pretty close :).
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
03-24-2009 16:51
From: Felix Stourmead
I heard that stoping the default animation just before you play yours helps but i guess it wont in my case.

Yeah, that advice is handed out a lot, but there are a bunch of exceptions because the defaults have side effects, both server and viewer side. It's utter madness that running animations are part of the protocol, but that's what we have :/