Bright Loader

Drop this script onto objects to copy items between them, or to and from a HUD!

DESCRIPTION

The Bright Loader is a script which can automatically copy the contents of one object into another.

Just drag it from your inventory and drop it onto the source object (from which you wish to copy), drop it again onto the target object (to which you wish to copy), click [COPY] in the pop-up menu box, and all the items in the source object's root prim will be copied to that of the target object.

A HUD is also provided, which is just a small prim containing the same "Bright Loader" script. You can wear this, and copy items between the HUD and the objects around you: making the HUD a handy conduit between objects in different locations.

But why is "loading" useful?

Some residents regularly have to keep groups of objects updated with the same contents. If you do this, you will know how tiresome a chore this can be, and worse, how easy it is to make mistakes while doing it by hand.

For instance, if you have vendors in various shops spread across the grid, you may have to regularly update the range of products kept in those vendors. You could rez new vendors to replace them, of course: but only if you've retained your group membership at each site. Even then, you'll have to delete the old vendor, move, turn and resize the new one to replace it, and run through the vendor's configuration settings as you did when you installed the original.

Or if you maintain a line of products - say, a range of sports cars - you may need to load the same basic set of animations and scripts into each model, and then load them all again each time this basic item set changes. Again, you could drag and drop items from your inventory into each car manually, but this is error prone, and you'll be aware that the prim "Contents" window sometimes takes its own sweet time updating to reflect changes.

The Bright Loader automates a chore which will be familiar to many creators and business owners in Second Life. Its creator is one of them, and she wrote it for her own use. It is offered, free and with our compliments, in case it helps you too.

INSTRUCTIONS

To unpack, drag the "Bright Loader boxed" object from your inventory onto the ground to rez it. Right-click it, click "Open" from the pop-up menu to open a contents window, and click the "Copy To Inventory" button at the bottom. This will create a folder called "Bright Loader boxed" in your inventory.

In this folder, you will find three items.

Bright Loader - the script

Bright Loader HUD - the wearable HUD

Bright Loader note - the manual

LOADING ITEMS

Drag the Bright Loader script from your inventory, and drop it onto the source object.

Then drop the same script onto the target object.

The following pop-up will appear...

--- OBJECT-TO-OBJECT MODE ---
SOURCE: Object A
Copy non-scripts? YES | Copy scripts? YES | Run? YES
TARGET: Object B
Keep non-scripts? NO | Keep scripts? NO | Reset? N/A

[COPY]
[DUMMY RUN] [CANCEL] [REVERSE]
[Copy non-s] [Copy scripts] [Run scripts]
[Keep non-s] [Keep scripts] [Reset scripts]

Just click [COPY]. Everything will be removed from the target object's root prim, and everything from the source object's will be copied into it. Both "Bright Loader" scripts will then delete themselves.

If you choose not to go ahead with copying, click [CANCEL] to remove the scripts from both objects.

[07:04] Object A: You clicked CANCEL. Bright Loader script self-deleting.
[07:04] Object B: The other script has stopped. Bright Loader script self-deleting.

To ensure no "Bright Loader" script is ever left in an object by accident, if you ignore the menu, they will delete themselves after 60 seconds.

[07:06] Object A: Waiting time expired. Bright Loader script self-deleting.
[07:06] Object B: The other script has stopped. Bright Loader script self-deleting.

DUMMY RUNS

Click [DUMMY RUN] to see what clicking [COPY] would do, but without actually doing it.

You will see a report like this:

[04:29] Object B: *** PREPARING ITEMS (DUMMY RUN)
[04:29] Object B: [-] REMOVE: Item (a) (object)
[04:29] Object B: [-] REMOVE: Item (b) (object)
[04:29] Object A: *** GIVING ITEMS (DUMMY RUN)
[04:29] Object A: [+] COPY: Item I (object)
[04:29] Object A: [+] COPY: Item II (object)
[04:29] Object A: [+] COPY: Item III (object)
[04:29] Object A: [+] COPY: Item IV (object)
[04:29] Object A: [*] COPY (AND RUN): Script I (script)
[04:29] Object A: [*] COPY (AND RUN): Script II (script)
[04:29] Object A: Loaded 'Object B'.
[04:29] Object B: *** RESETTING SCRIPTS (DUMMY RUN)
[04:29] Object B: No scripts to reset.
[04:29] Object B: Loaded by 'Object A'.

