Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Very new-Greeting script

Corneilus Kappler
Registered User
Join date: 9 Jul 2007
Posts: 5
07-11-2007 12:04
Hiya.

I have a question. I've been looking at greeting type scripts, trying to figure out how they work and maybe use one for my land.

The ones I've found give greetings and notecards and such. I really don't want to give a notecard, but I want to greet everyone anytime they walk onto my property with something like:

C. K. Welcomes you to his place. "avatar name", feel free to look around and make yourself at home.

I want this to be in the "chat window" so everyone can see it.


I've been searching the scripting areas, wiki's, etc. I've come to the conclusion I'm not cracked up to be a programmer. lol

Anywhere you can point me to a script that does this?

Thanks in advance!
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
07-11-2007 12:15
If you go to the scripting library forum here and search that forum for Greeting you will find a few:

/15/1.html
Wicc Cunningham
Registered User
Join date: 25 Jun 2004
Posts: 52
07-11-2007 12:30
If you want everyone to hear the message you could do something like this

CODE


default
{

state_entry()
{
llVolumeDetect(TRUE);
}


collision_start(integer num_detected)
{

integer i;
for (i = 0; i < num_detected; i++)
{
llSay(0, " C. K. Welcomes you to his place. " + llDetectedName(i) + ", feel free to look around and make yourself at home.");
}

}
}



You would put this in a prim that your customers would walk on. You could create an invisible and phantom prim that they would walk through and get the same result.
Corneilus Kappler
Registered User
Join date: 9 Jul 2007
Posts: 5
Thanks.
07-11-2007 13:00
RJ, thanks, I've done searching there, alot of the ones I found require an "action" or give out notecards. I've also searched wiki and even googled it. :) maybe I'm using the wrong search terms. :(

WICC,

This one has to be attached to something that an av touches to activate.

Is there a way to "monitor" my whole area or a range and if they come into the range it welcomes them?
Milambus Oh
Registered User
Join date: 6 Apr 2007
Posts: 224
07-11-2007 13:33
Not really... you could use a sensor to scan the area.. but that could get laggy depending on how often you do the scans.
Wicc Cunningham
Registered User
Join date: 25 Jun 2004
Posts: 52
07-11-2007 13:45
Oh, sure that can be done.

CODE


float range = 10.0; // Radius in meters
float scanDelay = 10.0; // Delay in seconds between scans

default
{

state_entry()
{
llSensorRepeat("","",AGENT,range,PI,scanDelay);
}


sensor(integer num_detected)
{

integer i;
for (i = 0; i < num_detected; i++)
{
llSay(0, " C. K. Welcomes you to his place. " + llDetectedName(i) + ", feel free to look around and make yourself at home.");
}

}

}



You will need to change the range, I have this set for 10 meters. The range is the radius around the item with the script in it. So, with the way it is it will scan a 20 meter sphere around the object the script is in.
Corneilus Kappler
Registered User
Join date: 9 Jul 2007
Posts: 5
For Wicc
07-11-2007 14:37
That worked great.

I guess it needs some kind of logic as to not keep repeating itself every 10 seconds for the same people on my land.

That's the right idea tho.
Corneilus Kappler
Registered User
Join date: 9 Jul 2007
Posts: 5
I'm looking up the script info
07-11-2007 14:40
I think I understand what you did.

Pretty slick. I should take a programming class again. Haven't done any programming since 1987 and that was in cobol. :(
Wicc Cunningham
Registered User
Join date: 25 Jun 2004
Posts: 52
07-11-2007 15:34
I have a greeter script I got off the forums here I am using at my store. It only gives a greeting once a day per person. I can use that to make the one I posted do the same. I'll send it to you in world this evening.
Corneilus Kappler
Registered User
Join date: 9 Jul 2007
Posts: 5
wicc, thanks
07-11-2007 16:05
Wicc, I took what you did, made some modifications where it keeps track of who it's greeted and won't greet them again.

seems to work fine.

I have to unload the item off my av to reset, but I'll code that later where I can reset at will.

Have to brush up on my programming.

Thanks again for your help!!!!! Much appreciated.
Wicc Cunningham
Registered User
Join date: 25 Jun 2004
Posts: 52
07-11-2007 16:47
Ok, glad to give you the start on it.