Script: Bed Cover Rezzer AVsitter plugin
Documentation · Bed Cover Rezzer AVsitter plugin
Thank you for having considered this script to enhance the quality of your products. Please read the following instructions carefully, especially the ones explaining which permissions to apply to the scripts for the next owner. Failure to complete this task INVALIDATES the license governing your use of this set of scripts. Should you have problems, please fill the scripts assistance form, explaining what you did and what happened, and I'll get back to you.
IMPORTANT! The script contains a check to prevent accidental give-aways. If you haven't set permissions correctly in your inventory, then the script will self delete when you try to use it. The best way to ensure you set permissions correctly is by doing it NOW in your inventory.
Follow these directions carefully. Complete the Step by Step Guide in the first place and then go to the Advanced Setup section for a detailed explanation of all the features. There's a Troubleshooting section at the end. Before asking for help, check that your problem isn't one of the problems described in there.
License of Use: Click here to read the License of use.
What's included in your purchase
Check that your box contains the following assets:
- [Black Tulip] Bed Cover - AVsitter Plugin
- [Black Tulip] Bed Cover - AVsitter Plugin ~CFG~
- [Black Tulip] Bed Cover - PROP
- [Black Tulip] Bed Cover - AUXILIARY TOOL
- [Black Tulip] Proof Of Purchase - Bed Cover v1
- [Black Tulip] Bed Cover - AVsitter Plugin ~DOC~
and these sample assets, necessary to follow the step-by-step guide:
- [Black Tulip] Bed Couple #1 w.AO - START HERE
- [Black Tulip] Bed Couple #1 w.AO - FINISHED
- [Black Tulip] Bed Couple #1 w.AO - EMPTY for AUXTOOL
- [Black Tulip] Bed Couple #1 - Cover 1 AO
- [Black Tulip] Bed Couple #1 - Cover 2 AO
- [Black Tulip] Bed Couple #1 - Cover 3 AO
If any of these is missing, contact Auryn Beorn for a replacement. Keep in mind that sample assets are never provided in full perms state. They're included to illustrate how to use the script.
- Rezzes a set of props depending on the selected animation in AVsitter. This set of props can be one cover, one cover with pillows in a certain position...
- The rezzing props behaviour can be altered via menu so we can have always the same prop no matter the animation, or no props at all
- The user can also rez decorative props when no one sits
- It doesn't de-rez and rez the same set when it's present
- Props derez when the master object (the bed) isn't present
- Included auxiliary tool
What does this script do?
Before proceeding with the step by step guide, let's see first the script in action, to know which specific features we'll be setting up. In order to do this, rez the [Black Tulip] Bed Couple #1 w.AO - FINISHED object. Warning! The object plus the cover it will rez has a combined LI of 10. Make sure you have room enough before attempting to rez it.
The first thing we'll notice is that a cover is immediately rezzed.
When we move the mouse over the set, we see an icon that lets us know that if we click on the object, we'll sit immediately. Notice though that no icon shows over the bed cover: that's because the bed cover isn't linked, so we can't sit nor get access to the options by clicking on the cover. Make sure to clarify this bit to your customers in your own documentation.
Now, if we right click on the object, we see the Touch option show up.
Lets us click on it: it shows a menu.
So this is the first important feature of the script: When no one is sitting, we can still decide to have a decorative set rezzed, or Laundry Day, which will delete the existent set. For example, we can have 8 sets of props and decide that this decorative menu (no avatars sitting) will show only four of them. We'll see in the step by step guide how to do it. For now, let's continue exploring the object. We do this by sitting on it, and a prop associated to the current animation played will rez. How do we do this association? We see this in the step by step guide.
When we change the pose, we can associate to it a different set of objects if we want.
We can have a default set of objects when there are avatars sitting, and associate only some animations to different sets. We can also tell AVsitter to call our [BED] menu and in it, find that it has a different aspect than when no one was sitting:
When we click on Default, we're saying this: "the objects rezzed will be those related to the selected pose, according to the notecard". When we click on Always Off, no props will be rezzed and the current ones will be deleted. This will leave a clear bed while the poses change. And when we click Always On, first, we get a very similar menu to the one we got before sitting:
Indeed so similar, that the only thing that changes is which sets are showing up. As soon as we select one set, that set will stay rezzed no matter which animation we select from the AVsitter menu. If we want to go back to changing the props depending on the animation, we will select Default.
Feel free to use this documentation to write your own, for your customers.
This script is somewhat complex so before we enter the step by step guide, we'll give some important definitions.
Set: A set is a set of objects that will be rezzed at the same time. A set may have only one object, or it may have several objects. It will have an unique name among all the other sets that we define. This means that every set must have a different name.
Object: An object is defined by three parameters: the name of the object in the inventory of the main object, its position when rezzed, and its rotation when rezzed. There's included an auxiliary tool that will help us obtain all these values.
In use: When we say that a set should show up when in use, we mean that there are avatars sitting on the main object.
Not in use: When we say that a set should show up when not in use, we mean that there are no avatars sitting on the main object.
The main object is the one with the AVsitter and this rezzer scripts.
Animation: Which animation we want to have a set rezzing. We're not forced to assign a set to every animation. We can decide to rez props only for some animations.
Default in use: We may want a prop rezzing for all the animations that are not listed (this is, when avatars are sitting and using the object). We will specify it in that parameter. If we want no prop rezzing, we'll see how to define a special set that contains an empty prop to rez.
Default not in use: We may want a prop rezzing when no avatars are sitting and using the object. We will specify it in that parameter. If we want no prop rezzing, we'll see how to define a special set that contains an empty prop to rez. We can understand this as a default decorative set when no one is sitting.
The sets in use will be the sets that avatars can rez and have there fixed when the main object has avatars sitting on it. There must be at least one.
The sets not in use will be the sets that avatars can rez and have there fixed when the main object has no avatars sitting on it. This is, these are the sets we give as options as decorative props when no one sits. There must be at least one.
Step by Step Guide
Now that we know what the script does, and what the definitions mean, it's time to learn to set it up. To that purpose, we'll start by rezzing the [Black Tulip] Bed Couple #1 w.AO - START HERE object, which is already setup for AVsitter with five poses.
First of all, we have to prepare the props. This is easy enough. There are three of them:
- [Black Tulip] Bed Couple #1 - Cover 1 AO
- [Black Tulip] Bed Couple #1 - Cover 2 AO
- [Black Tulip] Bed Couple #1 - Cover 3 AO
We'll learn to prepare one, then the other two are the same. Rez the [Black Tulip] Bed Couple #1 - Cover 1 AO object, edit it, and drop in its contents the [Black Tulip] Bed Cover - PROP script, with permissions correctly set (no mod/no transfer in this case):
and now we take it back into our inventory. We proceed similarly with the other two props, and keep them separated from the unscripted ones, for a later step.
With our props ready and in contents, it is time to study the provided configuration notecard. The configuration notecard is [Black Tulip] Bed Cover - AVsitter Plugin ~CFG~. The following lines at the top of it will be detailed in the advanced setup section:
clickMode = 2 button = [^ AVsitter]|90005|-1||0
Then it continues with already prepared sets and animations. Worry not, we'll see how to use the auxiliary tool when we need it, but for now we're going to study what the lines of the provided configuration notecard mean.
We start defining a set that consists of one object. Notice the structure:
set = Plain object = [Black Tulip] Bed Couple #1 - Cover 1 AO|<0.000000, -0.337402, -0.323822>|<0.000000, 0.000000, 0.000000, 1.000000>
First we write the word set, then an = sign, then we give it the name we want. In this case, Plain. Since it's a name that will show on a menu, keep it under 24 characters.
Below it, we have one object = line. This information will be provided by the auxiliary tool, so we don't have to worry about how to obtain it, only to make sure that the object:
[Black Tulip] Bed Couple #1 - Cover 1 AO
is part of our object supplies. Indeed it is, as we've set it up with the prop script, so now we drop this scripted prop into the contents of the [Black Tulip] Bed Couple #1 w.AO - START HERE object:
If we continue reading this configuration notecard, we find more sets:
set = Folded object = [Black Tulip] Bed Couple #1 - Cover 2 AO|<0.000000, -0.292908, -0.402954>|<0.000000, 0.000000, 0.000000, 1.000000> set = Messy object = [Black Tulip] Bed Couple #1 - Cover 3 AO|<-0.374634, -1.053970, -0.444367>|<0.000000, 0.000000, -0.252069, 0.967709>
A set can have one or more object lines. Different sets may use the same objects. Different sets may position those same objects differently, or at the same place. The importance of the sets is that it is their name what the rest of the configuration notecard uses, not the object names. By using a set name, we're referring to the whole set of objects, positioned where we want them.
We'll use the auxiliary tool to obtain all the object lines, which then we'll arrange as we wish in sets. The explanation of the auxiliary tool (pretty straightforward) will come after we've fully explored the format of the configuration notecard.
There's one last set in the notecard:
set = Laundry Day object = __EMPTY__
Remember the Laundry Day button in the finished sample? We have named it that way. We could have named it Clear, Empty, or whatever other thing we wanted (always under the max of 24 characters restriction). The important is the special keyword used to say "no objects". That keyword is __EMPTY__ (note the double underscores). A set defined like that will have the effect of deleting all the existent props and not rezzing new ones.
We've defined, thus, four sets. Let's continue examining the configuration notecard. Now we find this:
setMenuInUse = Plain setMenuInUse = Folded setMenuInUse = Messy
What does this mean? Remember the definition of in use. This means that when we have avatars sitting, those options will show on the menu we access through the AVsitter [ADJUST] button. We're not forced to use all the sets we've defined and indeed, we're not using the Laundry Day set when avatars are sitting (remember it's enough with clicking on Always Off, as we learned when studying a finished object.)
Then we find this block of lines:
setMenuNotInUse = Plain setMenuNotInUse = Folded setMenuNotInUse = Messy setMenuNotInUse = Laundry Day
Remember the definition of not in use. This means that when we have no avatars sitting, right clicking and clicking Touch would show us a menu with those options, to select one set as decorative. Again, notice that we're not forced to use all the sets we've defined. We list only the sets we want to offer as decorative choices.
In order to save script memory, a couple of defaults must be defined. One is, which set will be rezzed as decorative right as the script has read the configuration notecard, until someone selects something different? (Or after having been avatars sitting and they all stand up). This set comes defined here:
defaultSetNotInUse = Folded
We begin to see the usefulness of defining sets. Instead of listing the objects every time for the menus, for the defaults... We simply use set names. And we can make those sets have the objects arranged however we wish.
The other default that must be defined is, which set will be rezzed when we don't assign any to an animation from the menu:
defaultSetInUse = Messy
Wait. We're not forced to assign a set to each and every animation of our engine? That's correct. And when you don't assign one, then defaultSetInUse will be the one used. We can use any of our defined sets, so Laundry Day would be a choice, in case you wanted no props rezzed unless for a few animations.
We're finally going to see how do we connect the dots between sets and animations. Because there's a way to define which set will be rezzed when we select an animation from the AVsitter menu. Let's take a look at the last lines of the configuration notecard:
Animation = Sol.7 | Plain Animation = Sol.8 | Folded
First of all, notice that not all the animations have been listed here. Sol.9, Sol.10, and Sol.11 have been left out on purpose to illustrate the default, and the fact that we don't have to list all the animations, only those we want having props rezzed.
Then notice the structure. We first write Animation =, then the animation name as it shows on the AVsitter menu. Then we write the | separator and next, the name of the set we want to be rezzed when the animation is played.
Now we drop in the engine's contents, in this order, the [Black Tulip] Bed Cover - AVsitter Plugin ~CFG~ configuration notecard, and the [Black Tulip] Bed Cover - AVsitter Plugin script (with permissions for next owner correctly changed).
Once we do this, we have to tell AVsitter that it has to add a button in its [ADJUST] menu so we can access to the controls of the bed. We do this by adding this line to the top of the AVpos notecard:
We save the notecard, wait for everything to reload, and it's ready to work!
After having read this, we recommend rezzing again the [Black Tulip] Bed Couple #1 w.AO - FINISHED object and re-reading the section where it explains what the script does and the definitions. All the concepts will be crystal clear in this second iteration, and we'll be ready to write our own configuration notecards.
In the next section we explain how to use the auxiliary tool.
The auxiliary tool
Rez the [Black Tulip] Bed Couple #1 w.AO - EMPTY for AUXTOOL object, edit it, and drop the three props that we've prepared with the prop script.
Now drop the [Black Tulip] Bed Cover - AUXILIARY TOOL script:
The script is immediately ready to work. Click on it to get a menu that shows all the objects (props) in the contents:
The items are numbered, so we click on the number of the object we want to rez, for example, the number 3:
Notice that the item rezzes in the center of the bounding box of the rezzer object, the bed in this case, so it shows as we can see in the picture above. Now we rotate and move it where we want to place it:
and we click on the [SAVE] button. This will save the position and rotation, and also output it in local (nearby) chat:
We proceed similarly with the second item, [SAVE] the data:
And when we have all of them, we can click on the numbers of the menu to make sure that they are where we want them to be. If we're okay with where they are, then we click on the [DUMP] button, which gives us all the lines together:
Now with those values, we can construct our sets in the configuration notecard, place the objects differently and make a new [DUMP] for different positions in other sets, etc.
The advanced setup of this script involves the following:
- Learning the parameter clickMode of the configuration notecard, which allows us, among others, to be able to use this script with AVsitter (Notecard Configuration in Detail)
- Learning the button parameter of the configuration notecard (Notecard Configuration in Detail)
Notecard Configuration in Detail
The clickMode parameter.
When we have two scripts that react on click on the same prim, by clicking that prim we get the two scripts acting at once, which often means having two menus, one hiding the other one. Our older scripts solved this with a different version of the script called [MODULE], which only showed the menu when called from another script, AVsitter for example. We have updated this to get all the possible behaviours in a single script to maintain (which is easier also for developing).
clickMode is a variable that admits one of three values (0, 1, 2), and that it is specified in the notecard. Each value means this:
- 0: The menu shows on touch no matter what. We want to use 0 when no other script is on the root prim/or the same prim showing its own menu.
- 1: Touch never shows menu: Link Messages ONLY. This means that, for example, the menu would show only if we click a certain button in AVsitter, and only through that button.
- 2: Touch if not sitting. If sitting, Link Message. This means that if no one is sitting on the furniture, we can click on it and get the menu. But if there's just one avatar sitting on the furniture, the menu will show only through the corresponding AVsitter (eg.) options.
The starting sample notecard that comes with your package has this value:
clickMode = 2
This means that the setup we've made will work this way: if no one sits, we click and get the menu. But we can setup for example AVsitter, and as soon as someone sits, only those that sit will get the menu, through AVsitter buttons.
If you don't plan to use AVsitter or other scripts that can send link messages, you can change that value to 0. If you leave it set to 2 the behaviour isn't going to change, unless someone sits. So knowing this, adjust this parameter as it fits best to your application.
The button parameter.
The button parameter has this structure:
button = buttonNameOnMenu|linkMsgCode|sendToPrim|textToSend|reshow
- buttonNameOnMenu: The text we want showing on the menu button
- linkMsgCode: The code number to send
- sendToPrim: To which prim link number are we sending this? (-1 for all prims)
- textToSend: The text we're sending (optional)
- reshow: 1 if we want the menu to show again when we click the button, 0 otherwise
If we want this button to have the menu return to AVsitter, we write this on the notecard:
button = [^ AVsitter]|90005|-1||0
This is what this line means:
- [^ AVsitter]: The text we want showing on the menu button
- 90005: The code number to send
- -1: To which prim link number are we sending this (all prims)
- textToSend: The text we're sending is empty here, but notice that we write the | separator anyway
- reshow: 0 because we don't want to reshow our menu since we're asking AVsitter to show its own.
Consult with the scripter of the other script you want to make work through this button how to configure it. Refer them to this documentation.
Using clickMode and button to set your engine with AVsitter
How do we show the button in AVsitter?
As a normal button in AVSitter, we must include this line in the menu where we want to show the option, in the AVpos notecard:
As a button under the [ADJUST] menu in AVsitter 2, we must include this line ON TOP of the AVpos notecard:
No issues reported at the moment.
If after having followed the directions and checked the troubleshooting list, you have problems making the script work, please click here for the customer service form.