Note that - apart from the "(DUMMY RUN)" indicators - this is exactly the same as the report you will see when you click [COPY].

The report is broken into three parts.

Firstly, under "PREPARING ITEMS", you will see which items in the target object will be removed, and which retained.

Secondly, under "GIVING ITEMS", you will see which items in the source object will be copied, and (if they are scripts) whether they will be set running.

Finally, under "RESETTING SCRIPTS", you will see which scripts originally in the target will be reset.

CHANGING SETTINGS

You can click the following buttons to change settings governing the copying process.

[REVERSE]

By default, things will be copied from the first object into which you drop a script, and into the second. Click [REVERSE] to switch this direction back and forth.

[Copy non-s]

Click to determine whether non-script items will be copied.

[Copy scripts]

Click to determine whether scripts will be copied.

[Run scripts]

Click to determine whether scripts copied into the target object will be set to "running". (Note that if you don't enable "Copy scripts", this will be set to "N/A", as naturally, you cannot run copied scripts if you don't first copy them.)

[Keep non-s]

Click to determine whether non-script items already in the target will be kept. If not, they will be cleared before new items are copied over. (Note that if you haven't enabled "Copy non-scripts", this will be set to "N/A", and non-script items in the target will be kept automatically.)

[Keep scripts]

Click to determine whether scripts already in the target will be kept. (Note that if you haven't enabled "Copy scripts", this will be set to "N/A", and scripts in the target will be kept automatically.)

[Reset scripts]

Click to determine whether scripts in the target will be reset once copying is complete. This can be useful if the script needs to restart to detect that there are new items in the target. (Note that if you set "Keep scripts" to "NO", this will be set to "N/A", as naturally, you cannot reset scripts which you did not keep.)

USING THE HUD

The Bright Loader HUD is just a small cube containing a copy of the Bright Loader script.

To use it, just find it in your inventory, right-click, and 'Wear' it. A small logo will appear at the bottom your screen.

Click it to display the HUD menu:

--- HUD CONTROL ---
Drop the 'Bright Loader' script onto an object
to transfer items between it and this HUD.
(HUD ITEMS: 0 | Non-scripts: 0 | Scripts: 0)

[GET SCRIPT] [ITEM REPORT]
[CLEAR HUD] [RESET HUD] [DETACH HUD]

Click the buttons on this menu to do the following:

[GET SCRIPT]

Be given a fresh copy of the "Bright Loader" script to drop into other objects.

[ITEM REPORT]

List the items (if any) in the HUD.

[CLEAR HUD]

Remove all items (if any) from the HUD.

[RESET HUD]

Also removes all items, and resets all settings to factory defaults.

[DETACH HUD]

Stop wearing the HUD.

COPYING TO AND FROM THE HUD

While wearing the HUD, dropping the "Bright Loader" script onto an object will display a menu similar to the one you saw above.

--- OBJECT-TO-HUD MODE ---
SOURCE: Object A
Copy non-scripts? YES | Copy scripts? YES | Run? N/A
TARGET: Bright Loader HUD #001
Keep non-scripts? NO | Keep scripts? NO | Reset? N/A

[COPY]
[DUMMY RUN] [CANCEL] [REVERSE]
[Copy non-s] [Copy scripts] [Run scripts]
[Keep non-s] [Keep scripts] [Reset scripts]

Note a few differences:

1. The words "OBJECT-TO-HUD MODE" appear at the top (in place of "OBJECT-TO-OBJECT MODE").

2. Because the HUD is empty, it automatically becomes the target object: items will be copied into the HUD. If it were full, the menu would show the HUD as the source object ("HUD-TO-OBJECT MODE"). Click [REVERSE] to switch this back and forth as you need.

3. "Run?" and "Reset?" both show "N/A". This is because scripts are never set to "running" while they are in the HUD. But when the HUD is the source object, rather than the target, these options will be available again. This allows you to set scripts running again when the are copied from the HUD into another object.

There is one other difference which is not immediately obvious:

4. Normally, "Bright Loader" scripts are deleted automatically from both objects once copying between them is complete. However, the script is never deleted from the HUD.

This also means you can remove and rewear the HUD, and it will still remember the settings you last chose.

CREATING TEMPLATE HUDS

You may wish to keep a range of "template" HUDs, each loaded with the set of items required by a particular type of object.

For instance, you may have vendors installed at a series of shops: each selling your range of hats.

Let us say you have just restocked one of these vendors with new and restyled hats. You will now want to transfer its updated contents to vendors at other shops.

You could use the "Bright Loader HUD" object, but as this is a job you may have to do again in the future, you may wish to create a "template" HUD specifically to update your hat vendors.

First, find the Bright Loader HUD in your inventory. Right-click it, click 'Copy', and then 'Paste' a new copy. Rename it to 'Hat Vendor HUD', and wear it.

Click the HUD. If it is not empty, click [CLEAR HUD]. Then drop the Bright Loader script onto your updated hat vendor, and click [COPY] to duplicate its items in your HUD.

Because the HUD is empty, the default copy direction will be into the HUD.

Now teleport to the other shops from which you sell hats. Drop the Bright Loader script onto each vendor. Because the HUD is full, the default copying direction will now be from your HUD to the vendor: just click [COPY].

Once finished, click your HUD, and click [DETACH HUD]. Keep it in your inventory, stocked with your current hat range. When you set up new vendors in the future, you can use it to load them up. By keeping a range of named HUDs, you can keep as many "template" item sets as you need.

ITEM NAME CLASHES

Unlike your inventory, objects cannot contain two items with the same name.

Let us say that your source object and target object both contain a notecard called "My Notecard", and you have "Keep non-scripts?" set to "YES".

When you click [COPY], the version of "My Notecard" from the source will be copied, and saved in the target as "My Notecard 1".

Scripts are handled slightly differently, though.

To prevent scripts being automatically duplicated over and over again, Second Life will *not* automatically rename copied scripts to avoid clashes. It will simply overwrite the original script with the same name.

This is the safest thing to do. Normally, if you are loading a new script, you will not want to keep the existing script with the same name, as it's probably just an older version.

TIPS

* When you are creating HUDs you plan to keep and use repeatedly, copy an empty "Bright Loader HUD" and rename the copy *before* wearing it for the first time. If you don't, you won't be able to rename it while wearing it, and once you have taken it off, you'll find it hard to know which of the two "Bright Loader HUD" objects now in your inventory you need to rename.

* Make sure you have safe copies of all the items in your rezzed objects. The Bright Loader will clear items from an object if you ask it to, and items deleted from a rezzed object are *not* sent to your Trash folder by Second Life, so if you do this by accident you may lose them permanently. Be especially careful with no-copy items. The Loader will transfer these from one object to another, but as they are no-copy, Second Life will automatically remove them from their original object.

* To avoid being accidentally left in an object, any Bright Loader script will automatically disappear once it has finished copying, or if it doesn't establish contact with another script, or if you fail to click any menu buttons, within a minute or so. If you aren't ready to click "COPY", but do want to stop the scripts "timing out", just click "DUMMY RUN" to restart the waiting period.

* You cannot wear two HUDs at once. If you are wearing HUD A, and then attach HUD B, HUD A will automatically detach itself. If you wish to transfer items from HUD A to HUD B, create an empty prim, wear HUD A and copy its items to the prim, then wear HUD B and copy the items back from the prim.

FOR MORE INFORMATION CONTACT...

Shan Bright
Chief Executive Officer