These forums are CLOSED. Please visit the new forums HERE
Give item/notecard |
|
|
Nyara Squeegee
Registered User
Join date: 2 Jan 2006
Posts: 30
|
05-01-2006 05:57
I'm such a noob with scripts. I'm trying to make an item give things when someone walks through a door. Any help would be greatly appreciated.
_____________________
DJ Nyara
Techno is my second life! |
|
Paolo Portocarrero
Puritanical Hedonist
Join date: 28 Apr 2004
Posts: 2,393
|
05-01-2006 06:04
Hi Nyara - Have you perused the Scripting Library forum? It's got a ton of ready-made, open-source scripts that you can copy/modify to meet your needs.
/15/1.html Here's the basic idea for giving inventory: CODE
BTW, there is an LSL scripting guide PDF somewhere, but for some reason, I'm not finding it. Maybe do a search for that, as well. ![]() _____________________
Facades by Paolo - Photo-Realistic Skins for Doods
> Flagship store, Santo Paolo's Lofts & Boutiques > SLBoutique |
|
Nyara Squeegee
Registered User
Join date: 2 Jan 2006
Posts: 30
|
05-01-2006 06:07
I have that script, but you have to touch the item to get what's inside. I'm wondering if there is a variable to use instead of the touch_start
I want ppl that walk through the door to get the items. _____________________
DJ Nyara
Techno is my second life! |
|
Siobhan Taylor
Nemesis
Join date: 13 Aug 2003
Posts: 5,476
|
05-01-2006 06:14
I have that script, but you have to touch the item to get what's inside. I'm wondering if there is a variable to use instead of the touch_start I want ppl that walk through the door to get the items. Sure, you can use a sensor to do it. There are probably freebie visitor counters out there that do exactly that ... well, apart from give the notecard... there are some that do that too. _____________________
http://siobhantaylor.wordpress.com/
|
|
Paolo Portocarrero
Puritanical Hedonist
Join date: 28 Apr 2004
Posts: 2,393
|
05-01-2006 06:24
You could probably modify this script to meet your needs:
/15/b1/24833/1.html#post282149 Within the collision_start(integer num_detected) segment, add the llGiveInventory command. Note that this could be very annoying to repeat visitors. ![]() _____________________
Facades by Paolo - Photo-Realistic Skins for Doods
> Flagship store, Santo Paolo's Lofts & Boutiques > SLBoutique |
|
Siobhan Taylor
Nemesis
Join date: 13 Aug 2003
Posts: 5,476
|
05-01-2006 06:26
You could probably modify this script to meet your needs: /15/b1/24833/1.html#post282149/15/b1/24833/1.html#post282149 Within the collision_start(integer num_detected) segment, add the llGiveInventory command. Note that this could be very annoying to repeat visitors. ![]() Which is why I said to use the visitor counter. Once a person is added to the list, it doesn't count them a second time, so just give the card at that point and you do away with repeats. _____________________
http://siobhantaylor.wordpress.com/
|
|
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
|
05-01-2006 06:44
I want ppl that walk through the door to get the items. I'd leave the choice to get item or not to the person entering your place... dropping stuff into their inventory without asking nor warning (especially notecards if they open automatically) ... that can be quite annoying. |
|
Haravikk Mistral
Registered User
Join date: 8 Oct 2005
Posts: 2,482
|
05-01-2006 06:52
Yeah, best option would be making the notecard giver a fairly obvious sign, or having a greeting message when someone comes through the door pointing them to it.
|
|
Paolo Portocarrero
Puritanical Hedonist
Join date: 28 Apr 2004
Posts: 2,393
|
05-01-2006 07:11
Which is why I said to use the visitor counter. Once a person is added to the list, it doesn't count them a second time, so just give the card at that point and you do away with repeats. I agree with the other folks that it would be better to have a separate sign object that gives the notecard/item on touch. The problem with the visitor counter approach is that, if the user returns a week later but that visitor has previously deleted the notecard, they won't receive it again (unless the script owner resets the script, wiping clean the visitor list). _____________________
Facades by Paolo - Photo-Realistic Skins for Doods
> Flagship store, Santo Paolo's Lofts & Boutiques > SLBoutique |
|
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
|
05-01-2006 08:47
The problem with the visitor counter approach is that, if the user returns a week later but that visitor has previously deleted the notecard, they won't receive it again (unless the script owner resets the script, wiping clean the visitor list). Add to it the script has little memory to work with, and isn't very fast... would figure once the list of recorded unique visitors starts to hit triple numbers, which isn't unreasonable for popular places... any lookups to verify if that particular person have paid a visit earlier, would take quite a while. And it's not far from running out of available memory from there and crashing the script, to boot o.O; Though some sort of linked sript arrangement to emulate a hash set could be used for both speed and extra storage, i guess. Still, overcomplicated... |
|
Marcus Moreau
frand
Join date: 25 Dec 2004
Posts: 602
|
05-01-2006 08:54
I think you have two options as already mentioned here:
1) A visitor counter/list. The memory on this could be big so you could look into llHTTPRequest coming down in 1.9.1 and store the list off-site in a DB. 2) A better option would be to just have a touch sign or even when the collision is detected a menu pops up that they can ignore (still annoying, but better than the notecard I guess). What I used to do is have a touchable sign at my sim's Telehub and had hover text. This text said something like this (paraphrased): "Welcome to the sim, Read/Obey these rules or leave, Updated 5/1/06". That had enough information for people to get the new notecard if they wanted. Also, this is enough to enforce sim rules, especially on private islands. Ok, that was a mess. Summary of my post: do a touch sign and maybe have hovertext with the date of the last update to said notecard. Bai, MM _____________________
Marcus Moreau
Disenfranchised island owner... "This statement is false." User #121869 or something close |