Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Ownership Problem

Jaser Newell
Registered User
Join date: 12 Sep 2006
Posts: 23
09-13-2007 15:18
So there's this script I'm working on. Details don't matter, but I'm stuck on this one problem and can't seem to find a solution.

It works perfectly for me, but when I give the object to another person, it doesn't change the owner in the script. I have the script set to reset on_rez, and it has the whole change if change & CHANGED_OWNER thing too. But its still won't change the ownership in the script. What can I do to fix this problem.
Ravanne Sullivan
Pole Dancer Extraordinair
Join date: 10 Dec 2005
Posts: 674
09-13-2007 16:00
do you have a state change in your script? If so the on_rez or change owner events must be within that state or they won't run. When you change staes and take back in to inventory the script remembers the last running state and restarts in that state and never runs an on rez or change owner event located in the default state.
_____________________
Ravanne's Dance Poles and Animations

Available at my Superstore and Showroom on Insula de Somni
http://slurl.com/secondlife/Insula de Somni/94/194/27/
Jaser Newell
Registered User
Join date: 12 Sep 2006
Posts: 23
09-14-2007 12:29
no state changes in the script.
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
09-14-2007 12:41
What do you have it set to do if change & CHANGED_OWNER? Does it re-evaluate llGetOwner()?
Jaser Newell
Registered User
Join date: 12 Sep 2006
Posts: 23
09-14-2007 13:04
it is suppose to reset the script
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
09-14-2007 17:41
At what point in the script does it determine ownership?

And . . . how do you KNOW it does not change ownership? What is telling you that?
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
09-14-2007 18:47
If a script resets in on_rez, then the CHANGED_OWNER event will be tossed from the queue, so you won't ever see it. Could this be what is happening?
Jaser Newell
Registered User
Join date: 12 Sep 2006
Posts: 23
09-16-2007 19:59
the script determines the owner in the state_entry. and I know its not changing the owner because when my friend puts it on and tries to use it I still get the llOwnerSay messages she's suppose to get. and if the on_rez was working I wouldn't have added the change statement.
Talon Brown
Slacker Punk
Join date: 17 May 2006
Posts: 352
09-17-2007 01:43
For an attachment you need to use the attach() event, not on_rez(). This is also why details do matter when asking for help.
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
09-17-2007 06:21
This post will probably not be particularly helpful to you, Jaser, but it sounds to me kind of "buggish". If *she* is wearing it, then as I understand it, *she* is the owner. llOwnerSay should not depend on a "changed" event or require a "llGetOwner" or a reset or anything else. When it changes hands, llOwnerSay should recognize that and send to her.

Am I missing something here, too?
Jaser Newell
Registered User
Join date: 12 Sep 2006
Posts: 23
09-17-2007 12:40
well my experience has shown me that for the script to recognize the new owner it must be reset. for some reason its just not resetting and I have no clue why. it doesn't seem buggy, I've checked everything through several times and can't find a single thing wrong with it. If I tell the script to reset on_rez, when she attaches it, it should reset. it doesn't. I added the change statement and still not resetting. I was hoping somebody on here could tell me what was up, but this hasn't been very helpful. so now I'm just at a loss of ideas and resources.
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
09-17-2007 19:47
I've got a script that changes hands, does not get reset, but reflects owner change. You may need to post some code to get any further unless someone else has some brilliant insight or ideas.
Jaser Newell
Registered User
Join date: 12 Sep 2006
Posts: 23
09-18-2007 15:27
well it turns out its been working fine the past few revisions, but my partner is dumb. I asked if the menu came up and she said it did nothing. so I assumed I still had the problem. What she didn't understand was that I just wanted to know if the menu came up, not if the buttons on the menu, which I haven't put in code for, worked.
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
10-03-2007 11:10
I think that this is not the owner change problem but CHANGED_OWNER is really broken.
CODE
key owner;

default
{
state_entry()
{
owner = llGetOwner();
}
changed(integer change)
{
if(change & CHANGED_OWNER)
{
llResetScript();
}
}
attach(key av)
{
if(av != NULL_KEY)
{
llOwnerSay(llKey2Name(owner));
}
}
}
The next owner listens to the previous owner's name when wearing this at the first time just after changing owner.
_____________________
:) Seagel Neville :)
Darien Caldwell
Registered User
Join date: 12 Oct 2006
Posts: 3,127
10-03-2007 12:18
This is why having an alt for development is crucial. :)
_____________________