ingen-lab / Ruth

Project Ruth - an Open Source Mesh Avatar by Shin Ingen
56 stars 38 forks source link

Possible Bug: Elenia's Save Alpha Code #23

Open SundanceHaiku opened 6 years ago

SundanceHaiku commented 6 years ago

Elenia,

I tried using the "Save Alpha" button, but it doesn't appear to be saving the alpha configuration. When I re-set the alpha and then try to use "Load Alpha" to bring back the previously saved alpha configuration, nothing happens (except for a brief time, the right upper leg goes transparent.) Perhaps, I'm going about it wrong. Let me know if I am. Probably the best way to demonstrate is to use several screen shots. Take a look and let me what you think. bug1 bug2 bug3 bug4

SundanceHaiku commented 6 years ago

I see one possible place where part of the problem might be located. In the Alpha Sender Script (r2HUD_ac_trigger_rc2_EB_beta-1.lsl) on line 204, you have:

list colors_prim = llList2ListStrided(llGetLinkPrimitiveParams(LINK_SET, params), 127, -1, 2) + stuffing;

I tested llGetLinkPrimitiveParams(LINK_SET, params) and it ends returning an empty string. That means that "colors_prim" only picks up the contents of the variable "stuffing." From my tests, it doesn't appear that you can use LINK_SET with llGetLinkPrimitiveParams.

EleniaBoucher commented 6 years ago

Hello Sundance :) Yes I am thinking this is a little bug. Because the last week I got something very similar when I wanted to try with a rezzed body on the ground, that I worn also a Ruth2 body. I asked myself questions for a few minutes. Perhaps is it the same case for you ? I have jot down to append a little warning if when the hud requests the alpha states to the body to send a warning to the user if the hud receives more than one answer. Because I guarantee that llGetLinkPrimitiveParams(LINK_SET, params) works fine. With params has value a list composed of [PRIM_COLOR, 0, PRIM_COLOR, 1, ... until... PRIM_COLOR, 7] it returns an enormous list length total_prims 8 2 that I had some difficults to calculate the llList2ListStrided parameters to reduce it to more easily parse and I hope to decrease the memory complexity.

2018-02-11 3:32 GMT+01:00 Sundance Haiku notifications@github.com:

I see one possible place where part of the problem might be located. In the Alpha Sender Script (r2HUD_ac_trigger_rc2_EB_beta-1.lsl) on line 204, you have:

list colors_prim = llList2ListStrided(llGetLinkPrimitiveParams(LINK_SET, params), 127, -1, 2) + stuffing;

I tested llGetLinkPrimitiveParams(LINK_SET, params) and it ends with NULL. The means that colors_prim results in the contents of stuffing. It doesn't appear that you can use LINK_SET.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Outworldz/Ruth/issues/23#issuecomment-364714036, or mute the thread https://github.com/notifications/unsubscribe-auth/AgEkXb4NGixZP47BaazmB8foSt483aRcks5tTlE1gaJpZM4SBHN8 .

SundanceHaiku commented 6 years ago

Thanks Jet, I'm attaching an image, showing the code where I isolate the problem. I test for the result of llGetLinkPrimitiveParams(LINK_SET, params). There are a lot prims in the HUD, and yet, as you can see, the return is an empty string. Any ideas? bug5

typhartez commented 6 years ago

The value of params seems invalid. Anyway, you can't call llGetLinkPrimitiveParams() with LINK_SET. Valid values for this functions are explained on the SL Wiki :

link needs to be either an actual link number or a link constants that equate to a single prim, such as LINK_ROOT and LINK_THIS.

SundanceHaiku commented 6 years ago

"Anyway, you can't call llGetLinkPrimitiveParams() with LINK_SET"

Typhartez, thank you for your response.

Yes, in fact, that was my understanding from reading the Wiki as well, but the Wiki is a little vague about it. JetTay40, in his response, indicated that, indeed, it was possible, and I thought perhaps, under different environmental conditions, it had worked for Elenia.

At any rate, my test is showing that it does not work, and Typhartez is confirming that. Elenia Boucher who wrote the code will probably want to find a different approach.

Elenia . . . at least we've identified one bug for you. Let me know when you have a fix, and I'll run another test.

EleniaBoucher commented 6 years ago

Hello
Yes the wiki is a little messed. But not false.
The problem is that these lazy Lindens have used the same page for two functions.
llGetLinkPrimitiveParams() with LINK_SET works fine.
Explanations of the wiki : llGetPrimitiveParams llGetLinkPrimitiveParams() with LINKSET (or others LINK* multiple prims) doesn't work? If it's true then I have a big new : it's totally useless: we can do exactly the same job with :

llGetPrimitiveParams([PRIM_LINK_TARGET, num_of_an_uniqueprim, PRIM*...])

But Sundance seriously tried on. Then there is another thing. Two ideas :

  1. The simulator script engine doesn't support llGetLinkPrimitiveParams() with LINK_SET. Perhaps. With the mine on OSgrid (OpenSimulator 0.9.1.dev.8fe16a1974) it works perfectly.
  2. Sometime in some unknown cases the implicit cast llList2String() returns empty string. I recommand to use an explicit cast as (string)llList2Vector().

I've not writing LSL scripts since five years. But I remember that before left SL where I scripted during seven years, I got twice the case 2, and the second time after a pair of hours to find the problem I decided to never again use this implicit cast.

Please try this script, in the alpha hud. I you don't get 8 vectors in the chat that is the case 1, if not that is the case 2.

default{
    state_entry(){
        list params = [];
        integer i;
        for(;i<8; i++){
            params +=  [PRIM_COLOR, i];
        }
        list my_list = llGetLinkPrimitiveParams(LINK_SET,  params);

        integer end = 17;//llGetListLength(my_list);
        for (i=0; i<end; i+=2){
            llOwnerSay((string)llList2Vector(my_list,i));
        }
    }
}

Another test very easy, in my r2HUD_ac_trigger_rc2_EB_beta script : Description of the image Thank to say me the result. Because in case 1 yes I have to modify the scripts: they must run fine on all simulators, even old versions.

SundanceHaiku commented 6 years ago

Here are the results of the first test:

bug7

And here is the result of the second test:

bug6

These tests were done in Second Life - most recent version (5.0.9.329906)

Outworldz commented 6 years ago

My experience is the the llGetLink set commands all return everything as strings. I suggest in Opensim trying (vector) llList2String(...) if you need vectors.

EleniaBoucher commented 6 years ago

Hello strange that on Second Life this also doesn't work.

But I have seen in your screenshot an explication : you use my feet-hand hud ; it just the begin of this project, it's a draft. And the script have not been adjusted to work with this hud, no yet. Soon, yes. Please use the official RC2 alpha hud. I am thinking that we shall meet on your grid , that I check if my body always works, and if yes that I give you my version that work. An encounter is it possible ?

2018-02-14 18:55 GMT+01:00 Fred Beckhusen notifications@github.com:

My experience is the the llGetLink set commands all return everything as strings. I suggest in Opensim trying (vector) llList2String(...) if you need vectors.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Outworldz/Ruth/issues/23#issuecomment-365690455, or mute the thread https://github.com/notifications/unsubscribe-auth/AgEkXcIeRehIHFea_UFxg3IE2vwq91bIks5tUx3bgaJpZM4SBHN8 .

SundanceHaiku commented 6 years ago

Elenia, I would be happy to meet on the SL grid. (I've been testing on the beta grid, since uploading is free.) I have an illness in the family and must travel, but I should be able to get free next week some time.