Wednesday, March 3, 2021

Core Games Alpha

Recently I've been branching out into other virtual worldish games.  Not straight out 3D chat rooms like Second Life is, but games that are a bit more than just "this game."  Games that are sort of a middle ground between being a game and being a VW.  Often they have creator tools and a lot of player generated content, but still have a lot of emphasis on "play" versus social.  One of these games is Roblox.  Another that probably falls into this category is Minecraft, though I've been playing that off and on for a long while now.  Fortnite seems to sort of fall into this category as well.

One I recently came across an interesting platform called Core.  Or maybe it's core Games.  Honestly, the name is kind of a little too generic, which makes it hard to look into and search on.  I noticed it as "Coming soon" in the Epic Games store, but it's already available on the website, so I signed up and checked it out.  It's actually changed recently from when I initially loaded it, and it's fairly limited in scope at the moment.  It reminds me a bit of Fortnight visuals in a Roblox interface.

Originally, when you launched Core, you were greeted with a sort of launcher, and a variety of games to choose from and play.  I imagine many of these games are created by the Core devs but there seem to be some that are created by users.  There is a little tutorial on the website I plan to look into on how to build an environment for Core.  You also have some options to customize your avatar, though it's pretty limited at the moment.


For example, there are several "base avatars", both male and female, and a couple of robots.  Picking any individual avatar allows you to swap around clothes, and adjust skin color. but you can't do anything with hair at all.  Also skin color is limited to 2-3 similar options per base avatar.  You can't pick say, one of the lighter skinned avatars because you like her hair style, and make her darker skinned, or visa versa.  Or give a robot avatar hair.

Clothing is also weirdly limited by gender.  You can't give the female avatars the same tactical jacket the male avatars can get, and you can't turn your male avatars into lumber jacks with the lumberjack themed outfit of the women.


After a bit of customizing, you can launch a variety of mini games from the selection.  Depending on the game, you may or may not have your initial avatar at all.  There is an FPS Sniper game where you play as your avatar, and another Plaza where you can explore and interact as your Avatar.  But another I tried was an elaborate game of the classic Snake, which gave you a snake Avatar.  Another was a sort of city building puzzle game that didn't have avatars at all.

 

Recently they updated the interface a bit.  The old menu is still there when you open it, but the game now dumps you into a central hub with other players.  The hub also has little portal areas to different subsets of games.  Plus a few other things to do like some ramps for the in game mounts and hover boards.  



What has interested me a bit here is the idea of using the same Avatar across games.  This whole system feels like something I've kind of wished Second Life could do for a long time.  Essentially have highly customized zones where you can play games as your avatar, be it a racer or an FPS or a fancy Theme Park.  Granted, SL sort of has this, but there is a lot about SL that is kind of jankey when it comes to creating rich interactive experiences.  Though Linden Lab seems to be working on this a bit with well, "Experiences" which rolled out a while back.

There is some interesting potential to this platform I feel, and it is, after all, still Alpha.    You can equip items you find in the world, and even buy things with collected currency found in world, though none of this seems to be persistent like say, Roblox (from what I can tell there).  The characters look pretty nice, though possibly a little cartoonish for some people's tastes.  I can see these being easily manipulated by some swappable parts and styling sliders for more customization in the future though.








Thursday, April 2, 2020

LSL - Vendor Script with Google Docs Tracking

Better late than never I suppose.  Last post, like 2 years ago, I talked about how to set up a Google Form to track data in a Google Sheet for use in LSL scripts.  It's very similar to how you would make a GET call in a PHP web form. 

Anyway, I'm here to post a Vendor Script that is designed to work with the Google set up to track sales.  The form values you want to create in the Google Form are: Avatar, Location, Price, and Item.

The script is available below, you can also have one delivered through the Marketplace.  I have used this vendor script in world but I didn't build the base Vendor functionality, so I would test it out with a cheap price and a friend or an alt to make sure it's working properly.  I take no responsibility if this screws up and you lose L$. 

This script should be placed in the root prim of a vendor along with an informational Notecard of some kind, and a single item to be distributed on payment.  You'll need to box up items that have several sizes or components, the vendor will only distribute ONE item even if you put several items inside of it.


// Vendor Script with Google Spreadsheet Sales Tracking
// This script was altered fromt he original (Info below) by Ramen Jedburgh (SL, OSGrid)
// 2018.01.21
// It has been altered to record sales in a Google Spreadsheet.

// Original Boilerplate

