13.3 Products

Turning objects in products is a relatively simple process. First you will need to check the orientation of the object as when any product is rezzed (from storage, machine etc.) it is always rezzed with a rotation of <0, 0, 0> which may not be the way we expect it to look.

As an example look at this barrel object:

We would like it to be standing this way up when rezzed, but if we check we can see the the rotation x value is 90°

Setting the rotation to <0, 0, 0> gives us the barrel laying down so this is how it will appear when rezzed. 

To fix this we need to ensure that the root prim is set to the zero rotation position.

If you have an object made up of more than one prim, you may find that one of them is in the zero position, in which case you could unlink then re-link that prim to make it the root. If that isn’t an option then the solution is to add an extra prim to act as the root. We can set that to have a transparent texture so it won’t show. Note also that any float text appears above the root prim, so that may be another reason that you wish to add the ‘invisible prim’ to your object. Create and position a prim then select your object and then ‘shift select’ the new prim and link them. That way the new prim is the root. Set the prim to have the Transparent texture to hide it.

 

So now we have our object orientated to look right at the <0, 0, 0> rotation we can turn it into a ‘product’

Products contain three items, a config notecard, a sound and one script. The sound file is optional but adding one does make things more fun!

Once you have added the above items you should ensure that all three of them plus the object are set to full perms, as products may not work correctly otherwise.

Click the Permissions button to set it up:

 

(a) Script

The script is called setpin and is very simple:

// setpin.lsl
default
{

    state_entry()
    {
        llSetText("", ZERO_VECTOR, 0.0);
    }

    on_rez(integer n)
    {
        llSetRemoteScriptAccessPin(999);
    }
}	

This script clears any float text on the root prim and sets the object to allow remote installation of scripts. This means that anything that rezzes the product can now insert a copy of the latest product script on rez so your products will always be up to date each time they are rezzed.

(b) Config Notecard

All the configuration items are optional, so you only need to adjust those for you product:

# Number of days before product expires
EXPIRES=7

#(Optional) Some products require some days to mature before they  are ready to  be used (e.g. wine) . How many days to spend in maturation?
#MATURATION=0

#(Optional) Name of target such as Table, Keg store or  avatar  if interacts directly with avatar
#TARGET=SF Table

#(Optional) Extra parameter(s) that will be passed to the HUD
#EXTRAPARAM=Hungry:-5|Thirsty:-5|Drunk:-5|Sick:-5|Energy:55|Health:55|Hygiene:55|Bladder:55

#(Optional) Colour to use for float text. For no float text, use TEXTCOLOR=ZERO_VECTOR   
#TEXTCOLOR=<1.0, 1.0, 1.0>

#(Optional) When emptying the product, what color are the particles rezzed?
#FLOWCOLOR=<1.0, 1.0, 1.0>

#(Optional) If present and non-zero, will randomize the colour of prim at primlink specified
#RANDOMIZE=3

TARGET – This allows you to set the product to search for a particular surface when first rezzed and also when set down. See the sections on surfaces for more information.

EXTRAPARAM – This allows you to set parameters that will be sent to the HUD when you use a product. Note however that the HUD first looks in the the DATA_USERVALS notecard and then the VDATA_VALUES notecard and will only use the values in the product if it could not find any in the previous two locations.

You can set one or more from the available options. Setting a negative number will decrease the value of that characteristic so for example -10 for Hungry will reduce your hunger by 10%. Likewise a positive number will increase it.   The amount used willl always be 100% when using this method to set the nutrition values. 

 


Creative Commons License
This work by Buzzy Cnayl is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Based on a work at https://satyrfarm.github.io/

VivoSim Grid - Stats

7d uptime badge   24h uptime badge   1h uptime badge

GridStatus: ONLINE


Online_Now: 7

Visitors_Last_30_Days: 405

Total_Regions: 15

Login_URL: hg.vivosim.net:8002

Website: https://vivosim.net

XML format
JSON format


VivoSim Shop

donate

hg.vivosim.net:8002:Mintor

hg.vivosim.net:8002:Lugo

hg.vivosim.net:8002:Sandy Island

hg.vivosim.net:8002:Julian Beach

opensim logo