|
falney Finney
Freedom is just a word
Join date: 18 Dec 2006
Posts: 66
|
01-16-2008 08:00
Hello. Im in the process of scripting a typing AO for my honey but Ive ran into a little problem. Mainly..... It doesnt work.
This is what I have
__________________________________________________
// Type animation and sound names within the quotation marks string anim_name = "PDAtyping"; string sound_name = "PDA";
key kowner;
default { state_entry() { kowner = llGetOwner(); llRequestPermissions(kowner,PERMISSION_TRIGGER_ANIMATION); llSetTimerEvent(0.1); } changed(integer change) { if(change & CHANGED_OWNER) kowner = llGetOwner(); } timer() { if (llGetAgentInfo(kowner & AGENT_TYPING) llStartAnimation(anim_name); llPlaySound(sound_name, 1.0); } }
_____________________________________________________
If I use llDetectedKey instead of llGetOwner it requests permissions to override the avatar's animations but doesn't change the animation. Then if I use llGetOwner it just doesnt do anything.
Any sujestions?
Thanks
_____________________
Self proclaimed Genius
Pessimist is only a name that an optimist calls a realist!
Heterosexuality is just a fancy word for legalized sexism
|
|
Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
|
01-16-2008 08:47
Well, for one thing, you have a blank space interrupting the word ANIMATION in that script. "PERMISSION_TRIGGER_ANI MATION" should be "PERMISSION_TRIGGER_ANIMATION".
_____________________
Sorry, LL won't let me tell you where I sell my textures and where I offer my services as a sim builder. Ask me in-world.
|
|
falney Finney
Freedom is just a word
Join date: 18 Dec 2006
Posts: 66
|
01-16-2008 09:00
I knew that... Honest o  Edit:: Musta' sprang up as I was putting it into the forum.... Going back to my script its not there!
_____________________
Self proclaimed Genius
Pessimist is only a name that an optimist calls a realist!
Heterosexuality is just a fancy word for legalized sexism
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
01-16-2008 09:09
Your 'timer' handler should also be examined closely. The 'if' statement has a syntax error, may be testing the wrong value depending on where the missing right-parenthesis actually is, and will play the sound every time without curly braces on the 'if' statement (I recommend ALWAYS using braces, even for one-line control statements).
|
|
falney Finney
Freedom is just a word
Join date: 18 Dec 2006
Posts: 66
|
01-16-2008 15:24
Hmmm Ive played around with the script and still cant get it working. *blushes* Part of the problem was that little tick box in the bottom left corner! *Snickers*
Heres the updated snippit. _______________________________________________
// Type animation and sound names within the quotation marks string anim_name = "PDAtyping"; string sound_name = "PDA";
key kowner;
default { state_entry() { kowner = llDetectedKey(0);
llRequestPermissions(kowner,PERMISSION_TRIGGER_ANIMATION); llSetTimerEvent(0.1); } changed(integer change) { if(change & CHANGED_OWNER) kowner = llGetOwner(); } timer() { if (llGetAgentInfo(kowner) & AGENT_TYPING) llStartAnimation(anim_name); // llPlaySound(sound_name, 1.0); } }
_______________________________________________
One problem is that the AO doesnt play (One thought is that the animation is too low a priority. Im gonna work on that now but the other problem is that the sound starts playing every .1 second which I can under stand it doing if Im typing But it starts playing the sound even if Im not typing :/
Any idea's?
_____________________
Self proclaimed Genius
Pessimist is only a name that an optimist calls a realist!
Heterosexuality is just a fancy word for legalized sexism
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
01-16-2008 15:52
string anim_name = "PDAtyping"; string sound_name = "PDA";
key kowner;
default { state_entry() { kowner = llDetectedKey(0); llRequestPermissions(kowner,PERMISSION_TRIGGER_ANIMATION); llSetTimerEvent(0.1); } changed(integer change) { if(change & CHANGED_OWNER) kowner = llGetOwner(); } timer() { if (llGetAgentInfo(kowner) & AGENT_TYPING) { llStartAnimation(anim_name); llPlaySound(sound_name, 1.0); } } }
It is your if bracket. You don't need a bracket IF there is only one action, but with two or more, you need to enclose it. The way you had it, llPlaySound is outside of the test and would play every time the timer was triggered.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
Tonks Baphomet
F.E.A.R. Cyberunit
Join date: 29 Jun 2007
Posts: 3
|
08-30-2008 09:19
UPDATE: Got it working 
|