Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Script: Someone Typed

Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
09-14-2009 09:39
So, I guess I'm the only one in the world who finds this frustrating. In and among the fetish community, it seems that people are all super-thrilled to disable the typing animations. Maybe it conflicts with some bondage furniture.. who knows. Thing is, it also disables the "clackity clackity clack" typing sound.

Anyways, I've been going absolutely crazy.. because I never know if someone is typing, and if I'm hopping around in photoshop or firefox.. people can walk right up to me, and ask me questions, and I don't even know they're there unless they IM me. (and even then, only if it's a new IM session!)

So I had this idea, for a little rider script, that I'd drop into a hud (my flight assist already takes controls, so that's a good place for it). A little script that would make a noise that only I could hear, when people typed.

CODE

default
{
state_entry()
{
llListen(0, "", NULL_KEY, "");
}

listen(integer channel, string name, key id, string message)
{
if (id != llGetOwner())
{
float volume = 1 - (llVecDist(llGetRootPosition(), llList2Vector(llGetObjectDetails(id, [OBJECT_POS]), 0)) / 20);

if (llGetAgentSize(id) != ZERO_VECTOR)
{
llPlaySound("eab488f8-2a6d-d06e-6016-ef5e9a366204", volume / 2); // avatar sound
}
else
{
llPlaySound("f7728e86-8424-125d-1efd-31816215028a", volume / 2); // object sound
}
}
}
}



It's not 100% perfect, of course, you won't hear a sound from an avatar shouting from over 20 meters away.. but the sound dampens as the speaker gets further away.

Downside of course, is that while it will give audio-dfeedback when someone talks using one of those "slave talkers".. or uses a horribly garbled ballgag, it's also going to bleep every time any object says something.. which can be a bit hellish. Probably the biggest downside here is that the typing sound is relative to your camera and the typing avatar. The typing sound is relative to your avatar and the typing avatar.

About the /2's . I decided that the sounds were a little "in your face" when you had the source on a hud, so I needed to tone them down a bit.

If anyone has any ideas on how to make this better, like perhaps doing the math to figure out the camera's position relative to the speaking avatar/object... or any other ideas.. I would love to hear them!
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
09-14-2009 10:05
So, I did a little change...

CODE

default
{
state_entry()
{
llListen(0, "", NULL_KEY, "");
llRequestPermissions(llGetOwner(), PERMISSION_TRACK_CAMERA);
}

on_rez(integer start)
{
llResetScript();
}

listen(integer channel, string name, key id, string message)
{
if (id != llGetOwner())
{
float volume = 1 - (llVecDist(llGetCameraPos(), llList2Vector(llGetObjectDetails(id, [OBJECT_POS]), 0)) / 20);

if (llGetAgentSize(id) != ZERO_VECTOR)
{
llPlaySound("eab488f8-2a6d-d06e-6016-ef5e9a366204", volume / 2); // avatar sound
}
else
{
llPlaySound("f7728e86-8424-125d-1efd-31816215028a", volume / 4); // object sound
}
}
}
}


This one dampens the volume based on camera distance.. which I thinkis probably a lot better. I need to go some place where a lot of people are chatting, to get a feeling for how well the volume settings work.
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
09-14-2009 11:14
Nice idea, Winter. :)

Just out of curiosity, do you or anyone know how Mystitool detects a typing av? I have the Mystitool HUD on most of the time, and I have noticed that it indicates a "T" next to the name of an av that shows up on its radar, even if the av has the typing anim suppressed. It doesn't seem to work that way all the time -- it misses some typing avs, apparently at random -- but I'd say 80-90% of the time I can tell who's typing, even if their anim is turned off. It has to be using something more sophisticated than llGetAgentInfo, because I think that function looks for the anim, doesn't it?

Anyway, if you could duplicate Mystitool's method, or script a plug-in to add sound to it, then you wouldn't need to have a listen handle open on the public chat channel all the time.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
EF Klaar
Registered User
Join date: 11 Jun 2007
Posts: 330
09-14-2009 11:22
I'm guessing, but llGetAgentInfo returns a set of flags that includes AGENT_TYPING. One of the values of the typing animation is that it lets you know someone is typing something before the chat text appears.

(Edit) But duh, that flag will not be set if the typing animation is disabled. EF: RTFW.
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
09-14-2009 11:29
From: EF Klaar
I'm guessing, but llGetAgentInfo returns a set of flags that includes AGENT_TYPING. One of the values of the typing animation is that it lets you know someone is typing something before the chat text appears.


Oh yes, I was pretty sure that's how llGetAgentInfo works. I've tested for AGENT_TYPING in scripts myself. My point was that Mystitool seems to be doing something different. It doesn't seem to be detecting the animation, because it notices typing even if the anim is turned off. I was just curious about how it does that.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
EF Klaar
Registered User
Join date: 11 Jun 2007
Posts: 330
09-14-2009 11:39
I just tried this with an alt and -multiple. My MystiTool radar didn't pick up the typing when my alt disabled her animation.

