Wednesday, December 15, 2010

Setup a "Sit on prim" Action

Actorbots can be programmed to perform specific actions when a given trigger condition is met. For instance, if an Actorbot is paid 250L that could trigger an action. Actions can be any one of instant message, chat, send group invitation, give object, wear outfit, play animation, stop animation, or sit on prim. This post describes how to setup that last action, sit on prim, and details the following steps:
  • Receive 250L or more -> Sit on prim
  • Configure prim
  • Receive 250L or more -> IM avatar with thanks
  • Receive 250L or more -> Wear a specified outfit folder
  • Receive 250L or more -> Chat to Actorbot to setup timer
  • Receive IM contains _Wear Default Outfit -> Wear an outfit
Go to the Sine Wave website, login, click on "My Actorbots", click on the Actorbot you want to program, then click on "Advanced settings". Here is where you will program your Actorbot.

First, decide what your Actorbot's trigger for the action will be. Triggers can be either an instant message or payment. Let's choose payment for this example and we'll set the condition to "Receive money" with "Amount greater equals 250". This specifies a trigger condition of payment to the Actorbot's avatar of 250L or more.

Next, specify the action and execution level for this trigger. Select "Sit on prim" from the pull down menu of actions and "Concurrent" from the pull down menu of execution levels. We want a concurrent action in this example because we are going to want this condition (payment of 250L) to trigger more than one action, all of which should be performed.

