Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Notecard Dispenser

Essence Lumin
.
Join date: 24 Oct 2003
Posts: 806
12-09-2003 03:39
I looked around and so far as I can see no one has posted
the code for a notecard dispenser. This is super simple but I
thought I'd post it anyway since people have asked for it. Just replace the text - My Notecard - with the name of the notecard you want to dispense.

CODE

default
{
touch_start(integer total_number)
{
llGiveInventory(llDetectedKey(0), "My Notecard");
}
}

indigo Wolfe
Registered User
Join date: 30 Dec 2004
Posts: 21
02-10-2005 07:37
Is it possible to set a wildcard, so that the dispenser detects what notecard is in the object and gives it out, regardless of the name of the notecard?
Chandra Page
Build! Code. Sleep?
Join date: 7 Oct 2004
Posts: 360
02-11-2005 11:13
From: indigo Wolfe
Is it possible to set a wildcard, so that the dispenser detects what notecard is in the object and gives it out, regardless of the name of the notecard?


This script hands out the first notecard in inventory, regardless of name:

CODE

default
{
touch_start(integer total_number)
{
llGiveInventory(llDetectedKey(0),
llGetInventoryName(INVENTORY_NOTECARD, 0));
}
}
_____________________
Come visit the In Effect main store and café
Drawbridge (160, 81)
Particle effects, fashion, accessories, and coffee!
On the Web at SL Exchange and SL Boutique
Techzen Omega
Registered User
Join date: 31 Dec 1969
Posts: 58
02-12-2005 12:45
Sorry if this is a stupid question but...
Would the first script work to give a texture if the texture was in the contents and I added the texture name in place of the notecard name?

Would the second script work to do this if I changed the "INVENTORY_NOTECARD" to "INVENTORY_TEXTURE"?

If either of these would work can I combine the notecard part with the texture part into one script or have both scripts in the same object to have them give both a notecard and a texture?

While I'm at it would either work for photos? Is "INVENTORY_PHOTO" workable?

I've made some step by step pictorial how too's for newbies and need a delivery system.

I would just go test this myself but can't log in at the moment. Will try as soon as I can. Searched but didn't find anything on this.
_____________________
___________________________________________________

"Techzen, you definitely DO NOT suck at the forums." - Alicia Eldritch


"Do you think I'd get in trouble if I took a portable paint sprayer on a paintball field and said it was a paintball flamethrower"? "---SenorBiggles (Anandtech Forums)
Techzen Omega
Registered User
Join date: 31 Dec 1969
Posts: 58
02-14-2005 05:18
Ok, posting for all the other noobs who may find this in a search. And to save all the knowledgeable from having to explain all this basic stuff to script noobs like me. :)

I tested the second script using "INVENTORY_LANDMARK" & "INVENTORY_TEXTURE"? And both work fine. Also I guess there is no such thing as INVENTORY_PHOTO. INVENTORY_TEXTURE will give out Photos (the items that show in the photo folder of your inventory as opposed to the texture folder).

I assume (but have not tested) that the second will work with any of the following as well...

INVENTORY_SOUND,
INVENTORY_OBJECT,
INVENTORY_SCRIPT,
INVENTORY_CLOTHING,
INVENTORY_BODYPART,
INVENTORY_ANIMATION,
INVENTORY_GESTURE
_____________________
___________________________________________________

"Techzen, you definitely DO NOT suck at the forums." - Alicia Eldritch


"Do you think I'd get in trouble if I took a portable paint sprayer on a paintball field and said it was a paintball flamethrower"? "---SenorBiggles (Anandtech Forums)
FireDancer Steptoe
Registered User
Join date: 14 Dec 2004
Posts: 11
02-14-2005 20:07
Hey! Just wanted to say thanks! I was looking for info on how to make notecards and give out a landmark! This works beautifully!!

FireDancer
Chandra Page
Build! Code. Sleep?
Join date: 7 Oct 2004
Posts: 360
02-17-2005 11:04
From: Techzen Omega
I tested the second script using "INVENTORY_LANDMARK" & "INVENTORY_TEXTURE"? And both work fine. Also I guess there is no such thing as INVENTORY_PHOTO. INVENTORY_TEXTURE will give out Photos (the items that show in the photo folder of your inventory as opposed to the texture folder).


Yes, there's actually no such thing as a "photo" inventory type. All images in Second Life are textures. The Photo Album section of your inventory actually holds textures, but it's there to give you a place to hold more photo-like textures instead of things you'd be more likely to use for decorating prims.

Which begs the question, why do default screen shots with the name "Snapshot" automatically go to your Textures folder when you receive them instead of Photo Album, but that's just one of those annoyances I've learned to live with.

From: Techzen Omega
I assume (but have not tested) that the second will work with any of the following as well...

INVENTORY_SOUND,
INVENTORY_OBJECT,
INVENTORY_SCRIPT,
INVENTORY_CLOTHING,
INVENTORY_BODYPART,
INVENTORY_ANIMATION,
INVENTORY_GESTURE


Yes, anything you can put in an object's inventory may be used with llGiveInventory; you just need the proper type constant.
_____________________
Come visit the In Effect main store and café
Drawbridge (160, 81)
Particle effects, fashion, accessories, and coffee!
On the Web at SL Exchange and SL Boutique