We've updated Kitely to OpenSim 0.9.1.1

Provide feedback, criticism or praise about Kitely, or suggest new features
Post Reply
User avatar
Ilan Tochner
Posts: 6504
Joined: Sun Dec 23, 2012 8:44 am
Has thanked: 4943 times
Been thanked: 4455 times
Contact:

Re: We've updated Kitely to OpenSim 0.9.1.1

Post by Ilan Tochner »

We rolled out additional system improvements that should help speed up various viewer UI requests.

Those of you who reported various viewer UI commands taking longer since our OpenSim version upgrade, please test these commands again now in the same worlds you tested them previously and then let us know your results.
User avatar
Koshari Mahana
Posts: 358
Joined: Fri Feb 06, 2015 8:14 am
Has thanked: 279 times
Been thanked: 497 times
Contact:

Re: We've updated Kitely to OpenSim 0.9.1.1

Post by Koshari Mahana »

1) My rezzing vendors stopped working correctly after the update. Both the rezzing script and the cleaning script. Any ideas of how I can make them work again?

It rezzes the structures but it's not reading the script in the structure that tells it where to rez it, then it doesn't clean it up when the next one is ready to rez. The building is rezzing 1/2 underground and much too close to the vendor. *Below is the main script for the rezzing vendor

2) Rezzing vehicles isn't working either, it rezzes them but not at the right height.

Code: Select all

// :CATEGORY:Vendor
// :NAME:Multiitem_Multiauthor_vendor_MAIN_B
// :AUTHOR:Apotheus Silverman
// :CREATED:2010-01-10 05:20:56.000
// :EDITED:2013-09-18 15:38:57
// :ID:539
// :NUM:725
// :REV:1.0
// :WORLD:Second Life
// :DESCRIPTION:
// Multi-item, Multi-author vendor -MAIN- By Apotheus Silverman.lsl
// :CODE:

//========== FOREWORD By Apotheus Silverman =========================
//
//the code I have here is for a vendor that rezzes display models. When someone purchases something the payment can be automatically divided between mulitiple people if desired.
//All the information about the items being sold and who gets paid reside in a note card.
//
//
//I have listed a multi-author vendor kit on SLExchange.com that anyone can use to get this vendor system up and running within a few minutes. Most people who have problems getting the scripts working find it to be of incredible value.
//
//The kit is fully open-source, just like the scripts themselves. It includes a working vendor, tutorial notecard and tools to help you along the way.
//
//You will find it HERE: http://www.slexchange.com/modules.php?name=Marketplace&file=item&ItemID=4081
//===================================================================


//    HOW TO USE By Ulrika Zugzwang
//    
//    * Create a vendor prim and put the vendor script in.
//    * Create a previous-button prim and put the previous-button (back-button) script in.
//    * Create a next-button prim and put the next-button script in.
//    * Link all three prims together making the vendor prim the parent prim.
//    * Make a model by rezing an object you want to sell, copy it, shrink it, and remove all contents.
//    * Place the display script inside this model.
//    * Rename the model.
//    * Place the model and the original object for sale into the vendor.
//    * Edit the "Item Data" notecard to include the following data: object name, model name, price, agent keys
////////////////////////////////////////////////////////////////////////////////////
//Sample "Item Data" notecard:
////////////////////////////////////////////////////////////////////////////////////
//Abbotts Float Plane v1.0.1, Float Plane Display Model - red stripe, 500, 
//d9bcb9e0-bfa2-4b8b-a8fc-9d996935ef51|0d994ae7-2d6a-4cd3-bdcf-81c82c35928b
//Abbotts Float Plane v1.0.1 black feathers, Float Plane Display Model - black feathers, 500, 
//d9bcb9e0-bfa2-4b8b-a8fc-9d996935ef51|0d994ae7-2d6a-4cd3-bdcf-81c82c35928b
//Abbotts Float Plane v1.0.1 red-yellow feathers, Float Plane Display Model - red feathers, 500, 
//d9bcb9e0-bfa2-4b8b-a8fc-9d996935ef51|0d994ae7-2d6a-4cd3-bdcf-81c82c35928b
//Abbotts Float Plane v1.0.1 stars stripes, Float Plane Display Model - stars stripes, 500, 
//d9bcb9e0-bfa2-4b8b-a8fc-9d996935ef51|0d994ae7-2d6a-4cd3-bdcf-81c82c35928b
/////////////////////////////////////////////////////////////////////////////////////


// This is the name of the notecard to read items from
string itemDataNotecard = "Item Data";

// Type of thingy this vendor sells (inventory constant)
integer inventoryType = INVENTORY_OBJECT;

