Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Learning Scripting ultimate goal - tummy talker

Oni December
Registered User
Join date: 1 Jan 2009
Posts: 2
09-11-2009 04:16
i am trying to learn scripting so that I can create my ultimte goal. a Unique tummy talker all my own. I am way above my head and just need help in a lot of different ways.
Ephraim Kappler
Reprobate
Join date: 9 Jul 2007
Posts: 1,946
09-11-2009 04:26
It's going to be an up-tummy struggle, I'm afraid. Check this out just to get an idea of what you're up against:

EF Klaar
Registered User
Join date: 11 Jun 2007
Posts: 330
09-11-2009 05:04
Noooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
Windsweptgold Wopat
Registered User
Join date: 24 May 2007
Posts: 1,003
09-11-2009 05:06
From: EF Klaar
Noooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo

times 10000
_____________________
"Mushrooms grow well in BS, trust and honesty do not"
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
09-11-2009 05:19
Not another @#*^%$%$BG!!!! tummy talker! (And another tummy talker thread.) Where is the world headed, and why are we carrying these handbaskets?
_____________________
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
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
09-11-2009 05:35
From: Rolig Loon
Where is the world headed, and why are we carrying these handbaskets?
Nothing in this one!

_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
09-11-2009 05:36
From: Oni December
i am trying to learn scripting so that I can create my ultimte goal. a Unique tummy talker all my own. I am way above my head and just need help in a lot of different ways.
It is fine with me if you learn scripting by making a tummy talker as long as you don't use it or give it away:):):)
_____________________
From Studio Dora
Ephraim Kappler
Reprobate
Join date: 9 Jul 2007
Posts: 1,946
09-11-2009 06:01
From: Rolig Loon
Not another @#*^%$%$BG!!!! tummy talker! (And another tummy talker thread.) Where is the world headed, and why are we carrying these handbaskets?

I'm sure a nefarious coven of prim-propagators have set themselves on a mission to tease what they see as a bunch of serious-minded fuddy-duddies in the 'Scripting Tips' forum. I had a good hearty chortle reading over the responses on the previous thread anyway.

From: Dora Gustafson
It is fine with me if you learn scripting by making a tummy talker as long as you don't use it or give it away:):):)

Or do a 'Damien: Omen XVIII" Son of Satan kind of thing with it, which could be good for a laugh on a slow night in any of the darker sims.
EF Klaar
Registered User
Join date: 11 Jun 2007
Posts: 330
09-11-2009 07:26
From: Ephraim Kappler
Or do a 'Damien: Omen XVIII" Son of Satan kind of thing with it, which could be good for a laugh on a slow night in any of the darker sims.
Rosemary's tummy-talker?
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
09-11-2009 08:12
okay, now that everyone has had their fun.. the basic question you need to ask yourself (OP) is.. do you just want a wearable chatterbox, or do you want something more refined, that will function as a whole "pregnancy system"?

The chatterbox is a good deal simpler, and probably a great way to get started. When you know a bit more about how scripts work, you can start doing things like having it count the days, introduce animations, do the whole "going into labor" thing, etc.

Most complaints about tummy talkers, center around the social impact of randomized green text spam. In the US at least, there is something of a taboo around body functions in general, and pregnancies (we have regular controversies about breastfeeding in public). I'm not sure how other cultures view such things, but the random inane chatter tends to annoy people a lot.

The best way to avoid this, is to make use of llOwnerSay.

llOwnerSay will only talk to the mother (wearer). This gives her the full experience of knowing that she's having cravings, feeling the baby kick, etc.. without broadcasting to everyone within a 20-40m circle.

The next part is really straightforward. You need a random number. For most baby chatter, I'd say a random number from 7-14 minutes (420-840 seconds) would be good. This means that every 7 to 14 minutes, the talker will send mommy a message, letting her know something. If you'd prefer a longer number, that's fine.

To make a random number like that, we do something like this.



float interval = 420 + llFloor(llFrand(421));

Now.. here's the trick.. I'll show you a super basic version of this.

CODE

float interval(float input)
{
return input + llFloor(llFrand(input + 1));
}