Now that we have a trigger with condition and associated action and execution level we can configure the prim on which we want the Actorbot to sit. Click the "Save" button just below the "Sit on prim" field and copy the resulting red string (usually your Actorbot's avatar name followed by a number). You may have to scroll down to see the red string  which will be part of the action description in your list of triggers.

Log in to Second Life and edit the prim you are going to pay the Actorbot to sit on. Right click the object the prim is in, select "Edit", select "Edit linked parts", and click on the prim you wish to edit. Now paste the red string you copied into the Description field of the General tab. Now we need to populate the prim with a couple of scripts and a notecard.

Click the "Content" tab of the edit window and drag the following from your inventory to the edit window Content tab:
  • Actorbot Location script
  • TimedSitAndNotify
  • Configure_Key
You can obtain the Actorbot Location script from Sine Wave Island. The TimedSitAndNotify script and Configure_Key notecard are included with the Pandorabot Actorbot Add-On. After dragging these three items into the prim contents you need to edit the Configure_Key notecard to add your Actorbot's avatar key. Right click Configure_Key in the Content tab, select Open. Insert a line at the top of the notecard that specifies your bot's key. You can find the key by viewing the avatar's profile - it's at the top of the 2nd Life tab. The line should look something like:
    BOTKEY = your-actorbot's-key-goes-here

While you're here you can set a number of other parameters like what strings get used in instant messages, duration of the Actorbot's time on this prim, and the channel number used to communicate with the script. For the purposes of this example we will just need to set the BOTKEY parameter. BOTKEY always needs to be set. Click "Save" and close the notecard editing window.

While still in the prim editing window click Tools -> Recompile Scripts in Selection -> Mono from the viewer toolbar. Finally, click Tools -> Reset Scripts in Selection from the viewer toolbar and close the edit window. Your prim is now setup for the Actorbot to sit on it when paid 250L or more.

However, we're not done yet! Go back to the Sine Wave website where we are programming the Actorbot. We need to add more actions. First, add another "Receive money", "Amount greater equals 250" condition and this time select "Instant message" and "Concurrent" for the action. Enter a message in the Content field to be sent to the avatar that paid you. Something like "Thanks {avatar name}! Give me a minute to get undressed :)". Click "Save".

Next, add another action for "Receive money", "Amount greater equals 250". Again, use "Concurrent" and this time select "Wear outfit". In the "Outfit name" field, enter the name of a subfolder in the Actorbot avatar's Clothing folder that you want it to wear when paid 250L or more. For this example, enter "Nude". Click "Save".

Add another "Receive money", "Amount greater equals 250" condition and this time select "Chat". In the Content field enter "{avatar key} paid me to get naked". In the Channel field enter the Actorabot script's channel (default 25 or whatever you set it to be in the Actorbot base prim Actorabot_Config). Select the Concurrent execution level and click "Save".

Add one final action for "Receive instant message", "Message contains _Wear Default Outfit". Select "Wear outfit" and enter the name of a subfolder of the Clothing folder you want your Actorbot to wear when done with the paid action. Let's use the Outfit name "Blue Dress". Select the "Exclusive" execution level and click "Save".

Log into Second Life as the Actorbot's avatar and create a subfolder of the Clothing folder called "Nude" (for this example). Populate the Nude subfolder with all the items you want your Actorbot to wear for this action. Include hair, shoes, attachments, etc. Create another subfolder of the Clothing folder called "Blue Dress" and populate it with all the items you want your Actorbot to wear when the paid 250L or more action completes.

Log out of Second Life and start the Actorbot. Log in to Second Life as another resident (not the Actorbot's avatar) and pay the Actorbot's avatar 250L. It should now sit on the prim, perform whatever animations are in that prim, and wear the outfit folder "Nude". After the duration set in the Configure_Key notecard (15 minutes default) the Actorbot will leave the prim, return to its base prim and wear the outfit folder "Blue Dress".

Thursday, December 9, 2010

Configure a Private Pandorabot

The Pandorabot V4 can be configured to wear as an invisible attachment listening on a private channel to only the owner. In this configuration a Pandorabot V4 owner can wander the grid easily, quickly, and privately accessing Pandorabot features such as Wikipedia queries, email, spellcheck, etc.

To configure your Pandorabot V4 as a private Pandorabot add the following lines to the top of the Configuration notecard:

        CHANNEL = 22
        INVISIBLE = TRUE
        HOVER_ENABLED = FALSE
        TEXT_ENABLED = TRUE
        OWNER_LISTEN_ONLY = TRUE
        OWNER_SHUTOFF_ONLY = TRUE

The CHANNEL setting can be any free positive channel, I am just using 22 as an example.

To communicate with the Private Pandorabot, wear the Pandorabot object in your inventory and preface any Pandorabot queries you wish to make with /22. For instance, to query Wikipedia for the introductory paragraph on Abraham Lincoln, type in Local Chat:
    /22 Who is Abraham Lincoln ?

To configure the Pandorabot say "/22 configure" in Local Chat. If you turn the Pandorabot off and wish to restart it then highlight invisible objects with Ctrl-Alt-T and left click the Pandorabot.

To change the channel or reset it to listen to all local chat, edit the Configuration notecard in the object's Contents. Commenting out or deleting the "CHANNEL = 22" line will reset the Pandorabot to listen to all local chat from any resident within chat range.

All Private Pandorabot queries and responses can only be seen by the owner. The private Pandorabot can, however, be reconfigured as a public Pandorabot by deleting the CHANNEL setting or setting CHANNEL = 0. It can also be reconfigured to be visible or take on the appearance of a female, male, rotating head, parrot ...

Make Your Pandorabot Less Chatty

Most Pandorabots come preconfigured to respond to all local chat. In an uncrowded area this usually does not present a problem. However, if your Pandorabot is within 20 meters of a crowded dance floor or group then responding to every public chat can be annoying. It's easy to configure your Pandorabot to respond only to local chat that contains either the Pandorabot's first or last name.

To configure a Pandorabot to respond to chat containing its name you can either edit the Configuration notecard or use the Configuration Dialog Menu. To edit the Configuration notecard right click on your Pandorabot and select "Edit". In the Contents tab right click on the Configuration notecard and select "Open". At the top of the Configuration notecard entries add the following:
        NAME_ENABLED = TRUE
You may also wish to name your Pandorabot here by adding lines like the following:
        FIRST_NAME = Jane
        LAST_NAME = Doe
Substitute whatever first and last names you want for "Jane" and "Doe". By default the last name of your Pandorabot is "Pandorabot" so you may only wish to set the first name.

To use the Configuration Dialog Menu left click your Pandorabot or say "configure" in local chat. This brings up a dialog menu. Click on "Name" and then click on "ON". This has the same effect as setting NAME_ENABLED = TRUE in the Configuration notecard except it will get set back to whatever is in the notecard when the Pandorabot is reset. So, editing the Configuration notecard is a more permanent way to configure the Pandorabot while using the dialog menu is quicker and easier.

Once you have enabled name recognition in the Pandorabot it will only respond to chat that contains its first or last name. For instance, to learn about Thomas Jefferson you would now need to say "Jane, who is Thomas Jefferson ?" (if your Pandorabot's first name is Jane).

It is frequently the case that your parcel may be crowded for events but sparsely populated the rest of the time. In these cases it may be appropriate to toggle your Pandorabot between responding to all local chat and only chat containing its name. To do so, simply left click the Pandorabot to bring up the Configuration Dialog Menu, click on "Name", then click on "ON" to turn name recognition on or "OFF" to return to responding to all local chat.

Pandorabot Actorbot Setup

Restless Studio Pandorabot V4 and later can be integrated with an Actorbot from Sine Wave to provide a realistic 3D animated bot avatar. To do so requires combining scripts from both the Actorbot and Pandorabot, add-on integration scripts, configuration notecards, and desired animations into a reconfigured Actorbot base prim.

Steps required to setup an integrated Actorbot/Pandorabot:
  1. Purchase the Pandorabot Actorbot Add-On
  2. Create a "Scripted Agent" Second Life account
  3. Create an Actorbot account at http://www.sinewaverobots.com
  4. Create as many Actorbots as you need
  5. Delete Actorbot Dance Script from Actorbot base prim
  6. Copy animations, scripts, & notecards into Actorbot prim
  7. Edit configuration notecards
  8. Recompile and reset scripts
  9. Start the Actorbot(s)
Additional Actorbot/Pandorabot integration can be performed via the “Advanced settings” of the Actorbot at the Sine Wave website. This and details of the steps above will be covered below.

PURCHASE PANDORABOT ACTORBOT ADD-ONS (step 1)

Pandorabot Actorbot Add-On packages can be purchased on the Second Life Marketplace. Search the marketplace for “Pandorabot Actorbot”. You will need one Pandorabot Actorbot Add-On for each Actorbot you wish to enhance. Unpack the boxed product and copy the items to your inventory. They will be in a new folder “Pandorabot Actorbot Add-On”. You can delete the box once the items have been copied to your inventory.

NOTE: If you already own a Pandorabot V4 or later you can purchase the Pandorabot Actorbot Add-On Lite.

CREATE A SECOND LIFE “ALT” ACCOUNT (step 2)

Visit http://secondlife.com/ , click the “Join Now” button and follow the same procedure you used to create your original Second Life account only with a different user name and setting the Scripted Agent Status to bot. If you wish to fix your newly created alt up a bit before deploying as an Actorbot, login to Second Life as your alt and modify appearance, clothing, etc as desired.

You may also wish to create a few clothing folders with everything you want your Actorbot wearing (including attachments like hair, shoes, facelight, …). Create these in the system “Clothing” folder as subfolders. Later you will be able to program your Actorbot to change outfits. You may prefer to defer this portion of the setup until after you have played around with your Actorbot a little.

CREATE AN ACTORBOT ACCOUNT (step 3)

Visit http://www.sinewaverobots.com/ and click “Sign up”. On the first page enter your primary Second Life avatar name (not the alt account you created in step 2). Next choose a Sine Wave Actorbot user name and password. Agree to the Terms of Service and click “Sign Up”.

CREATE ACTORBOT(S) (step 4)

Once you have completed the account activation process, create a new Actorbot by logging into your Sine Wave account and clicking “NEW ACTORBOT”. This time the “Avatar name” should be one of the alt accounts you created in step 2. If your alt was created with the new Second Life username and no last name then use “Resident” as the last name. Login to Second Life with your primary account (the account with which you created your Sine Wave account, not the alt accounts) and activate your Actorbot inworld at Sine Wave Island . A tutorial video on the activation process is available at the Sine Wave website . Once you have received the Actorbot Base Prim from Sine Wave Island select a location for your Actorbot and rez the prim there.

PREPARE THE ACTORBOT BASE PRIM (step 5)

The Actorbot base prim you received when you activated your Actorbot inworld contains a dance script template that doesn't really do much. The Pandorabot Actorbot Add-On provides significantly enhanced animation capabilities. Delete the Sine Wave dance script and edit the base prim description field:

Right click the Actorbot base prim and select “Edit”.
In the General tab:
  • Replace the Description field with the name of the alt account you wish to use for this Actorbot
In the Contents tab:
  • Delete the Actorbot Dance Script
POPULATE THE ACTORBOT BASE PRIM (step 6)

Drag the following from your Pandorabot Actorbot Add-On folder in your inventory into the base prim contents:
  • Actorabot
  • Actorabot_Config
  • pandorabot
  • Configuration
  • webservices
  • Demonstration Pandorabot at Restless Studio
  • _Pandorabots Info
  • Pandorabots User Guide
  • Pandorabots Owner Manual
  • Greeter
  • Copyright
If you want your Actorbot to dance and/or utilize stand animations, drag whatever and as many animations as you like into the base prim contents. In order for the preconfigured dance and stand commands to function properly the dances must contain the string “dance” in their name and the stands must contain the string “stand” in their name. In both instances the strings “dance” and “stand” are case insensitive.

EDIT CONFIGURATION NOTECARDS (step 7)

There should now be two configuration notecards in the Actorbot base prim – Actorabot_Config, the Actorabot script configuration card, and Configuration, the Pandorabot configuration notecard. The Actorabot_Config notecard can be edited to configure the default settings for the chat channel, duration of each animation, dance only mode, and stand only mode. The factory defaults should suffice for most deployments – chat channel 25, animation duration of 120 seconds, both dance and stand mode.

Consult the Pandorabots Owner Manual for the extensive Pandorabot configuration defaults that can be set by editing the Pandorabot Configuration notecard. When running a Pandorabot in an Actorbot the following settings are recommended:
        FIRST_NAME = Your bot's first name
        LAST_NAME = Your bot's last name
        TEXT_ENABLED = FALSE
        OWNER_SHUTDOWN_ONLY = TRUE
        HOVER_ENABLED = FALSE

RECOMPILE AND RESET THE SCRIPTS (step 8)

Once you have finished editing the notecards, while still editing the Actorbot base prim, select from the viewer menu:
       Tools → Recompile Scripts in Selection → Mono
When this completes, click “Done” closing the recompile window. While still in edit mode select from the viewer menu:
       Tools → Reset Scripts in Selection
You should see the following messages in local chat:
        The target has been set up successfully.
        Pandorabot ready to chat!

You can now close the base prim edit window.

START THE ACTORBOT(S) (step 9)

Return to the Sine Wave website and login. Click on “MY ACTORBOTS” and click on the Actorbot you want to start. Prior to starting the Actorbot you may wish to configure it with the Actorabot Starter template. To do so, click on “Advanced settings” then click on “Import Template”. Check the box next to the “Actorabot Starter” template by Missy Restless and click “Ok”. This configures your Actorbot to respond to a few IM commands. If someone sends an Instant Message to your Actorbot the following will occur:

    “Help” → the Actorbot will IM back a help message
    “Dance” → the Actorbot will enter dance only mode
    “Stand” → the Actorbot will enter stand only mode
    “Both” → the Actorbot will enter combined stand/dance mode
    Once you have configured the advanced settings you can start the Actorbot. Simply click “Start the Actorbot”. Repeat for any other Actorbots you wish to start. Return to Second Life and verify that your Actorbot has logged in and is responding to chat, dancing, standing, or whatever you have it configured to do. To verify the Actorbot is functioning as a Pandorabot, while standing within 20 meters of your Actorbot say in local chat “what is phi ?” and the bot should respond with the Wikipedia summary paragraph from the article on Phi. Note, if you have previously configured NAME_ENABLED = TRUE then you will have to say “<first name of bot>, what is phi ?”. To verify the advanced settings took effect, IM your bot and say “Help”.

    FURTHER INFORMATION

    The Pandorabot Actorbot Add-On Manual, Pandorabots Owner Manual, and Pandorabots User Guide are available in PDF format at http://www.scribd.com/missyrestless

    View and interact with the Restless Studio Actorabot integrated Pandorabots at:

    http://slurl.com/secondlife/Gualdo/210/226/42/
    and
    http://slurl.com/secondlife/Gualdo/204/224/43 (mature).

    Watch a short video of a dancing Pandorabot Actorbot.

    Have fun and email missyrestless@gmail.com with any questions, comments, suggestions, requests for custom configurations.

    View other Restless Studio creations in the Second Life Marketplace at http://tinyurl.com/2bq6o3p