// Script for Vendor Posters. Gives Pre-purchase Notecard & Track Sales Information
//
// I do not have the original script author on this script.  Please notify me
//   if you know who that is so that appropriate credit can be given.
//   I, Chimera Firecaster, made some very minor changes in Feb, 2011, but the major
//   credit needs to go to a very generous person out there who made this freely
//   available to others in the Second Life Community.  This should remain free.
//   Please do not sell it.  That will most certainly bring bad Karma upon you.
//
// What this script does:
//
//   1. When the customer left clicks, this script provides them with a notecard with
//      information about the item they are thinking about purchasing
//      When the owner (you) left click, it provides information on how many of the
//      of the items have been sold and total sales.  You also get the notecard, but
//      just disregard that.
//
//   2. When the customer right clicks, they have the option of selecting "PAY" to
//      purchase the Item
//
// What you need to do:
//
//  1. Below you will see enter your price here.  Change the number to the amount you are
//     charging for the product.
//
//  2. This script requires that you include a notecard.  The notecard should include
//     information on the product.  It's the same sort of text that you would use for
//     selling the product on Second Life Marketplace.  Name your note card something like
//     Pre-purchase Information on Such-and-such product.  The note card should be placed
//     in the vendor poster, along with a box containing the product.
//





//----------------------------------------------------------------------------------
//              !!! EDIT STUFF HERE !!!
//    Edit Google Form Info and the price of your item, defaul 100L
//    For Information on Setting up Google Docs to recieve Data please visit:
//  https://allaroundthegrid.blogspot.com/2018/02/setting-up-google-docs-form.html
//----------------------------------------------------------------------------------
// Add Your Docs URL
string FrontPart = "https://docs.google.com/forms/d/EDIT_THIS_TO_ADD_THE_LONG_RANDOM_STRING";
//Google Form Key for Location
string LocationKey = "";
// Google Form Key for Avatar
string AvatarKey = "";
// Google Form Key for Item
string ItemKey = "";
// Google form key for Price
string PriceKey = "";
// This can be anything, it's for your reference ie "My Store"
string GridName = "";

// Enter Your Price here
integer gCorrectAmount = 100; //Replace the number with the price of your items
// Replace only the number, be sure to leave the semicolon after the number


// The Vendor should have this script, a notecard of somekind (with store info or whatever) and a boxed/bagged item inside.
// This Vendor Script will only deliver one item, so items must be boxed/bagged


//-------------------------------------------------------
//          !!! YOU SHOULD NOT EDIT BELOW THIS!!!
//-------------------------------------------------------



// Used for Google Forms
string Location;
string Avatar;
string URL;
       
integer totalsold = 0;
integer totalamount = 0;

default
{
    state_entry()
    {
        llRequestPermissions(llGetOwner(),PERMISSION_DEBIT);
        llSetPayPrice(PAY_HIDE, [gCorrectAmount, PAY_HIDE, PAY_HIDE, PAY_HIDE]);
        Location = llGetRegionName()+" on " + GridName;
    }
    
    touch_start(integer total_number)
    {
        llOwnerSay((string)totalsold +" units have been sold since object rez, L$" + (string)totalamount +" collected so far.");
        llInstantMessage(llDetectedKey(0), "Pre-purchase information on this item is being provided to you in a notecard. To purchase, RIGHT CLICK and select PAY."); //remove if no notecard
        llGiveInventory(llDetectedKey(0),llGetInventoryName(INVENTORY_NOTECARD, 0)); //remove if no notecard
    }
   
    money(key id, integer amount)
    {
        if (amount == gCorrectAmount)
        {
            // correct amount paid
            llInstantMessage(id, "Thank you for your purchase! Accept your product by selecting OK.");
            Avatar = llKey2Name(id);
            string itemsoldname=llGetInventoryName(INVENTORY_OBJECT, 0);
            llGiveInventory(id, itemsoldname);
            totalsold = totalsold + 1;
            totalamount = amount * totalsold;
            llInstantMessage(llGetOwner(), (string)llKey2Name(id) + " has paid " +  (string)amount + " in "+ llGetRegionName());
            string URL = FrontPart + "/formResponse?ifq&entry." + LocationKey + "=" + Location + "&entry." + AvatarKey + "=" + Avatar + "&entry." + ItemKey + "=" + itemsoldname + "&entry." + PriceKey + "=" + (string)amount + "&submit=Submit";
          
            key httpkey=llHTTPRequest(URL, [] ,"");
        }
       
        else if (amount < gCorrectAmount)
        {
            llSay(0,"You didn't pay enough, " + llKey2Name(id) + ". Refunding your payment of L$" + (string)amount + ".");
            llGiveMoney(id, amount);
        }
       
        else
        {
            integer refund = amount - gCorrectAmount;
            llSay(0,"You paid too much, " + llKey2Name(id) + ". Your change is L$" + (string)refund + ".");
            llGiveMoney(id, refund);
        }
    }
}

