Missing functions
|
Silarsis Lioncourt
Registered User
Join date: 6 Jan 2005
Posts: 2
|
01-13-2005 13:33
Hi all, Just started scripting, and I'm missing how to do a few things, and wondering if it's possible that certain abilities would be added to scripting if there were a demand...? The first is, I can't seem to figure out how to get my own ID from a script. I'm sure it should be doable, I just can't find the right function. The second is, I'd dearly love to be able to create scripts from scripts. The particular reason for this is, I'm used to working in cvs with something like Eclipse for a dev environment, and I figure with RPC support, I should be able to write a script that cvs up's on command, and maintain my object's scripts in cvs... But the missing piece of getting that to work appears to be the ability to create or update a script object's source code from another script. Is there any way to ask the Second Life people for support for this, and if so, what's the chances they'd add it, do you think? 
|
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
|
01-13-2005 13:45
In response, first, getting your ID from a script is very easy: llSay(0,(string)llGetOwner()); //or llSay(0,(string)llGetCreator()); ... depending on how you want to go about distributing the script. Also, there is no formal way for a script to output any file type in Second Life. While you can use a script to photocopy, send, or transplant existing objects, scripts, etc into another object via the RemoteScriptPin or llGiveInventory feature, any writing to a file is prohibited at the code level. This does not mean, however, that you can't figure a creative solution with XML-RPC here or in the future - but for now, I would suggest doing things by hand or with those calls. 
|
Silarsis Lioncourt
Registered User
Join date: 6 Jan 2005
Posts: 2
|
01-13-2005 14:51
From: Jeffrey Gomez In response, first, getting your ID from a script is very easy: llSay(0,(string)llGetOwner()); //or llSay(0,(string)llGetCreator()); ... depending on how you want to go about distributing the script. Sorry, I phrased that badly, obviously. If a script is attached to an object, how does the script find the object's ID? I know how to find the creator or owner of the object's ID, as per above, but for some scripts I'm working on, I'd like to be able to find out the script holder's _own_ ID... From: Jeffrey Gomez Also, there is no formal way for a script to output any file type in Second Life. While you can use a script to photocopy, send, or transplant existing objects, scripts, etc into another object via the RemoteScriptPin or llGiveInventory feature, any writing to a file is prohibited at the code level. This does not mean, however, that you can't figure a creative solution with XML-RPC here or in the future - but for now, I would suggest doing things by hand or with those calls.  RemoteScriptPin and llGiveInventory allow me to move scripts around, but creation of scripts seems to have to take place by hand through their editor. Ideally, I could write something that grabbed script source code from XML-RPC, created a script using that source code, then used the existing methods to attach that script to something. I also can't treat a notecard as script source, or do anything else (afaics) that'd allow me to change or create script source code programmatically.
|
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
|
01-13-2005 15:57
As for the object's key, llGetKey() does the job. And I believe anything to alter the source of a running script at the code level are purposefully left out to prevent abuse. 
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
01-13-2005 16:11
Think you are looking for: llGetKey()
You can't create anything with a script. You can rez objects but that doesn't exactly count as the object was already created; particles don't really exist.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly
Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey
|
Caoimhe Armitage
Script Witch
Join date: 7 Sep 2004
Posts: 117
|
01-14-2005 08:55
From: Silarsis Lioncourt I'm used to working in cvs with something like Eclipse for a dev environment, and I figure with RPC support, I should be able to write a script that cvs up's on command, and maintain my object's scripts in cvs... ) Well I *do* use CVS for my scripting work (had too many objects disappear entirely), but I just use it a step removed. I edit everything off-world and just paste into my in-world scripts. Ctl-A, Ctl-C, click, click, Ctl-V, Ctl-S and off you go. I almost do it in my sleep. HTH - C
|
Buckminster Hamilton
One Cool Cat
Join date: 27 Dec 2003
Posts: 10
|
01-14-2005 09:27
From: Strife Onizuka You can't create anything with a script. You can rez objects but that doesn't exactly count as the object was already created; particles don't really exist.
It's worth noting, however, and not obvious to scripting newbies, that you can create multiple copies of an object, and that object can carry with it a script that customizes nearly all aspects of its shape, size, appearance and behavior. Thus, complex structures can be designed and scripted to materialize from an object that contains a single prim.
|