// Keeps track of the currently-displayed item (1-indexed)
integer currentItem = 0;

// Floating text color
vector textColor = <1,1,1>;

// Model rez position relative to parent object
vector rezPosition = <5.2,0.0,-0.15>;

rotation relativeRot = <0.0, 0.0, 0.0, 0.0>;

// Inter-object commands
string commandDerez = "derez";

// How many seconds between automatic item changes
float changeTimer = 175.0;



// This is the channel the main vendor talks to rezzed models on
integer commChannel =44;

// These lists are synchronized to simulate a structure for each item's data
list items = [];
list models = [];
list prices = [];
list authors = [];

// Required to read the notecard properly
integer notecardLine;
key currentDataRequest;


// Reads the data from the notecard. Each line in the notecard should be
// formatted as follows:
// Item Name, Model Name, Price, Authors
// string (no commas), string (no commas), integer, pipe-delimited list of keys
// Example:
// Abbotts Float Plane v1.0.1, Abbotts Float Plane Model, 500, key|key
InitializationStep1() {
    llSay(0, "Reading item data...");
    notecardLine = 0;
    currentDataRequest = llGetNotecardLine(itemDataNotecard, notecardLine);
}

// Requests debit permission
InitializationStep2() {
    // Request debit permission
    llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
}

// Change currently-displayed item
SetCurrentItem(integer item) {
    // determine which item to display
    integer itemCount = llGetListLength(items) - 1;
    currentItem = item;
    if (currentItem == -1) {
        currentItem = itemCount;
    } else if (currentItem > itemCount) {
        currentItem = 0;
    }

    // derez current model
    llWhisper(commChannel, commandDerez);

    // Build and set hover text
    string hoverText = "Item " + (string)(currentItem + 1) + " of " + (string)(itemCount + 1) + "\n" + llList2String(items, currentItem) + "\n$" + (string)llList2String(prices, currentItem);
    llSetText(hoverText, textColor, 1.0);
    
    // Say what item is now being displayed
    llSay(0, "Now Showing: " + llList2String(items, currentItem));

    // rez the new model
    llRezObject(llList2String(models, currentItem), llGetPos() + rezPosition, ZERO_VECTOR, ZERO_ROTATION, commChannel);
}

default {
    state_entry() {
        llSay(0, "Starting up...");

        // Initialize commChannel
        commChannel = (integer)llFrand(2000000000.0);

        // Clear text
        llSetText("", textColor, 1.0);

        // Read notecard, populate lists
        InitializationStep1();
    }

    run_time_permissions(integer perm) {
        if (perm & PERMISSION_DEBIT) {
            state vend;
        } else {
            llSay(0, "You must grant debit permission for me to work properly.");
        }
    }

    dataserver(key query, string data) {
        if (query == currentDataRequest) {
            currentDataRequest = ""; // Prevent a bug that occurs with dataserver events.
            if (data != EOF) {
                // Read the current item
                list currentList = llCSV2List(data);
                string myItemName = llList2String(currentList, 0);
                string myModelName = llList2String(currentList, 1);
                integer myPrice = llList2Integer(currentList, 2);
                string myAuthorsAsString = llList2String(currentList, 3);

                items += [myItemName];
                models += [myModelName];
                prices += [myPrice];
                authors += [myAuthorsAsString];

                notecardLine++;
                // Get the next line
                currentDataRequest = llGetNotecardLine(itemDataNotecard, notecardLine);
            } else {
                // Signal that we are done getting items
                InitializationStep2();
           }
        }
    }
}