Thursday, February 22, 2018

Setting up a Google Docs Form for Second Life Interaction

I'm using Google Docs now with Second Life for tracking a few different things, and the basic set up is the same, so I've decided to just make this it's own post, that I can reference later.  For this example, I'm using aspects of the sales tracker script, but it can be adapted for any script.

Google Forms can be easily used to track various inworld activities in Second Life.  I am currently using it to track visitors to my store and for tracking sales in my store.  It's free, it doesn't require running or setting up a webserver or PHP or SQL.  I will say up front, I have no idea if there are API limits at all to this.  My use is extremely low traffic.  I suspect that, since it's Google, it's pretty robust.

Firstly, go to your google drive, at drive.google.com.  Create a new form and name it something useful.  In this case, I used "Gique Sales Tracker".


Change the default included field to "Short Answer" and give it a useful name.  On a side note, all of these names are independent of anything in Second Life and can be anything you want them to be.  The interaction occurs via some key values, not the form names or LSL variable names.  Add additional form fields, all "Short Answer" using the + icon on the side.  For the sales tracker, I used "Avatar", "Item", "Price", and "Location".  If you are using this framework for your own projects, you can add as many or as few fields as needed.  NOTE:  The system adds date and time on it's own.


Now near the top of the form composer, select "Responses", and click the little green icon.  Select "Create new Spreadsheet", and name it whatever you'd like.  This will cause the form to dump all responses to a useful spreadsheet as they come in.  Because of the way Google works, you can even watch this happen in real time.  The system automatically adds a date and time column.  Notice the column names are the names of the form fills you entered earlier.



This next step is the trickiest part of this entire deal, but it's not as hard as it seems, so don't be deterred.  At the top of the form creation page, near "Send" is an eyeball icon, this will allow you to preview the form.  Click this, and it will open the form in a new tab on your browser.  If you want to test the functionality of the form, you can enter values into the form manually here and submit them and they should show up in your spread sheet.  This page will look very similar to the form creator page, except the creation buttons will be missing.

You will need to make some notes here.  I'd recommend using a notepad style program, you can write them down if you want, but at least one of the values you're pulling next is very long and complex, so I'd recommend something you can cut and paste to.  You will need all of these values in Second Life in the script, you can put them directly in the script, or an SL notecard even.

Right click on the Form Preview page, and select "View Page Source".  This may be called something else depending on your browser, but the idea is to view the code that makes the form page.  This will open a tab or a window with a mess of code.  You'll want to do a "Find".  In Windows, you can do this with "Control+F", I believe it's similar in Mac and Linux.  In the find box, search for "entry.", including the period.  Chrome highlights all occurrences of the search term, some browsers may require multiple searching to cycle through each occurrence.  What you are looking for, is the number that occurs just after "entry."


Record these numbers, and what they correspond to.  The numbers should occur in the order you added them to your form, but you can verify this by scanning back a bit in the code, the form name is listed under a tag "aria-label".  I've highlighted above where it shows "Avatar Name", notice lower in the example it reads "Item", "Location", and "Price".  The numbers from this example are, 1518898711, 1485797246, 1639291941, and 1768330639.  Your numbers WILL be different.  Using those 4 numbers will not work for you.

Also, in case anyone thinks they want to be clever, I created a dummy form for this example, so these numbers are not the numbers I use for my actual tracker.

Once you have these numbers, you can close the source code.  You can also close out the preview form if you want.  You will also need the form id, which can be found in the URL box at the top of your browser.



I've highlighted what you need above, but you want everything BETWEEN the slashes.  The actual URL for the example is here:

https://docs.google.com/forms/d/1zGN8eH4ZbwqZWEVw4qFB-nS9WrGv7yEeYWm8QzJ1MkM/edit

You want everything in between the slashes, highlighted above.  You do not need the slashes.  Mark this down as your form key.

And that's all that you need for basic set up of a Google Form for use in an SL script.  I'll post about a couple of projects using this form later.

A copy of the script that can be used with this set up can be gotten here.