(I'm assuming you meant the T that appears after the avatar name in the floating text radar scan.)
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
09-14-2009 11:54
That's odd. Yeah, that's exactly what I meant, EF. And it really does indicate the "T" almost 9 times out of 10 for me when the other person's typing anim is turned off. I count on that, because I spend a lot of time answering questions in groups of people and it's truly helpful to predict who's about to respond to a comment. You suppose maybe I have the special Magic Mystitool edition? :p
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
EF Klaar
Registered User
Join date: 11 Jun 2007
Posts: 330
09-14-2009 12:03
lol, mine is the standard paid-for version, bought just about the time Mystical went walkabout.

One thought; do perhaps most people supress their typing animations using an AO, rather than actually disable them? But that doesn't supress the the typing sound effect. (This is how my own setup works; people close by can hear that I'm about to say something interesting and witty, but the animation doesn't impinge on my coolness :) )
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
09-14-2009 12:18
Now, THAT's a possibility I hadn't considered. If the anim is still active but overridden by something in an AO, I suppose llGetAgentInfo would still detect typing. If that's the answer, then I'm mildly surprised that so many people seem to be using this route instead of simply turning off the anim in Preferences. I get surprised all the ime in SL, though, so that's nothing new.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
09-14-2009 14:16
From: Rolig Loon
Now, THAT's a possibility I hadn't considered. If the anim is still active but overridden by something in an AO, I suppose llGetAgentInfo would still detect typing. If that's the answer, then I'm mildly surprised that so many people seem to be using this route instead of simply turning off the anim in Preferences. I get surprised all the ime in SL, though, so that's nothing new.


for a long time that's what i used because i didn't know it could be disabled, but now i usually wear a typing ao with a pen and scroll
_____________________
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
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
09-14-2009 14:31
as someone who made a typing AO, I can say that there's no way via script to detect if someone is typing, if they've either disabled, or stopped the typing animation. You can "pave over it" with a higher priority animation.. but in that situation you can here the "clackity clackity clack" sound, regardless of what animation is showing.

It's the lack of that sound that I'm trying to work-around here.

So far, the script as shows in the second post is behaving really well. The green-text issue is becomming a bit annoying tho. (you forget how much green spam drifts by until you make a device that beeps each time it happens... cuffs, collars, little chairs, things locking and unlocking... )

Unfortunately, I can't think of anything that is different between say a wrist cuff talking, and a slave talker. both are worn attachments, both are most likely using llSay or llWhisper...

screening out my own attachments would be easy enough, but that's only a small percentage of the issue. I think I may go back and remove the object sounder.. those talker gadgets aren't all THAT common.
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
09-14-2009 14:34
From: Rolig Loon
Now, THAT's a possibility I hadn't considered. If the anim is still active but overridden by something in an AO, I suppose llGetAgentInfo would still detect typing. If that's the answer, then I'm mildly surprised that so many people seem to be using this route instead of simply turning off the anim in Preferences. I get surprised all the ime in SL, though, so that's nothing new.

Yes, that is exactly what is happening, all those values in the MystiTool radar are taken from llGetAgentInfo and have the same limitations. That hidden typing isn't always a conscious attempt, it just happens to be a side effect of using really high priority animations.
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
09-14-2009 22:15
You could use the test 'llGetOwnerKey(id) == id' to filter out MOST object chat. The test will be false if 'id' is the key of an object in the current sim. That means you'll get a false positive if you hear an object speaking across a region boundary. The only reasonably sure way to do it otherwise is to use a dataserver event (llRequestAgentData()) and use a timeout to assume the subject was not a resident after all.
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
09-15-2009 03:53
I can just use llGetAgentSize now.. (<0,0,0> = object, other = agent). I don't want to filter out all object chat, that's the problem.

I just can't think of anything that gags and slavetalkers have in common, that don't also apply to boots, collars, corsets, etc.
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
09-15-2009 09:07
Oh. Right. Sorry about that. That should be an equivalent test. :o
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
09-15-2009 11:20
Nice one, Winter.

I'd put in a touch handler, and when touched, change between signalling for object talk and not. I'd also change the appearance so I could tell at a glance.


I can't imagine how Mysti would detect typing other than using llGetAgentDetails() (or looking for the typing anim key, which would be slower). From a bit of zhao work, I know that the AGENT_TYPING gets set based on whether the avatar is playing the standard typing animation. If you stop that anim, the flag gets cleared.

As mentioned above, an AO can have a typing override that leaves the typing anim playing, but gives the arms something else to do -- that's the mod I made to zhao-II.

It could also simply stop the standard typing animation any time it sees it running. This would cause the hands to jerk a bit, and maybe some of the clackity clack sound would be audible and maybe not. If this is how they work, then the AGENT_TYPING flag would sometimes be seen, but only briefly and not reliably.

I don't know whether any AOs work this way, but if they disable the typing anim and leave the arms alone (mostly), then I imagine that's how it's done. Perhaps there's yet another little trick I don't know!