state vend {
    state_entry() {
        //llSay(0, "items = " + llDumpList2String(items, ","));
        //llSay(0, "models = " + llDumpList2String(models, ","));
        //llSay(0, "prices = " + llDumpList2String(prices, ","));
        //llSay(0, "authors = " + llDumpList2String(authors, ","));
        
        // Rez initial model
        SetCurrentItem(currentItem);

        // Start the timer for item autorotation
        llSetTimerEvent(changeTimer);
                
        llSay(0, "Multiauthor Multivendor online.");
    }
    
    timer() {
        // Choose a random item to display. Make sure it's not the current item.
        integer newItem = currentItem;
        if (llGetListLength(items) > 1) {
            while (newItem == currentItem) {
                newItem = (integer)(llFrand(llGetListLength(items)) + 1.0);
            }
            SetCurrentItem(newItem);
        }
    }

    touch(integer total) {
        llSay(0, "To export to another grid you need to buy from the Kitely Market. To purchase for use in Kitely right-click and \"Pay\" the displayed amount.");
    }

    // Someone has given me money
    money(key agentkey, integer amount) {
        string name = llKey2Name(agentkey);
        integer currentPrice = llList2Integer(prices, currentItem);
        integer sale;
        integer i;
        
        if(amount < currentPrice) {
            // Not enough money was given. Cancel sale.
            llSay(0, name +  " you Paid $" + (string)amount + " - thats not enough money for the current item! Refunding $" + (string)amount + "...");
            llGiveMoney(agentkey, amount);
            sale = FALSE;
        }
        else if(amount > currentPrice) {
            // Too much money was given. Refund the differnce.
            integer change = amount - currentPrice;
            llSay(0, name + " you Paid $" + (string)amount + " - your change is $" + (string)change + ".");
            llGiveMoney(agentkey, change);
            sale = TRUE;
        } else {
            // The proper amount was given.
            sale = TRUE;
        }

        if (sale) {
            // Make sure I have the item in inventory before trying to give it.
            integer found = FALSE;
            //llSay(0, "searching for " + llList2String(items, currentItem));
            for (i = 0; i < llGetInventoryNumber(inventoryType); i++) {
                if (llGetInventoryName(inventoryType, i) == llList2String(items, currentItem)) {
                    found = TRUE;
                }
            }

            if (!found) {
                // Display error and refund money
                llSay(0, "Erm, I am sorry " + name + ", but it seems that I do not have that item to give to you, so I am refunding the purchase price. Please contact my owner about this issue.");
                llGiveMoney(agentkey, currentPrice);
            } else {
                // Complete the sale
                llSay(0, "Thank you for your purchase, " + name + "!");
                llGiveInventory(agentkey, llList2String(items, currentItem));

                llWhisper(0, "Please wait while I perform accounting activities...");

                // Distribute money to the object authors
                list myAuthors = llParseString2List(llList2String(authors, currentItem), ["|"], []);
                
                if (llGetListLength(myAuthors) > 0) {
                    integer shareAmount = (integer)llList2Integer(prices, currentItem) / llGetListLength(myAuthors);
                    // Eliminate my owner from the authors list
                    for (i = 0; i < llGetListLength(myAuthors); i++) {
                        llInstantMessage(llList2Key(myAuthors, i), name + " purchased " + llList2String(items, currentItem) + ". Your share is L$" + (string)shareAmount + ".");
                        if (llList2Key(myAuthors, i) == llGetOwner()) {
                            myAuthors = llDeleteSubList(myAuthors, i, i);
                        }
                    }
                    // Pay any remaining authors accordingly
                    if (shareAmount > 0 && llGetListLength(myAuthors) > 0) {
                        for (i = 0; i < llGetListLength(myAuthors); i++) {
                            llGiveMoney(llList2Key(myAuthors, i), shareAmount);
                        }
                    }
                }
                llWhisper(0, "Accounting completed. Thanks again, " + name + "!");
            }
        }
    }

    link_message(integer sender, integer num, string message, key id) {
        if (message == "next") {
            llSetTimerEvent(changeTimer);
            SetCurrentItem(currentItem + 1);
        } else if (message == "prev") {
            llSetTimerEvent(changeTimer);
            SetCurrentItem(currentItem - 1);
        }
    }

    on_rez(integer startParam) {
        llResetScript();
    }
} // END //
Image
VISIT FOUR WINDS ON THE MARKET
VISIT FOUR WINDS INWORLD: hop://grid.kitely.com:8002/Coopersville/909/907/21
User avatar
Ilan Tochner
Posts: 6504
Joined: Sun Dec 23, 2012 8:44 am
Has thanked: 4943 times
Been thanked: 4455 times
Contact:

Re: We've updated Kitely to OpenSim 0.9.1.1

Post by Ilan Tochner »

Hi Koshari,

Are you referring to yesterday's update causing these scripts to stop working or the upgrade to OpenSim 0.9.1.1 which happened 3 weeks ago?
User avatar
Koshari Mahana
Posts: 358
Joined: Fri Feb 06, 2015 8:14 am
Has thanked: 279 times
Been thanked: 497 times
Contact:

Re: We've updated Kitely to OpenSim 0.9.1.1

Post by Koshari Mahana »

I'm not sure because I hadn't logged in in a little while but when I did I kept getting the message that the region was full and I thought that was weird. So I went all around the region thinking someone dropped something then realize my rezzing vendors were rezzing dozens of copies of all of my builds right on top of each other, not cleaning them like they should and none of them were even rezzing where they were supposed to. I think it must have been the last update or I would have heard about it before.
Image
VISIT FOUR WINDS ON THE MARKET
VISIT FOUR WINDS INWORLD: hop://grid.kitely.com:8002/Coopersville/909/907/21
User avatar
Ilan Tochner
Posts: 6504
Joined: Sun Dec 23, 2012 8:44 am
Has thanked: 4943 times
Been thanked: 4455 times
Contact:

