Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

SetScriptState

Kaylan Draken
Registered User
Join date: 2 Dec 2006
Posts: 127
03-01-2007 13:31
i have made a script that put on or off another script.
The script seems to working but the other script which is put off
is still running after a hour (Checked the script but the check by
running is gone).
Does somebody know what i am doing wrong?

CODE

integer chan = 2; //This is the channel the script will listen to.

default
{
state_entry()
{
llListen(chan, "", llGetOwner(), "");
}

listen(integer channel, string name, key id, string message)
{

message = llToLower(message); //convert message to lowercase

if(message == "on")
{
llSay(0, "Teleport On");
llSetScriptState("Teleport Script",1);
}
if(message == "off")
{
llSay(0, "Teleport off");
llSetScriptState("Teleport Script",0);
}
}
}


The teleport script is only use for testing if it works i want to set more script on or off
the script are both in the same single prim.
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
03-01-2007 14:01
So, it responds by saying "Teleport On" or "Teleport Off"?

And you are sure that the name of the other script is "Teleport Script"?

(just so we're clear so far . . . )
Kaylan Draken
Registered User
Join date: 2 Dec 2006
Posts: 127
03-01-2007 14:21
its responds to '/2 on' or '/2 off' and the name of the script is good.
and the checkbox Running from the script 'Teleport Script' goes on or off but
the teleport script still works when the checkbox running is out (empty).

i thought its maybe the lag but after more than a hour the teleport script is still
working and the checkbox running from the teleport script is still out (empty)
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
03-01-2007 14:49
When you say it's still running... are you sure? For example, from the wiki:
From: LSL Wiki llSitTarget
Note: like particles, sit targets are a property of the prim, not the script. So if a script gives a prim a sit target, and that script is deleted, the sit target remains. The only way to clear the sit target is by calling llSitTarget(ZERO_VECTOR,ZERO_ROTATION);
...which might give some illusion that a teleport is still active.
Kaylan Draken
Registered User
Join date: 2 Dec 2006
Posts: 127
03-01-2007 22:39
yes the Teleport script is still running because i used it to teleport to another room.

Is there another way to make a script active/inactive from another script?
Stephen Zenith
Registered User
Join date: 15 May 2006
Posts: 1,029
03-02-2007 02:31
From: Kaylan Draken
yes the Teleport script is still running because i used it to teleport to another room.

Is there another way to make a script active/inactive from another script?


I'm assuming your teleporter uses a sit target? Sit targets are a property of the prim, not the script - although they are configured and enabled by scripts. So even with the script disabled, the sit target would still be active, which would be giving you the teleport effect.
_____________________
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
03-02-2007 02:44
As both Pale and Stephen have already stated the sit target is a property of the prim, once set it is persistant. The script is is in the same prim so send it a linked message to set the sit target to 0,0,0 in the other script before you disable it.
Kaylan Draken
Registered User
Join date: 2 Dec 2006
Posts: 127
03-02-2007 11:24
Thanks guys, its working now.