Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

When Rezzed(By Someone Else) Script Does Eveything and Does Not turn Off Other Script

Mickeywishes Au
Registered User
Join date: 7 May 2006
Posts: 16
04-15-2007 22:32
First Off - Thank-you for any help or advice! :)

When Rezzed(By Someone Else) Script Does Eveything and Does Not turn Off Other Scripts.

Heres the jist - this works for me the creator but then if someone else owns it and its rezzed out all these Functions are trigger at once and the llSetScriptState doesnt trigger. (And yes all scripts are running and I get no errors).

Heres the jist of the script:

default
{

on_rez
{
llSay();
llSetScriptState(name,FALSE);
llSetScriptState(othername,FALSE);
}
touch_start
{
llSay();
}
changed
{
if(CHANGED_INVENTORY)
{
llSay();
llSetScriptState(name,TRUE);
llSetScriptState(thisscript,FALSE);
}
}

When I use this script it Changes the States of the others to FALSE and waits to be touched, then after touching it waits for inventory to change then turns this script off and the other on.

When I give this object to someone else and it is rezzed, None of the scripts turn off and EVERYTHING in the touch_start and changed is run.

Any Ideas? I cant think of what I need, Im sure its something - Thank-you All In advance!! :)
MadamG Zagato
means business
Join date: 17 Sep 2005
Posts: 1,402
Try this
04-15-2007 22:37
CODE
default
{

on_rez
{
state shhh;
}
touch_start
{
llSay();
}
changed
{
if(CHANGED_INVENTORY)
{
llSay();
llSetScriptState(name,TRUE);
llSetScriptState(thisscript,FALSE);
}
}

state shhh
{

state_entry(){
llSay();
llSetScriptState(name,FALSE);
llSetScriptState(othername,FALSE);
state default;
}

}
_____________________
Mickeywishes Au
Registered User
Join date: 7 May 2006
Posts: 16
04-15-2007 23:09
From: MadamG Zagato
CODE
default
{

on_rez
{
state shhh;
}
touch_start
{
llSay();
}
changed
{
if(CHANGED_INVENTORY)
{
llSay();
llSetScriptState(name,TRUE);
llSetScriptState(thisscript,FALSE);
}
}

state shhh
{

state_entry(){
llSay();
llSetScriptState(name,FALSE);
llSetScriptState(othername,FALSE);
state default;
}

}


Just tried this and it still skips all TOUCH and changed functions and All scripts are still running. - Thank you so much though :) Any other Ideas?
2k Suisei
Registered User
Join date: 9 Nov 2006
Posts: 2,150
04-15-2007 23:31
This sounds like a permissions problem. Is modify enabled on the other scripts?.

I've never tested it. But I'm guessing modify may need to be enabled on scripts in order for another owner to have the ability to disable/enable them via script.
MadamG Zagato
means business
Join date: 17 Sep 2005
Posts: 1,402
04-16-2007 00:14
Is this an attached object? If it is please read the comments on the WIKI regarding attached objects:
http://www.lslwiki.net/lslwiki/wakka.php?wakka=llSetScriptState&show_comments=1#comments
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
A few queries/ideas
04-16-2007 00:39
From: Mickeywishes Au
When I use this script it Changes the States of the others to FALSE and waits to be touched, then after touching it waits for inventory to change then turns this script off and the other on.

When I give this object to someone else and it is rezzed, None of the scripts turn off and EVERYTHING in the touch_start and changed is run.


When you give this to someone else what state is this script in? If you took the object after a change to its inventory has occurred then this script should be turned off ? Do you have a corresponding handler in the other scripts to turn it back on again?

Unless you have stripped out the code for clarity, your touch event has not effect since its not doing anything within the touch event handler that will effect how the changed event is processed.

Where are name, othername and thisscript setup/defined?

Try creating a local function which outputs which script is being turned on/off and see if its getting processed at all.

CODE

SetScriptState(string name,integer state)
{
llOwnerSay("Setting " + name + " to " + (string)state);
llSetScriptState(name,state);
}