Jump to content

Recommended Posts

I build tracks and other buildings, make mesh and dabble in scripting. One of the shortcuts i wondered about was to replace the tedious task of dropping scripts individually in 100 - 200 pieces of track (easily possible via drag and drop inworld). I tried selecting multiple pieces but then they will not allow one script to go into to all the pieces. I had hoped to do it via scripts but so far I have not found a method which works. In all cases I have to have a script in the prim I'm trying to drop the script in for it to work - which kind of defeats the point. Does anyone know of a way (function) to use a script/hud etc to drop a script into an empty prim, via for example - touch, collision etc. I dont need a full script, just a pointer to how it may be done (although I think it might not be possible). Thanks

Share this post


Link to post
Share on other sites

You can always use llGiveInventory to send items from one object to another.  There are two big limitations.  First, the giver and receiver must be in the same region (unlike when an object gives inventory to an avatar).  Second, when you give a script, it arrives Not Running.  The first limitation may not be a big deal for you, but the second one needs some forethought.  If you already have another script in the object that will recognize that a new script has just been added,it would be tempting to use llSetScriptState, but that won't work.  Your only option is to have the receiving object scripted to use llRemoteLoadScriptPin.  I suspect that's what you are hoping to avoid, though, right?

  • Like 2

Share this post


Link to post
Share on other sites
Posted (edited)

One alternative to llRemoteLoadScriptPin, after having distributed the scripts to all required objects, is to select all of them (at the same time) and going to Build > Scripts > Set Scripts to Running. It's a slightly manual process, but it could be faster and definitely easier.

Edited by Wulfie Reanimator
  • Like 3

Share this post


Link to post
Share on other sites
29 minutes ago, duenorth said:

I build tracks and other buildings, make mesh and dabble in scripting. One of the shortcuts i wondered about was to replace the tedious task of dropping scripts individually in 100 - 200 pieces of track (easily possible via drag and drop inworld). I tried selecting multiple pieces but then they will not allow one script to go into to all the pieces. I had hoped to do it via scripts but so far I have not found a method which works. In all cases I have to have a script in the prim I'm trying to drop the script in for it to work - which kind of defeats the point. Does anyone know of a way (function) to use a script/hud etc to drop a script into an empty prim, via for example - touch, collision etc. I dont need a full script, just a pointer to how it may be done (although I think it might not be possible). Thanks

Best way would be to use a rezzer HUD that holds the object modules in the contents and rezzs a copy. If you mean a railway track type thing then you can use a skeletal structure that is invisable for location. llRemoteLoadScriptPin i find rather klunky. And when tested i found it somewhat erratic depending on sim load.

Share this post


Link to post
Share on other sites
29 minutes ago, Wulfie Reanimator said:

Build > Scripts > Set Scripts to Running.

I seem to recall that the last time I did this, I had to do Compile Scripts (Mono) or whatever it's called, instead of setting the scripts running. Or maybe I'm only imagining this, but if setting them running doesn't work, maybe try the compile option.

  • Thanks 1

Share this post


Link to post
Share on other sites
1 hour ago, duenorth said:

I build tracks and other buildings, make mesh and dabble in scripting. One of the shortcuts i wondered about was to replace the tedious task of dropping scripts individually in 100 - 200 pieces of track (easily possible via drag and drop inworld)...

FYI. Now you do not mention, why you need a script in each section, but if it is to position, change textures/light/color etc llSetLinkPrimitiveParamsFast() is your friend here. You only need one script in the root prim. Something like this:

Determine number for prims with llGetNumberOfPrims()

Use a for-loop to change: llSetLinkPrimitiveParamsFast(LINK_SET, [ PRIM_LINK_TARGET, i, PRIM_POSITION, position ])

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, Qie Niangao said:

I seem to recall that the last time I did this, I had to do Compile Scripts (Mono) or whatever it's called, instead of setting the scripts running. Or maybe I'm only imagining this, but if setting them running doesn't work, maybe try the compile option.

I experienced the same last time i dropped scripts from my inventory into an object from another project , had to do both - Recompile Scripts Mono and Set Scripts to Running.

  • Like 1

Share this post


Link to post
Share on other sites
1 minute ago, Rachel1206 said:

I experienced the same last time i dropped scripts from my inventory into an object from another project , had to do both - Recompile Scripts Mono and Set Scripts to Running.

Issue with that is it is a seperate asset. Mono scripts share resources from an original compile.

  • Like 2

Share this post


Link to post
Share on other sites
Posted (edited)

Thanks for all the ideas. I'll go through each one but I suspect I have investigated most of these and given then up as requiring a script to add a script. The pieces I'm trying to add to have no scripts. They are rezzed pieces of track - full perm but from a no mod hud. Essentially I want to use scripts instead of manually changing each pieces name and add other scripts to make ready to drop into a rez box, texture it. If the track is 200 pieces that's 600 processes straight off. Of course last stage is to delete all the scripts in all the pieces to clean up.

 

Edited by duenorth
Spelling

Share this post


Link to post
Share on other sites
Posted (edited)

Btw ...mod keys sounds interesting but if on for linksets no use in my example as the tracks are large and span a whole SIM so not really linkable to any great extent.

 

Edited by duenorth
Spelling

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...