|
revmachine Undset
Registered User
Join date: 26 Oct 2006
Posts: 3
|
12-09-2006 16:25
I'm trying to figure out a way to have a shared set of defined functions between different scripts. Some scripts are in linked sets of objects and some are not.
It seems that while a prim can have multiple scripts running simultaneously but that they do not talk directly to each other. You can also have prims talk to each other but still not really call each others defined functions.
So, is the only way to have a shared library is by defining all the same functions above each script being used?
I tried searching on this and asking around SL....so if there is already a thread or website that details solutions for this please just respond with those.
Thanks in advance.
|
|
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
|
12-09-2006 16:30
There is no way to create a shared library to my knowledge.
_____________________
My SLExchange shopTypos are forgiven; desecrating the english language with reckless abandon and necrophilic acts is not. The function is working perfectly fine. It's just not working the way you wanted it to work.
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
12-10-2006 04:10
What you need to remeber is that each script is efffectively a different process and has no knowledge that any other scripts even exist.
As you said, you can call a function in another script indirectly using either email, standard chat, or if a linked set a linked message, but you then have to listen for the responces.
To use a 'library' function you do have to include it in each script that wants to use it, but you can automate that slightly using Scite-eZ. If you have visual studio installed, Scite-eZ can be configured to use the preprocessor to allow the use of #define, #include etc.
|
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
12-10-2006 06:29
From: Newgate Ludd To use a 'library' function you do have to include it in each script that wants to use it, but you can automate that slightly using Scite-eZ. If you have visual studio installed, Scite-eZ can be configured to use the preprocessor to allow the use of #define, #include etc. You can download a free (Express) copy of VC++ or use the C++ dev kit from MS; OR you can use GCC; all free software that will do the preprocessing for you. I like GCC's preprocessor over MS's. I use ESL (what we call passing LSL through a C preprocessor) extensively.
_____________________
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
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
12-10-2006 08:03
From: Strife Onizuka You can download a free (Express) copy of VC++ or use the C++ dev kit from MS; OR you can use GCC; all free software that will do the preprocessing for you. I like GCC's preprocessor over MS's.
I use ESL (what we call passing LSL through a C preprocessor) extensively. Same here. I heavily comment my original scripts as an ESL file and use your white space stripper while processing to an LSL file. Best of both worlds!!!!
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
12-10-2006 14:11
hmmm, my post was poorly worded. Any preprocessor could probably be configured to work. I use VC extensively for work so its the one I have set up.
|
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
12-11-2006 06:48
From: Jesse Barnett Same here. I heavily comment my original scripts as an ESL file and use your white space stripper while processing to an LSL file. Best of both worlds!!!! I've taken to adding another optional step, sending it through an C beautifier. I use "indent" http://gnuwin32.sourceforge.net/packages/indent.htmhttp://mysite.wanadoo-members.co.uk/indent/beautify.htmlWith these settings it won't strip existing whitespace and will insert it. Still not totally happy with it but it's all personal preference how you want your code cleaned. It's a necessity step if you use really long multi-line macros. //%1 = input //%2 = output indent %1 -o %2 -nbad -nbap -bbo -nbc -br -brs -c0 -cd33 -cdb -ce -ci4 -cli0 -cp33 -di12 -hnl -i4 -l130 -npcs -nprs -npsl -saf -sai -saw -sc -nsob -nss -ts4
_____________________
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
|