Re: We've updated Kitely to OpenSim 0.9.1.1

Post by Ilan Tochner »

What happens when you delete those extra copies of the rezzed object then shut down your world and reenter it?
User avatar
Koshari Mahana
Posts: 358
Joined: Fri Feb 06, 2015 8:14 am
Has thanked: 279 times
Been thanked: 497 times
Contact:

Re: We've updated Kitely to OpenSim 0.9.1.1

Post by Koshari Mahana »

If I don't change the scripts to not running they just come back and do the same thing (rez in the wrong place and don't auto-delete). The scripts just no longer work. I've had to set all 4 vendors to not running until we get it sorted out. In addition, I tried it with all of the different physics engines and the scripts no longer work in any of them. They used to work perfectly.
Image
VISIT FOUR WINDS ON THE MARKET
VISIT FOUR WINDS INWORLD: hop://grid.kitely.com:8002/Coopersville/909/907/21
User avatar
Ilan Tochner
Posts: 6504
Joined: Sun Dec 23, 2012 8:44 am
Has thanked: 4943 times
Been thanked: 4455 times
Contact:

Re: We've updated Kitely to OpenSim 0.9.1.1

Post by Ilan Tochner »

It would help if you could check which OSSL or LSL function no longer works. Try checking for script error messages or creating test scripts to just check the different functions your vendors use.
These users thanked the author Ilan Tochner for the post:
Koshari Mahana
User avatar
Christine Nyn
Posts: 71
Joined: Sat Mar 07, 2020 10:20 pm
Has thanked: 218 times
Been thanked: 126 times

Re: We've updated Kitely to OpenSim 0.9.1.1

Post by Christine Nyn »

Koshari, the vendor script you uploaded uses llRezObject to produce the demo models of the vendor's contents. That function finds the geometric centre of the object's bounding box and then rezzes the object with the centre on the requested rezz coordinate. This will clearly vary from object to object but the vendor script uses a fixed vertical offset of -0.15, meaning you can't guarantee what the vertical offset will look like.

If you altered the script to use llRezAtRoot and then amended your demo objects to all have a root prim at a common fixed height your rezzer would then become predictable again.

I checked, and the current behaviour of Y-Engine in regard to llRezObject and llRezAtRoot is exactly as it should be which leads me to suspect, though I can't prove it, that the previous script engine was calculating this differently.
These users thanked the author Christine Nyn for the post (total 2):
Koshari MahanaIlan Tochner
User avatar
Koshari Mahana
Posts: 358
Joined: Fri Feb 06, 2015 8:14 am
Has thanked: 279 times
Been thanked: 497 times
Contact:

Re: We've updated Kitely to OpenSim 0.9.1.1

Post by Koshari Mahana »

Thanks Christine. I have a transparent cube with the object script and it is the root prim that the building is linked to. I'll try altering it to llRezAtRoot and see if that works.
Image
VISIT FOUR WINDS ON THE MARKET
VISIT FOUR WINDS INWORLD: hop://grid.kitely.com:8002/Coopersville/909/907/21
User avatar
Koshari Mahana
Posts: 358
Joined: Fri Feb 06, 2015 8:14 am
Has thanked: 279 times
Been thanked: 497 times
Contact:

Re: We've updated Kitely to OpenSim 0.9.1.1

Post by Koshari Mahana »

That fixed it Christine, thank you so much! All I had to do was change llRezObject to llRezAtRoot and it's back to working, it even deletes the object now like it should when the next one rezzes. I really appreciate your suggestions!
Christine Nyn wrote:
Sat Mar 07, 2020 10:34 pm
Koshari, the vendor script you uploaded uses llRezObject to produce the demo models of the vendor's contents. That function finds the geometric centre of the object's bounding box and then rezzes the object with the centre on the requested rezz coordinate. This will clearly vary from object to object but the vendor script uses a fixed vertical offset of -0.15, meaning you can't guarantee what the vertical offset will look like.

If you altered the script to use llRezAtRoot and then amended your demo objects to all have a root prim at a common fixed height your rezzer would then become predictable again.

I checked, and the current behaviour of Y-Engine in regard to llRezObject and llRezAtRoot is exactly as it should be which leads me to suspect, though I can't prove it, that the previous script engine was calculating this differently.
These users thanked the author Koshari Mahana for the post (total 2):
Ilan TochnerJohn Mela
Image
VISIT FOUR WINDS ON THE MARKET
VISIT FOUR WINDS INWORLD: hop://grid.kitely.com:8002/Coopersville/909/907/21
Post Reply