Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Strange: script error with llGiveInventory

Paulo Dielli
Symfurny Furniture
Join date: 19 Jan 2007
Posts: 780
01-29-2010 20:04
I've made a champagne tray. On the tray are a bottle and two glasses. Both glasses are slightely different and can be touched. All prims are in a linkset. When an avi touches a glass it gives the glass in inventory, then the avi should wear the glass and have the standard LL drinking animation.

For giving the glass I've used:

default {
touch_start(integer total_number)
{
llGiveInventory(llDetectedKey(0),llGetInventoryName(INVENTORY_OBJECT, 0));
}
}

I've used the same script in both champagne glasses. It works well when I (creator and owner) touch the glasses. But when I give the champagne tray to another avi the probs begin. A champagne glass can only be taken once. After that I get a script error: Champagne Glass 1: Unable to give inventory: 'No item named ''.'.

What is wrong?
Twisted Pharaoh
if ("hello") {"hey hey";}
Join date: 24 Mar 2007
Posts: 315
01-29-2010 20:12
Does the glass have next owner copy permission?
Paulo Dielli
Symfurny Furniture
Join date: 19 Jan 2007
Posts: 780
01-29-2010 21:18
No it doesn't. Permissions for all objects are Modify/No Copy/Transfer. Is that the problem?
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-29-2010 21:27
that'd be the problem... it's giving away it's only inventory copy of the glass, and then it can't find it the next time because it's gone
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Paulo Dielli
Symfurny Furniture
Join date: 19 Jan 2007
Posts: 780
01-29-2010 21:30
Thanks a lot. I'm going to try it. So this means that an object such as the champagne glass ALWAYS has to have copy permissions, yes?
Twisted Pharaoh
if ("hello") {"hey hey";}
Join date: 24 Mar 2007
Posts: 315
01-29-2010 23:01
Well no but that's the simplest method. Otherwise you can setup an object server that you own to deliver the champagne glass to the person who clicked the tray (or to the tray to make it more complicated).
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-29-2010 23:08
almost impossible to reliably deliver inventory to an object, unless that object is in the same sim as the server (there are ways, but it's arcane and maddening in it's failures)
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Nyx Alsop
Registered User
Join date: 14 Dec 2008
Posts: 252
01-30-2010 00:04
What function would you use to pass an object to and object?
Twisted Pharaoh
if ("hello") {"hey hey";}
Join date: 24 Mar 2007
Posts: 315
01-30-2010 00:13
The same: llGiveInventory
    .
Paulo Dielli
Symfurny Furniture
Join date: 19 Jan 2007
Posts: 780
01-30-2010 21:29
From: Void Singer
that'd be the problem... it's giving away it's only inventory copy of the glass, and then it can't find it the next time because it's gone
Yep that worked. Thanks Void. Still, it's somewhat awkward that copy/transfer perms are needed to get this to work.
Beverly Ultsch
Registered User
Join date: 6 Sep 2007
Posts: 229
01-31-2010 02:39
From: Paulo Dielli
Yep that worked. Thanks Void. Still, it's somewhat awkward that copy/transfer perms are needed to get this to work.


It's only the items in the objects inventory that need copy perms, the object itself can be no copy.
Paulo Dielli
Symfurny Furniture
Join date: 19 Jan 2007
Posts: 780
01-31-2010 16:06
Thanks Void and Twisted, it works. The content object (champagne glass) must be copy and transfer. It means that people can 'take' a whole lot of glasses and could theoretically sell them. But if I keep the glass No Modify, permissions for the next owner are hardly worthwhile because the glass needs the champagne tray in order to work properly. Still, I don't like to have copy AND transfer permissions on commercial items, but there's no other way so it seems (besides the database solution).

BTW, here's my champagne tray:

Twisted Pharaoh
if ("hello") {"hey hey";}
Join date: 24 Mar 2007
Posts: 315
01-31-2010 20:16
If that really bother you then you can have the glass suicide with llDie() if not given by the tray, but it's a lot of work for small result imho.

Nice champagne, make sure there is "NM" written on the stamp ;)
Paladin Pinion
The other one of 10
Join date: 3 Aug 2007
Posts: 191
01-31-2010 20:20
Why does it have to be transfer? Isn't copy enough?
_____________________
Mote Particle Script Generator - easier and faster than any HUD
Also: Paladin's Sunbeam. Up at dawn, gone by dusk, day and night sounds, fully configurable
See more at: www.paladinpinion.com
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-31-2010 20:47
can't give no-transfer items =P (well at least not to other people)
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Paulo Dielli
Symfurny Furniture
Join date: 19 Jan 2007
Posts: 780
02-01-2010 05:11
From: Twisted Pharaoh
make sure there is "NM" written on the stamp ;)
Lol :)