Jump to content

Miranda Umino

Resident
  • Posts

    411
  • Joined

  • Last visited

Posts posted by Miranda Umino

  1. google spreadsheet  and google document allows you to export your document as plain text .

    Or as JSON  text .

     

    So , maybe you will get less difficulties to parse your document .

     

    Nevertheless you need to consult the documention of google about the URLs .

    Your actual fields are "edit?sharing=xxx" . But with LSL , you don t want to edit it .

    To export a document , the fields are  export?exportFormat=txt 

    Change too the mimetype to text/plain

     

    Let's fix your script:

     


    key http_request_id;

    // URL for my google document
    string BASE_URL = "https://docs.google.com/document/d/1CkDj9dCAfK46J9I_AjNI-_7EvSGmRuGzSev2NRx7v8A";
    // fields to add to the URL for a google document to watch it as text
    string SUFFIXE_URL = "/export?exportFormat=txt";


    default
    {
    state_entry()
    {
    string URL = BASE_URL + SUFFIXE_URL;
    http_request_id = llHTTPRequest(URL ,
    [HTTP_METHOD, "GET",
    HTTP_MIMETYPE, "text/plain",
    HTTP_BODY_MAXLENGTH,16384,
    HTTP_PRAGMA_NO_CACHE,TRUE], "");
    }

    http_response(key request_id, integer status, list metadata, string body)
    {
    if (request_id != http_request_id) return;// exit if unknown

    vector COLOR_BLUE = <0.0, 1.0, 0.0>;
    float OPAQUE = 1.0;

    llSetText(body, COLOR_BLUE, OPAQUE);
    llOwnerSay("\nstat : " + (string)status + "\nmeta : " + llDumpList2String(metadata," , ") );
    }
    }

     

    You may export to to tsv( tab separated text),  csv( comma separated text ) etc ....

     

    For spreadsheet , by default the first sheet of the speadsheet is returned . If you want an another sheet you will need to specify the number of the sheet in the url ( &gid=2 or 3 or 4 etc .. )

    With spreadsheets , you may specify too a range . So you won t need to fetch the whole sheet ; you will get only the interesting cells for you lsl script

    If you use too google charts , you may use "named ranges" too . So if your range is dynamic and not static , you won t need to change your lsl script

    If you are not english and you try to export to csv or tsv , fill the regional and international setteings for US English in your document ( inside the google page)  . For instance , in Europe , we use "," and not "." to decimate numbers . So when we export to csv,  if we have not  changed the international settings  , it will separate the frac and the non-frac.

     

     

    And finally , the hover text  defined by llSetText is limited to 254 characters .

    Inside your httpèresponse , maybe you can save the body of the http response in a string and write your string in several parts 

    • Like 1
  2. To convert radians in degrees :

    angle_in_degrees =  RAD_TO_DEG * angle_in_radians ;

    To convert degrees in radians :

    angle_in_radians =  DEG_TO_RAD * angle_in_degrees ;

     

    Or , if you don t use the constants  RAD_TO_DEG and DEG_TO_RAD , think that PI radians = 180 degrees , so

    angle_in_degrees =  180 * angle_in_radians  / PI;

    angle_in_radians =  PI * angle_in_degrees  / 180.0;

     

    A rotation is  the combination of an angle and an axis : the axis of rotation   ( you may get it by llRot2Axis ) and the angle  ( relative this axis .  ( you may get it by llRot2Angle ) 

    An another equivalent definition of rotation is the combination of 3 axis : the LOCALS  axis x ,  y and z. You may get them by respectively llRot2Fwd , llRot2Left , llRot2Up 

    For instance :

    float magnitude =  3.0 ; // speed is 3 meters per seconds
    llSetPhysicsMaterial(GRAVITY_MULTIPLIER, 0 , 0, 0, 0); // ignores the gravity llSetStatus(STATUS_PHYSICS, TRUE ); // turns on physics
    // moves to a constant velocity in the local X direction and with a speed equals to magnitude( 3meter/second)llSetVelocity(  magnitude * llVecMag(  llRot2Fwd( llGetRot () ) , TRUE );
    llSleep(2.0) ; waits 2 seconds before to stop physicsllSetStatus(STATUS_PHYSICS, FALSE ); // turns off physics

     

     

     

     

  3. There is faster .

     

    You need some preparation in the rezzed prim .

    In the rezzed prim , you have already wroten a tiny script who request permission and link to the root  prim.

    After it has linked to the root prim , it deletes its script

     

    In the root prim , you don try to link .. You only rez .

     

    Finally : with the Ron Khondi's version :

    - it s easier to setup ( no need to prepare the permissions ) :

    - it s slow :

     N * 1/45 second because you can t enter in the same event twice in the same simulator frame

    + N * 1 second : delay for the link

    + N * 0.1 second : delay for the rez 

    For instance ,

    for 100 prims , it will take 100/45 + 100*1 +100*0.1 = 112 seconds

    for 255 prims , it will take 255/45 + 255*1 +255*0.1 = 286 seconds

     

    With one version where it s the  rezzed prim who tries to link to the root  :

    - it s more difficult to setup ( need to prepare permissions )

    - it s difficult to transfer to someone ( it s a big inconvenient ) because we can t change the permissions inside a content when it s not rezzes and when we change the owner of the object

    - it s faster :

    N * 1/45 s

    + N * 0.1 s ..  

    for 100 prims , it will take 100/45 + 100*1 = 12 seconds . So 9 to 10 X faster

     for 255 prims , it will take 255/45 +255*0.1 = 31 seconds

     

    This is the script to put in the rezzer object

     

    integer count;integer channel = -44451552;string objectName = "Object";string message = "ack";default{    touch_start(integer total_number)    {        llResetTime();        llRezObject( objectName, llGetPos() + <.0, .0, (float)count/10 + .1>, 
    ZERO_VECTOR, ZERO_ROTATION, (integer)("0x"+llGetSubString(llGetKey(),-8,-1)) ); } object_rez( key child_id ) { ++count; llRegionSayTo (child_id, channel, message); if (count < 90) { llRezObject( objectName, llGetPos() + <.0, .0, (float)count/10 + .1>,
    ZERO_VECTOR, ZERO_ROTATION, (integer)("0x"+llGetSubString(llGetKey(),-8,-1)) ); } else { llOwnerSay("Time = " +(string)llGetTime()); state dummy; } llSetText("Number of prims = "+(string)llGetNumberOfPrims(), <1,1,1>, 1); } }state dummy{ state_entry() {}}

      

    And this is the script to put in the rezzed prim . Save it , grant the permissions , take the object in your inventory . and copy it inside the content inventory of the rezzer

     

    integer channel = -44451552;string message = "ack";default{    state_entry()    {       llRequestPermissions(llGetOwner(), PERMISSION_CHANGE_LINKS);       llListen(channel, "", NULL_KEY, message);    }    listen(integer channel , string name , key k, string m)    {        if ( (integer)("0x"+llGetSubString(k,-8,-1)) == llGetStartParameter() )        {            if ( llGetOwner() == llGetOwnerKey(k ) )            {                llCreateLink(k, FALSE);            }        }    }    changed(integer c)    {        if ( c & CHANGED_LINK )        {            if ( llGetNumberOfPrims() > 1 )            {                llRemoveInventory(llGetScriptName());            }        }    }}

     

     Of course , you can even link faster 

    - if you don t rez individual prim but bulk prims (  but bulk objects add one constraint too )

    - if you have already rezzed all your prims and know all the keys  ( other constraint too )

     

  4. I am using the change event and i check with it CHANGED_INVENTORY .

     

    When i remove ( or when i add) several items in the content inventory of the prim , for instance 30 objects , several change events are triggered .

    Not one per item added or deleted but one by "block"

     

    Does someone know  if the size of the number items changed before to trigger an another change event is fixed ?

    Is it variable ? What is the rule exactly ?

     

     

  5. Your script is probably incorrect , so .

     

    When you call llRequestPermissions , it revokes the old permissions .

    So , when you call llRequestPermissions to control animations for the second avatar , you loose the previous premissions

    granted to the first avatar

     

    To animate your second avatar , use a second separated script

     

  6. Now, imagine you are driving up a very steep spiral mountain road to the summit, which is three miles above the base. Your speedometer reads 60mph (Slow down! Are you crazy?). After one hour of driving up that mountain. You look at your GPS screen and see you've gone only 10 miles. How the hell did that happen? Part of the answer is obvious. The road was spiral, so we spent a lot of time driving in circles. You could drive on a roundabout all day and get nowhere (something Parhelion Palou and I recently discussed, and want to try).

     So ,for GPS :

    vector v = llGetVel();v.z = 0.0;llOwnerSay((string)llVecMag(v));

     ??

     

    I ve got an another question :

    do the speedometer  ( or the GPS ) work on a local frame or a world frame ?

    When you drif for instance and you cut the motor , do they report velocity on the frame of the vehicle  or the velocity in the world by the drift ?

    Should it be  llVecMag( llGetVel() / llGetOmega()  ) ?

  7. First point :

    don t be confused by CONTROL_ML_LBUTTON ( triggered only on mouselook mode and a left click mouse )

    and CONTROL_LBUTTON ( triggered only in normal view mode and a left click mouse )

     

    Second point :

    If it happens when you use the keyboard  AND if you handle the keyboard :

    it s because your rates for your hardware are different between the keyboard and the mouse :

    generally , keyboard triggers 45 events per seconds , mouse triggers 26 events per seconds.

    (It can be different on some different computers)

    I tell this because you can move your avatar on clicking on the land and without use the keyboard in normal view ; in mouselook you are obliged to use the keyboard to move your avatar

     So , maybe your count is not correct and you count some keyboard events in mouselook mode

     

  8. llFrand(-1000000000.0) is totally valid :

     

    default{    state_entry()    {        integer channelDialog1 = (integer)(llFrand(-1000000000.0) - 1000000000.0);        integer channelDialog2 = (integer)(llFrand(-1000000000.0) - 1000000000.0);        llOwnerSay(llList2CSV([ channelDialog1, channelDialog2 ]));    }}

     outputs

    -1384138496, -1555145472 as expected

     

    There are two errors , the both are in using llDetectedName(i ) or llDetectedName(0) inside the listen event :

    state secondDialog{...........    listen( integer i, string n , key k, string m)    {        string avName;        string origName = llGetObjectName();// llDetectedName(i) returns NULL_KEY// because llDetectedName doesn t run inside the"listen" event// llDetectedName  runs inside touch* , collision*, sensor event// Error ------>        avName = llDetectedName(i);
    avName = llList2String( llParseString2List( avName, [" "], [] ), 0 ); llSetObjectName( avName );
    // llDetectedName(0) returns NULL_KEY// because llDetectedName doesn t run inside the"listen" event// llDetectedName runs inside touch* , collision*, sensor event// Error : -------> string detectedName = llDetectedName(0); llSay(0, avName + " " + choicedOption + "ed " + m + " "); llSetObjectName( origName ); state default; }

     

     

     

    I am not sure if the final message is 

    the first name of the toucher has pickpocket/confused  the fist name of the menu displayed 

    But the code should be closed to this :

    list listOptions = [ "picpocket", "confuse" ];list listAvatarsSensor;list listAvatarsFullNameSensor;integer channelDialog ;integer handleListener;string choicedOption ;string avatarNameHavingMenu;key avatarKeyHavingMenu;float timerDialog = 15.0;float range = 5.0;// Function with// input : full name of one avatar// output : first name of this avatarstring fullName2firstName(string fullName){    return llList2String( llParseString2List( fullName, [" "], [] ), 0 );}default{    touch_end(integer total_number)    {        avatarNameHavingMenu = llDetectedName(0);        avatarKeyHavingMenu =llDetectedKey(0);        state firstDialog;    }}state firstDialog{    state_entry()    {        channelDialog= (integer)(llFrand(-1000000000.0) - 1000000000.0);        handleListener = llListen(channelDialog, avatarNameHavingMenu , avatarKeyHavingMenu  , "");        llDialog(avatarKeyHavingMenu, "Choose an option:" , listOptions, channelDialog );        llSetTimerEvent(timerDialog);    }    listen( integer i, string n , key k, string m)    {        choicedOption = m;        llSensor("",NULL_KEY,AGENT,range,PI);    }    sensor(integer n)    {        integer i ;        listAvatarsSensor = [];        listAvatarsFullNameSensor = [];        do        {            listAvatarsSensor += [ llGetSubString(llDetectedName(i), 0, 23)  ] ;            listAvatarsFullNameSensor += [ llDetectedName(i)  ] ;            i++;        } while ( i < n);        state secondDialog;    }    timer()    {        state default;    }    state_exit()    {        llListenRemove(handleListener);        llSetTimerEvent(0.0);    }}state secondDialog{    state_entry()    {        channelDialog= (integer)(llFrand(-1000000000.0) - 1000000000.0);        handleListener = llListen(channelDialog, avatarNameHavingMenu, avatarKeyHavingMenu , "");        llDialog( avatarKeyHavingMenu, "Choose an avatar:" , listAvatarsSensor, channelDialog );        llSetTimerEvent(timerDialog);    }    listen( integer i, string n , key k, string m)    {        integer index = llListFindList(listAvatarsSensor, [ m ]);        if ( index != -1 )        {            string pickpocketed = llList2String( listAvatarsFullNameSensor, index );            pickpocketed = fullName2firstName(pickpocketed);            string pickpocketer = fullName2firstName( avatarNameHavingMenu );            string origName = llGetObjectName();            llSetObjectName( pickpocketer );            llSay(0, pickpocketer + " " + choicedOption + "ed " + pickpocketed + " ");            llSetObjectName( origName );            state default;        }    }    timer()    {        state default;    }    state_exit()    {        llListenRemove(handleListener);        llSetTimerEvent(0.0);    }}

     

     

  9. Has anyone succeded to "create"  a script with Experience ?

     

    I have got the XP viewer ; the script editor has always the "use experience"  toggle disabled.

    The Documentation tells i need to be "a crontibutor experience" but doesn t tell how to become a "contributor experience"

    Scripts in the Wiki inside the LSL portal fail because they don t find any experience

     

    To sum : nothing work

     

  10. Cloud party was all so using javascript

     Yes .... But a total nerfed version of javascript &colon;

     

    One instance amongst several : the last time i went there , the loops structures ( do.. while ; for ; repeat ) didn t exist .

    At cloudparty , they did the repetitive tasks with a timer ... boring ...

    If i remember , there were no possibilities to create some libraries too , to avoid the repetition of code.

     

    No interest to have a OOP language if the code is limited to the current script

     

     With High Fidelity , there is this possibility to include scripts :

    https://github.com/highfidelity/hifi/blob/master/examples/includeExample.js

     

    There is nevertheles something i can t find in the examples : how they deal errors when there is a call to a service ?

    Is an exception triggered ? Is there an example ?

     There are some events to listen the keyboard and the mouse , but are there some events to listen an action in-world ( an action not fired by the script but by other scripts in-world) or an execution of a service ?  Is there an example ?

     

    Pretty nice job for the moment . A good way

     

  11. yes , logarithmic .

     

    Indeed :

    - at the start, you have your hud who wontains the new script , and the list of keys of objects you want updated

    - aat the iteration 1 , you send the script to one object , but this object can too work in parallelism with your hud to send the new nscript to the others , so you send too the half of list of keys

    - iteration   2 , your hud send the half of the half of initial list to an another object  and the new script ; the first object sends too one half of half of the initial list to an another object ; and as it has got now the new script , it  gives it to an another object . so 2 objects will be updated at this time . as the last step , they can work in parallelism with the hud and the 1st object tosend the new script too to other objects

    - iteration 3, your hud continues to work with the 1/8th of the iitial list . the 3 other objects do the same . so 4 objects will be updated at this step . Total of objects with the new script is 4 + 2 + 1 = 7

    - iteration 4 : 8 objects will be updated at this step ; Total of objects with the new script is 8 + 4 + 2 + 1 = 15

    - iteration 5 : 16 objects will be updated at this step ; Total of objects with the new script is 31

    - iteration 6 : 32 objects will be updated at this step ; Total of objects with the new script is 63

    - iteration 7 : 64 objects will be updated at this step ; Total of objects with the new script is 127

     

    7 steps are enough to update your 100 objects ., so 21 secondes are caused by the delay .

    In a general formule , total time of the delay is 3 secondes * LN base 2 ( 100) .

    Of course in practice there will be some other seconds by overhead , but you will be very far from 5 minutes

     

     

  12. As you can see the issue is the 3 sec delay caused by llRemoteLoadScriptPin. 

    In a building project it would not be unheard of to have more than 100 building prims,

    and having it take 5 minutes to distribute one script is just not workable.

     No ,  it won t be 3 s  * 100 = 5 minutes  :

    it will be around 3 s * LN(100) / LN( 2 ) = 20 seconds

  13. You don t need to have the same number of giver scripts as the number  of given scripts.

    If you have 10 givers and 100 given , it will divide your time by 10 .

    Not neglectible

    Extreme ? Maybe ... As much as it is to give 100 scripts ...

     

     

    Question ? is it the same script given 100 times ?

    In this case , the script given can give itself too .

    The recursivity will  make replicate scripts in few steps : 2,4,8,16 etc ..

     

  14. so , to test if the last key exists in the sim  ?

    if it does not , to refresh with llGetkey ?

     

    key myVariable;......if ( llList2Vector( llGetObjectDetails(myVariable, [OBJECT_POS ] ), 0 == ZERO_VECTOR )myVariable = llGetKey();.........

     

    or faster :

    key myVariable;........if ( myVariable != llGetKey() )myVariable  = llGetKey(); ????

     

  15. You may have sevarl scripts who call llRemoteLoadScriptPin  at the same time .

     

    For instance , 

    you have one main controller script , who callls llMessageLinked to the other scripts with a parameter

    The other scripts who receive link_message and call llRemoteLoadScriptPin  : the parameter sent by the controller informs which "passive" script you want to remoteload

     

    In this case , your effective delay will be 3 seconds / number of scripts who call llremoteLoadScriptPin

  16. number of particles ( after  some seconds of starting)  are 

    PSYS_PART_MAX_AGE * PSYS_SRC_BURST_PART_COUNT / PSYS_SRC_BURST_RATE

     In your script :

    PSYS_PART_MAX_AGE  filled with max_age = 9.5

    PSYS_SRC_BURST_PART_COUNT filled with count   = 1

    PSYS_SRC_BURST_RATE filled with rate = 0.01

     

    After some seconds , your system creates 9.5*1/0.01= 950 partiicles by second .

    It s a bit big

     

     

    Play with these 3 parameters to change the number of particles.

     

    Nevertheless , number of particles don t change the "density" of particles . You could "feel" there are more particles in changing other variables when in fact there are the same number or even less

  17. I disagree .

    Firstly , the decision of 28-02-2014 gives back the authorisation in writing ; not only reading.

    Secondly , even with only the authorisation in reading ( no-writing) , it won t prevent to get some flames and dramas elsewhere in forums , blogs , or here with big speculations about what s happening and why it s happening

    Thirdly , i don t see why you try to test in every channels . There is a field dedicated for the channel ( or the sim ) where the bug is met . The QA team can easily determinate , when the bug is reproducible , which channels are impacted.

    Fourthly, it s not your role to avoid duplicates . It s the role of the QA team .  And sometimes duplicates are needed : because the bug has been detected in a particular way for an user . But , nearly always , the bug has other impacts  and can be detected differently by other users .  Several use cases are needed to know in depth  what s happening.

    It s in crossing the informations and the different inputs or experiences , we fix better the bugs.

    If i fill a JIRA "this feature doesn t work sometimes, for instance this function in LSL doesn work for some specific values of input" , and i give some instances of failures ,  , i won t be exhaustive . And if you read later my JIRA , in thinking "oh .. i won t create a duplicate" , the fix of Linden will be wrong : it will fix maybe the bug for my specific inputs , but maybe not for your inputs

     

  18. Your max speeed in other games of   around 80-100 kbps : they are kilo BYTES per seconds

    When youplay SL, your download speed  around 300-400 kbps : they are kilo BITS per seconds  . So 8 X less .

    Yes your SL download with the very , very , very low performance of 40-50 kilo bytes per seconds .

     

    To add .. I have never seen in Europe  with DASL connections ,   someone having SL upper to 1500 kilo BIT per seconds .. So a ridculous low  traffic of 200 kilo Bytes per second

    Even when their DASL  bandwith can download 20 mega bit per seconds ( 20 000 kilo bits per seconds if you prefer )

     

    SL has ALWAYS downloaded lower than the other applications .

     

     

    You may verify by other tools  who log your traffic network

     

×
×
  • Create New...