|
Sally LaSalle
Registered User
Join date: 29 Aug 2006
Posts: 4
|
08-30-2007 08:36
What are the current best ways, to be able to refer to "library" functions that I may have created? Am I stuck with adding them to each script? Do I use some form of convoluted message passing and message return? Is there some syntax that I have completely missed for calling a function in one script from another script?
tia Sal
|
|
Shadow Subagja
Registered User
Join date: 29 Apr 2007
Posts: 354
|
08-30-2007 09:03
either or, though the expense (and limitation) of messaging around just to centralize your code can sometimes outweigh any benefits. Honestly.. I keep copies of all my 'utility' code in my inventory, and cut and paste to a top section of new scripts.
SOME code, as in control logic that is common to some scripts or vehicles etc I do give their own script each time, but only because it is a win for performance as well.
|
|
Sally LaSalle
Registered User
Join date: 29 Aug 2006
Posts: 4
|
"Library" Script Organisation
08-30-2007 10:51
Thanks Shadow,
Would other scripters support the ability to call functions in other scripts within the object inventory? e.g
New_script1 function1(){} function2(){}
state_entry(){}
New_script2 touch_start(integer num){ // I propose a dot notation to access functions in another script New_script1.function1(); New_script2.function2();
}
|
|
Sally LaSalle
Registered User
Join date: 29 Aug 2006
Posts: 4
|
"Library" Script Organisation
08-30-2007 13:05
vote for ability to call functions in other scripts. https://jira.secondlife.com/browse/VWR-2274
|
|
Cynthia Centaur
Registered User
Join date: 31 Oct 2006
Posts: 22
|
08-31-2007 01:05
Commented and voted
a good idea that I also think about for some weeks.
Although I think, it's wrongly placed in the viewer section as code execution is part of the server
Best regards Cynthia
|
|
Ed Gobo
ed44's alt
Join date: 20 Jun 2006
Posts: 220
|
08-31-2007 04:51
I think I would rather that LL spent their efforts to implement mono, much better return on effort!. This could come later after mono is established.
|