Posts

Linksets in SecondLife (2)

Before approaching the script to make links securely while maintaining the original order, I will explain a trick to do it without scripts.
Rez the object you want to add and link it to a newly created primitive.Link the target object (for example the car) to the newly created object.Unlink the root prim, that is, the primitive you just created.

And that's all. If you have experimented with the LinkSpy.lsl script on all primitives you will see that the order is correct.
Using the script that I created the instructions are a bit more complex, there are six steps instead of three.
Put the JJReLink script in the inventory of object.Click the object.Object will ask for link permissions. click on YesLink object you can add to linkset. (Ctrl + L)Click on object again.Remove JJReLink script and check that everything is working

Warning: This script to work temporarily breaks all links. Make sure your object is not physical before use, or all parts will fall to the ground.


Script: JJRelink.lsl

Linksets in SecondLife (1)

Image
Suppose you have a nice car that you got for free at a freebie store. Your car has all the permissions, it is copyable, modifiable and you can transfer it to another avatar. You decide that you can improve it, adding other objects that you have found for free. Perhaps you like to put on the hood a skull with horns and a spare wheel at the rear and to give it a more "MadMax" look like metal window grilles.

By doing so, you discover that your brand new car has stopped working. Maybe instead of turning the wheels, the seats turn, the lights are no longer on, and the particle emitters are wrong.

  Many scripts assume that a primitive within the primitive set will always have the same binding number, and when primitives are added or removed the script crashes.

I'm going to create a few scripts to see what exactly is going on.

Script: LinkSpy.lsl


PutTextInfo(){string sMessage ="Link: "+(string) llGetLinkNumber()+"\n"; list lResult = llGetLinkPrimitivePar…

My marketplace restored

Image
I have added a few products to my marketplace. Little by little I will be adding more products. Basically those that do not require an update script until I have finished implementing my own update system.

At the same time they are also in the new section of my store.


On the right side of the photo are the lifting platforms. One to go up and another to go down. But the upper levels are empty.


snippet - Limit floats numbers and vectors to 2 digits.

Two little LSL functions to limit floats to only 2 digits.



string float2Str(float in){return(string)((integer)in)+"."+(string)((integer)((in -(integer)in)*100));} string vector2Str(vector v){return"<"+ float2Str(v.x)+", "+ float2Str(v.y)+", "+ float2Str(v.z)+">";}default{ state_entry(){} touch_start(integer total_number){ vector v =<215.7509,235.845750,4001.50356>; llOwnerSay((string) v +" ======= "+ vector2Str(v));}}

If you wants less or more decimals you must modify the float2Str function and change the 100 by 10 if you want only 1 decimal or 1000, 10000, etc if you want more decimals.


All my things temporarily removed from Marketplace.

Almost everything I have, except for cheap things, has an update script inside. That script stopped working because the creator stopped marketing it and closed its website.

I am currently creating my own update server. The development is slow. PHP is a hell for those of us who are used to languages compiled with strong typing.

Sometimes an error writing the name of a variable makes me waste a lot of time until I realize it.Due the variables do not need to be previously declared, instead of notifying me of an error it is simply a new variable

When everything is tested and working I will update all my things one by one, at the same time that I publish new developments. At the same time I will be adding all those things to Marketplace.



Reading headers in a PHP script

When an http request is made from a script within a secondlife to an external web server, the simulator adds some headers such as X-Secondlife-Shard or X-Secondlife-Owner-Key. In this way I save the work of having to send that data in the POST.

There are many examples doing a few searches. One of the most popular codes uses a huge "if" to distinguish when the variables arrive in Apache form or arrive entirely in uppercase with the prefix "HTTP_". I distrust that solution for being Spaghetti code.

Another more elegant solution reimplements the apache_request_headers () function by checking before it does not exist. Only one problem, in my environment it does not work. This function is implemented but the headers from secondlife are in uppercase format.

Finally I had to create my own version. I include the code of two PHP scripts and an lsl script.

File: slHeaders.php    The following file is included as is on the web server

<?PHP class SlData { …