Monday, December 4, 2017

A Quick Look at the Normie Head

I've tried a pretty wide variety of MESH bodies, but I've not really stepped into the realm of MESH heads yet.  Partially because they all are pretty expensive.  Also, there's a pretty large variety of options and it's not quite as clear on which is "best for me".  The body part felt pretty easy, for the most part, they are a layer a MESH that lays over your standard avatar skeleton to sort of smooth things out.  There are nuances in there, but picking one and then adjusting it with the standard body sliders felt pretty straight forward.

Heads feel different.  Like, it would be easy to end up spending 2000+ L$ on something that I couldn't possibly make work for my "preferred style".  It's not clear to me how much these heads can be adjusted using the standard sliders.  The head and face are kind of a big deal, at least to me, as part of the identity of my Avatar.  It's what I look like.  I use it in SL, I have all of my values written down so I can slap them into any OpenSIM instance I need to.



Recently <UTILAZATOR> released a head called "Normie".  The name is a little odd but if you know anything about <UTI> it will feel kind of obvious.  Most of <UTI>'s stuff is anime themed, very stylized.  It's popular among people who fall into the "4chan crowd", for lack of a better description (this isn't meant to be any sort of insult).  "Normie" is sort of board vernacular for a "regular person".  The Normie head, unlike most of <UTI>'s offerings is more "normal" looking, instead of the stylized Anime look.

I decided to try this head for two reasons.  One, it's only 500L$, which is cheap.  Secondly, based on the ads, and other pictures I've seen, it has a bit of a softer roundish style, which is the sort of look I wanted in my avatar's face.

I think I may have a <UTILIZATOR> body, but I haven't tested the head yet against it, my preferred MESH body is the Maitreya Lara.  It still works out pretty well and I was able to make the neck fix bits work pretty smoothly, or at least as smoothly as it can get.  I also created a quick OMEGA applier for my skin so I could keep the same skin I've been using for ages (I really like it, and it's almost as important as my shape).

So, the head itself.

I... mostly think I like it.  I have a few issues but I think maybe I need to just tweak things a bit more to make everything better.  Most of my problem is with the mouth.  The lips look weird no matter how I adjust things.  There are several different Bento based face poses in the HUD as well, but it could really use a good closed mouth smile.  Every single post makes my avatar look grumpy except the smile face, which makes me look derpy.


I've tried adjusting things to give the mouth a natural up curl on the sides for the neutral pose with no luck.  I am not sure exactly how universal Bento is, so I have not yet tried looking into some sort of alternative face posing HUD.  I do know that the old smiler attachment (randomly smiles every so often) doesn't work with this head.

I'm not giving up on this head or anything, in fact I'm kind of confident things may get better in the future, I've seen comments that <UTILIZATOR> is pretty good about keeping their products updated.  This is essentially the 1.0 product.

Thursday, May 25, 2017

Playing with SpacialOS

I've been wanting to explore some other Virtual Worldy environments outside of Second Life and OpenSIM a bit, and recently went through a quick look at Spacial OS, using their tutorial which can be found here.  Spacial OS kind of feels more like a basic game engine/server than a real virtual world environment.  You don't really develop in world or anything, but it is something that can be used to develop and deploy a multiplayer online environment.

I didn't get too detailed into developing anything, though it uses Unity, which is a pretty common platform these days.  I did run through and deploy a world that I could connect to, and somewhat more fun, I used a remote computer for the server and my laptop for the client.  I had to adapt the tutorial a bit, during the authorization phase by copying and pasting the URLs around and entering the IP of the server instead of "local host" but it worked out easily enough.  I deployed the server end on a Windows 7 VPS I have on Cloud At Cost.  


During the set up, you connect the server to the console at improbable.io.  Once it's up and running, you can use this dashboard to view and interact with the backend of the game world, in this case, the demo Lumberjacks and Wizards game.


The demo game itself is pretty basic, and definitely a demo, you control a little wizard, you can set fire to things with one button and put out fires using rain with the other button.  There are also some lumberjacks gathering wood and building little houses.  You pretty much just walk around setting trees, lumberjacks, buildings, and even yourself on fire.  


It's kind of neat watching the back end of the world, you can do some interaction here as well, like deleting things removes them in real time.

Ultimately, I decided to wander off to the edge of the map, when i reached it, my little wizard just disappeared, forever.  Kind of disappointing, but it was a neat little demo.  It would take more time and skill than I have to go much farther with this platform however.