Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Loading a script after being given to a child prim.

Alberrt Steptoe
Second Life Resident
Join date: 31 Oct 2004
Posts: 19
03-21-2009 12:20
Ok I am having issues with this.

I am getting the error: Object: Task 'Object' trying to illegally load script onto task 'Object'!

I thought that error was ig the script is not in the inventory of the receiver but it is giving it. so unsure whats the problem


Here is my giver script.

CODE


default
{
touch_start(integer total_number)
{
integer Num = llGetNumberOfPrims() + 1;
integer i;
for(i=0;i<Num;i++)
{
llGetLinkKey(i);
integer Pin = 856876;
string ScriptName = "MyScript";
llGiveInventory(llGetLinkKey(i), ScriptName);
llRemoteLoadScriptPin(llGetLinkKey(i), ScriptName, Pin, TRUE, 5);
}
}
}




Here is the script that is actually given

CODE

integer gPin = 856876;

default
{
state_entry()
{
llSetRemoteScriptAccessPin(gPin);
llOwnerSay("I am loaded");
}

on_rez(integer start_param)
{
llResetScript();
}
}



obviously I am doing more than this in my scripts these are just samples for you to see whats going on.

Please help.

- Alberrt.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
03-21-2009 19:51
pin must exist in a running script in the child prim BEFORE it can be given and activated via remote load.
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Alberrt Steptoe
Second Life Resident
Join date: 31 Oct 2004
Posts: 19
03-22-2009 00:46
Ok, So how do you pass a script to a child prim and have it running?

Thats my problem. :)

Also thank you for your reply. It is appreciated :)

- Alberrt
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
03-22-2009 07:56
From: Alberrt Steptoe
Ok, So how do you pass a script to a child prim and have it running?

Thats my problem. :)

Also thank you for your reply. It is appreciated :)

- Alberrt


you don't. you have to pass the script to the child prim(s), then take the object back into inventory, re rez it, edit it and in the tools menu set scripts to running. another way that has worked for me but was finicky is without taking it into inventory, set the scripts to running, and then recompile.
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
03-22-2009 08:38
or just have an existing script in it already to set the pin number, or use said script to turn it on after a rerez/recompile. the rerez method works best for initial setup, and pretty much your only option besides doing them all by hand.

ETA: this is why I try to use server prims containing multiple scripts to modify child prims if possible. a single server prim only need one pre-existing script to pull off the above trick(s).
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -