Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Prim to Prim Content

Coldfire Nightfire
Registered User
Join date: 25 May 2008
Posts: 48
12-08-2009 06:58
Hi all
I was told that you can send contents from one prim to another if the two are linked , but I have not heard or figured out how , Suggestions please .
Also I have an app that makes a script and posts it into chat for you to copy , is there a way to have it write a new script instead of chat or put it into the discription of a different prim linked or unlinked and run it as a script .
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
12-08-2009 07:12
/me thinks http://wiki.secondlife.com/wiki/LlGetLinkKey and http://wiki.secondlife.com/wiki/LlGiveInventory may do the trick..

From: Coldfire Nightfire
Also I have an app that makes a script and posts it into chat for you to copy , is there a way to have it write a new script instead of chat or put it into the discription of a different prim linked or unlinked and run it as a script .

No can do. Nothing in LSL lets you create new assets. It can make copies of existing stuff but it cannot create new stuff. Too much potential for abuse.. (edit: and you can't have scripts write to existing scripts/notecards either)
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Coldfire Nightfire
Registered User
Join date: 25 May 2008
Posts: 48
could a person do this
12-08-2009 12:16
Hi again thanks for the reply
here is the test script I recived from chat minus the time stamps
it make a cool 1 prim chair I made Feel free to use it anyway you want , when you use it in a prim it makes you the creator, and you have my full permition to do so and use any way you wish .

CODE

default
{
state_entry()
{
list params;


// If you are cutting code out to paste into custon functions
// Define "params" as a global list and start cutting below this line.

params =
[
PRIM_TYPE,7,"d9d7af8e-0338-5d38-8d13-2c3f1c49e400",3 ,
PRIM_MATERIAL,3 ,
PRIM_PHYSICS,0 ,
PRIM_TEMP_ON_REZ,0 ,
PRIM_PHANTOM,0 ,
// It's probably not a god idea to have your new prim jump to the old one
// PRIM_POSITION,<223.848297, 29.012863, 21.456135> ] + (params = []) +
PRIM_ROTATION,<0.000000, 0.000000, 0.000000, 1.000000> ,
PRIM_SIZE,<2.790091, 3.173758, 3.615595>

];


// Set all of the above paramaters as a group.
llSetPrimitiveParams(params);
params = [];


// We are breaking the llSetPtimitiveParam([]) calls into blocks, because some params are incompatible with others
// during the same call. This is an LsL bug. See https://jira.secondlife.com/browse/SVC-38 for more info.
// Please vote to fix it.


// This prim has 1 faces.

params =
[


PRIM_TEXTURE,0,"5748decc-f629-461c-9a36-a35a221fe21f",<1.000000, 1.000000, 0.000000>,<0.000000, 0.000000, 0.000000>,0.000000

];
llSetPrimitiveParams(params);
params = [];

// Note that you -cannot- define textures and colors in the same call!
// If you're cutting out these params for your custom code watch out for this.

params =
[


PRIM_COLOR,0,<1.000000, 1.000000, 1.000000>,1.000000

];
params =
[


PRIM_BUMP_SHINY,0,3,1

];
llSetPrimitiveParams(params);
params = [];
params =
[


PRIM_FULLBRIGHT,0,1 ,
PRIM_FLEXIBLE,0,2,0.300000,2.000000,0.000000,1.000000,<0.000000, 0.000000, 0.000000> ,
// PRIM_CAST_SHADOWS,0 ,

// Planar mapping (PRIM_TEXGEN) is for correcting the what circular surfaces do to textures.
// Most builds don't use it, so it's commented out to save bytes in auto-transform code.
// The default value is 1 (distorted).
// if you are metamorphing an object that already had planar mapping (rare)
// uncomment those 0 lines.
// This may not seem like much savings
// but if your script is trying to metamorph between as many as five objects
// those few bytes saved might come in handy at the end.

// If your textures are coming out with the offsets all wrong, try uncommenting them.
// PRIM_TEXGEN,0,0 ,
PRIM_POINT_LIGHT,0,<1.000000, 1.000000, 1.000000>,1.000000,10.000000,0.750000

];
llSetPrimitiveParams(params); params = [];


// If you were cut/pasting this code into a custom transform function
// end your cut above this comment.
// Otherwise ignore this.

llSetObjectName("sculpted seat");


llSetObjectDesc("sculpted seat");


// This next line deletes the script. Comment it out if you want the script to persist

llRemoveInventory(llGetScriptName());
}
}

now what if I made a defult script listing all the commands like
PRIM_TYPE,
PRIM_MATERIAL,
PRIM_PHYSICS,
PRIM_TEMP_ON_REZ,,
PRIM_PHANTOM
and have the script that makes the one above send the paramaters to
http://w-hat.com/httpdb instead of into chat and have this script recieve the paramaters back from there to fill in what it nees to run
the site states "httpdb provides free, persistant, off-site storage for Second Life LSL Scripts via llHTTPRequest. You can store up to 250kb of data in the form of key/value pairs, and read or write the data from any script. "
I am doing all I can to learn as much and as fast as I can so I don't have to bother people .
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
12-08-2009 20:17
you can script a script parser, though I don't think you want to build one that parse more than a few specific commands and it would still be a huge drain. having people copy the chat text into a script is unfortunately the best way to go about it.

though there is one realistic work around, and that is to have a bot avatar which receives the chatted script, opens and creates the script, and optionally sends the completed script back to the sender who still has to drop it in a prim.
_____________________
|
| . "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...
| -
Coldfire Nightfire
Registered User
Join date: 25 May 2008
Posts: 48
script parser or bots
12-08-2009 20:55
Thanks for the reply
I hear alot of negativity when it comes to bots .
Not sure , but have an idea what a script parser would do.
Each line of the script comes out as a different line in chat so I thought that that a person could have the one script chat on a channel instead of to owner in chat history and have the other listen on that channel for stings or variables to fill in whats needed with llDeleteSubString to weed out whats not.
see what I'm trying to get at , or am I just confusing people.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
12-08-2009 21:20
bots have a bad reputation because of what they've been used for, but there are acceptable uses. for instance, the group inviter bot that auto invites people to a group upon request... those are actually quite popular (when they don't just randomly spam invites).

