The parent of course knows its child key via object_rez.
After some thought, I think I've found a way to add this functionality without breaking any older scripts (the ideal would be an 'on_rez(integer param, key parent)', but that would break things).
http://jira.secondlife.com/browse/SVC-4230
Quoted from the JIRA entry:-
Definitions:-
Parent: The object that is rezzing an item from its inventory
Child: The object that is being newly rezzed from the parent's inventory
Currently, when a script rezzes llRezObject/llRezAtRoot's an item from inventory, the parent knows the key of the child, but the child has to jump through hoops, usually involving open listeners, to get any knowledge of its parent.
The ideal way to gain this would be to have an 'on_rez(integer start_param, key parent)', but this isn't feasible since it would break all previous scripts.
My solution is:-
Allow us to call llDetectedKey(0) in on_rez, and have it return the parent's key. This would not break any scripts, since llDetectedKey(0) is undefined in on_rez anyway, so no-one should be using it there.
With scripting changes on the horizon to refine script-usage, this seemingly simple change would allow the child object to immediately use a precisely defined listen for just its parent.
Parent: The object that is rezzing an item from its inventory
Child: The object that is being newly rezzed from the parent's inventory
Currently, when a script rezzes llRezObject/llRezAtRoot's an item from inventory, the parent knows the key of the child, but the child has to jump through hoops, usually involving open listeners, to get any knowledge of its parent.
The ideal way to gain this would be to have an 'on_rez(integer start_param, key parent)', but this isn't feasible since it would break all previous scripts.
My solution is:-
Allow us to call llDetectedKey(0) in on_rez, and have it return the parent's key. This would not break any scripts, since llDetectedKey(0) is undefined in on_rez anyway, so no-one should be using it there.
With scripting changes on the horizon to refine script-usage, this seemingly simple change would allow the child object to immediately use a precisely defined listen for just its parent.
I'd appreciate any comments, and of course Votes.

Ps. Doh! and I've just realised I've posted this with my alt.... figures