default
{
state_entry()
{
llSetTimerEvent(0.1); // trigger immediately on startup
}

timer()
{
llOwnerSay("poke");
llSetTimerEvent(interval(420)); // get a new random number for next time
}
}


The next part is pretty simple. You can go one of several ways with this. One idea is to just make a list of phrases in the script. That's pretty easy and looks something like this:

CODE

list phrases =
[ "The baby is poking you"
, "Your baby hates you"
, "You're not pregnant, just fat."
, "You're going to be a horrible mother"
];


It would then be a small matter to randomly choose a phrase from that list. I'd suggest making a "lastPhrase" integer, to keep track of the last thing it says (and not allow it to use that one a second time in a row), because in a list of 100 phrases, 1-1-1-1-1-1-1-1-1-1-1 is also a random selection.

Another option you can do, is create a phrases notecard. This would allow the mother-to-be to set her own phrases. Sounds like that's not something you really want to do.

A third interesting option, is to have the script poll a webpage. A simple php script could return a randomly selected phrase on demand, which the talker could repeat. This would allow you to change phrases later on down the road, but does force you to maintain some kind of static web address, and know a bit about php scripting.
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Ephraim Kappler
Reprobate
Join date: 9 Jul 2007
Posts: 1,946
09-11-2009 08:16
To The Devil, A Tummy-Talker

Y'all burn in Hell fer yore reckless encouragement of such foolishness, Ventura!
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
09-11-2009 09:36
From: Ephraim Kappler
To The Devil, A Tummy-Talker

Y'all burn in Hell fer yore reckless encouragement of such foolishness, Ventura!
I have an evil tummy talker which does, indeed, work on the basis I was knocked up by a demon in a New York back-alley and am now bearing its spawn (my favourite random comment: "Innula prays the unborn thing inside her does not grow up to become a Linden";).

I normally only have to turn it on for a minute or two before everyone in chat range gets the message and turns off hers, at which point I turn mine off too.
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
09-11-2009 10:22
All joking aside, I think you will find that the vast majority of people in SL find spam talkers of any kind offensive. That includes not only tummy-talkers but all of the shouting greeters, the screen-filling "cute" gestures, and raucous advertizing devices we run into daily. I have never been able to figure out whether the people who create these things simply don't know any better, or are thoughtlessly arrogant, or are purposely rude. As an naive optomist, I hope it's usually the first of those possibilities.
_____________________
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
Oni December
Registered User
Join date: 1 Jan 2009
Posts: 2
09-11-2009 14:51
Let me rephrase what I was saying.

1) I can't stand the spamming tummy talkers. Albeit I understand some needs for wanting sl pregnancy and believe that the growing bundle's "tummy talker" should be limited to the wearer, and those who touch it. not everyone who is in a room. i can't stand walking into a room and hearing 4-5 of these going off at once.

2) Is it even possible to limit chat to private messages for mom, dad, and a selecct few on an allowed list?
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
09-11-2009 15:02
Sure. It's a piece of cake. Put the keys of the approved avs in a list and then send the messages by IM to them alone.

CODE

list Approved = ["key1 goes here","key2 goes here","key3 goes here"];
integer i;
for (i=0;i<=llGetListLength(Approved)-1;i++)
{
llInstantMessage(llList2Key(Approved,i),"Here is my inane message.");
}
/php]

If you don't already know the keys of each of the approved avs, collect them with something like

CODE

default
{
touch_start(num_detected)
{
llSay(0,(string)llDetectedKey(0));
}
}
_____________________
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-11-2009 15:11
From: Oni December
I can't stand the spamming tummy talkers. Albeit I understand some needs for wanting sl pregnancy and believe that the growing bundle's "tummy talker" should be limited to the wearer, and those who touch it. not everyone who is in a room. i can't stand walking into a room and hearing 4-5 of these going off at once.
I am willing to take you at your word :)
From: someone
Is it even possible to limit chat to private messages for mom, dad, and a selecct few on an allowed list?
Yes; you can use the function llInstantMessage to send messages to specific avatars. IMs from objects are not like IMs from avatars, they work more like the private orange chat that only the owner of an object "hears". They do, however, transmit across the whole of SL, but it is possible using other LSL functions to limit them selectively to, say, only the specific avatars within chat range of the object.