i'm not saying a parser is impossible, especially not for simple things, but functions like set prim params are very complex, and a parser for that is going to be a lot of heavy scripting, and really only good for quick testing of code segments. it's not going to be viable as a final product, because it'll use a few orders of magnitude more resources than the call itself. and with script memory limits coming up, you'll be hard pressed to make that feasible.

don't get me wrong, it sounds like a fun project, I just don't see it being widely useable.

I do know that emerald viewer has a built in parser for some stuff, but i haven't played with it, so I can't say how useful that fact is.
_____________________
|
| . "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...
| -
Coldfire Nightfire
Registered User
Join date: 25 May 2008
Posts: 48
Cool thanks for the info
12-08-2009 21:49
Good stuff to know thank you .
The script I am messing with is called Clone Primitive v2.31
Written by Clarknova Helvetic [2008.01.04] w/ thanks to Bopete Yossarian
I believe it only works with owner and I know you could just shift drag to copy your things.
The Idea i had was to make a cool looking teleporter for prim where it would send the info to another prim to rebuild your primmed item and delete the original as it it was teleported ,
From what I understand your object would have to link to the :teleporter prims ( just to name it ) , then transfer or copy contents of the item to the teleporter prin contents
collect the data of the item , delete the item , then rez a prim Link to it , transfer or copy the original items contents into the rezzed prim along with a base script that listens for the data Finaly unlink the new item.
Well it was a thought just the same thanks again for the help
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
12-08-2009 22:09
if you'll own the sending and receiving elements there's no reason to use chat coms to parse data. a single prim that links and unlinks can store all the necessary parameters, and then be sent itself (sort of like sci channels "origami truck that folds up into a cube" station call ad)... also since you are absolutely controlling the format parameters, you can simply use object email to send the parameter lists, without needing to parse lsl commands (since you know the format, you know what to do with the data)
_____________________
|
| . "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...
| -
Coldfire Nightfire
Registered User
Join date: 25 May 2008
Posts: 48
Ah light at the end of the tunnel
12-08-2009 22:20
Thank you so much , I'll look into that in the AM for sure, I figured if I gave more detail , something could come of this .
with email what would the delay be do you think until the info was recieved , I hear it can be slow. just so I know what to expect
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
12-08-2009 23:19
3 seconds IIRC, probably less if it's the same sim or connected, but then you could just use warpPos/jumpPos if it's that close.
_____________________
|
| . "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...
| -