Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

What's the next best thing to the command End u ppl can come up with?

Manuel Paz
Registered User
Join date: 20 Oct 2005
Posts: 10
01-10-2006 17:45
.
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
01-10-2006 17:50
CODE
llInventoryRemove(llGetScriptname());

That'll halt the script!
_____________________
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
01-10-2006 18:07
llDie();
Jokey Domela
Registered User
Join date: 27 Jul 2005
Posts: 83
01-10-2006 18:32
CODE

{
.
.
.
state end;
}

state end {
state_entry() {

}
}
Manuel Paz
Registered User
Join date: 20 Oct 2005
Posts: 10
01-10-2006 20:39
Thank you for your contributions!

However. Deleting the script is a tad radical, maybe (though it sure as hell will work!) And changing state is a nice idea too, but it won't work for me because I need to do it from a function; and if I change state from a function (using the known hack -- if (TRUE) state foo) the actual change won't occur until the function returns and the current event finishes. See, I have a DoError() function which receives an error message as an argument, llOwnerSay's it and then calls the quits.

So. Keep'em coming ;o)
Fenrir Reitveld
Crazy? Don't mind if I do
Join date: 20 Apr 2005
Posts: 459
01-10-2006 21:24
If you want your script to just immediately bug out and end from a function -- That's kinda impossible with the event nature of scripts.

Best bet would be to just arrange the logic so that early bailout is possible, it just skips the rest of the function and then does a state change upon end.
Jora Welesa
Dark Lady of the Sith
Join date: 11 Jul 2005
Posts: 153
01-10-2006 21:30
CODE


llSetScriptState(llGetScriptName(),FALSE);



Basically turns the script off. Have it spit out an ugly, terse, microsoft-ish error message, right before the call to the above function, using no less than a 24 character hexidecimal number and an obscure page-fault error to bewilder people. ;)
_____________________
Fenrir Reitveld
Crazy? Don't mind if I do
Join date: 20 Apr 2005
Posts: 459
01-10-2006 21:45
Don't forget popping up about eight dialog boxes about permissions not set, and so on.

Good call, I forgot about the script deactivation command. Though I am not sure if the OP wanted the script to just bail and stop and be an inert mass from that point onwards -- Or exit and still respond to events. :)
Jora Welesa
Dark Lady of the Sith
Join date: 11 Jul 2005
Posts: 153
01-10-2006 21:57
From: Fenrir Reitveld
Don't forget popping up about eight dialog boxes about permissions not set, and so on.

Good call, I forgot about the script deactivation command. Though I am not sure if the OP wanted the script to just bail and stop and be an inert mass from that point onwards -- Or exit and still respond to events. :)


That would depend on how "Windows-like" he or she wants it. Could even include a prim rez with the Blue screen of death. :D

Truthfully, even on scripts without mod permissions, you can still set it back to running by going to Tools-Set scripts to running in selection. Or while debugging, you can create another script that will check the first scripts state, restart it, then reset it.
_____________________
Kairen Overdrive
Registered User
Join date: 12 Jul 2005
Posts: 38
01-10-2006 23:24
CODE
return;
Kayla Stonecutter
Scripting Oncalupen
Join date: 9 Sep 2005
Posts: 224
01-11-2006 00:31
From: Manuel Paz
Thank you for your contributions!

However. Deleting the script is a tad radical, maybe (though it sure as hell will work!) And changing state is a nice idea too, but it won't work for me because I need to do it from a function; and if I change state from a function (using the known hack -- if (TRUE) state foo) the actual change won't occur until the function returns and the current event finishes. See, I have a DoError() function which receives an error message as an argument, llOwnerSay's it and then calls the quits.

So. Keep'em coming ;o)

CODE
integer DoError(string ErrorMessage)
{
if(ErrorMessage == "Crash") return TRUE;
else return FALSE;
}

default
{
state_entry()
{
integer CheckError = DoError("Crash");
if(CheckError) state End;
llOwnerSay("Should not get here :P");
}
}
state End
{
state_entry()
{
llOwnerSay("I like, crashed and stuff.");
}
}
:D
_____________________
Manuel Paz
Registered User
Join date: 20 Oct 2005
Posts: 10
01-12-2006 20:09
llResetScript() seems to work from a function, in that it doesn't return to the calling event. And running the whole thing again from the start is fine. But. Although state_entry in default state is called after that, other events seem to no longer be detected.