Don't click here unless you want to be banned.

LSL Wiki : llGetRegionTimeDilation

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl338.us.archive.org
float llGetRegionTimeDilation()

Returns the time dilation of the current region (simulator) as a float between 0 and 1.

Time dilation occurs when the sim can't keep up with the processing of its tasks even after reducing the time allocated to scripts and physics. Avatars will experience this as slowed-down (slow-motion, "bullet-time") movement.

If you have many scripts running in a sim (or physical objects), it would be considerate to pause them when the time dilation drops below a certain threshold (0.8 - 0.9).

See llGetRegionFPS and lag.

This is a script that will automatically pause all scripts once dilation drops below 0.65:

integer running;

string giv(integer type,integer i) {
    return llGetInventoryName(type,i);
}

default
{
    on_rez(integer s) { llResetScript();} //Habit - llGetOwner() has a habit of returning the old owner's name when given to another person.

    state_entry()
    {
        llSetTimerEvent(0.3); //Repeat every 3/10th of a second.
        running = TRUE;
    }

    timer() {
        float dilation = llGetRegionTimeDilation(); //Get the dilation
        if(dilation < 0.65 && running) {  //If the dilation is less than 65%
            llOwnerSay("Time Dilaton is critical! Pausing scripts!"); //Say to the owner that message
            integer x;
            for(x=0;x<llGetInventoryNumber(INVENTORY_SCRIPT);x++) {
                if(giv(INVENTORY_SCRIPT,x) != llGetScriptName()) { //If the script number x is not this script
                    llSetScriptState(giv(INVENTORY_SCRIPT,x),FALSE); //Pause it
                }
            }
            running = FALSE;
            llOwnerSay("Done.");
        }
        else
        if (!running)
        { //If the dilation is more than 65%
            integer x;
            for(x=0;x<llGetInventoryNumber(INVENTORY_SCRIPT);x++) {
                if(giv(INVENTORY_SCRIPT,x) != llGetScriptName()) {
                    llSetScriptState(giv(INVENTORY_SCRIPT,x),TRUE); //Enable all scripts
                }
            }
            running = TRUE;
        }
    }
}


This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

Functions | Simulator | Time | Lag Jasa SEO Jasa SEO Murah Sepatu Online Toko Sepatu Online Sepatu Sepatu Murah Sepatu Safety Sepatu Futsal Cheapes Hostgator Coupon Link Booking Televisori offerte Notebook Offerte Berita Terkini Internet Marketer Muda Internet Marketer Indonesia Portatile Apple RDAnet Lorks Karikatur Bisnis Modal Kecil Bisnis UKM Berita Terbaru Iklan Baris Jasa SEO Jasa SEO Murah SEO Indonesia Konsultan SEO SEO Belajar SEO Kursus SEO Kursus SEO Murah Jam Tangan Casio Jam Tangan Casio Jam Tangan Murah Jam Tangan Grosir Baju Terbaru Grosir Baju Baju Terbaru Grosir Baju Murah Bisnis Online Belajar SEO Kerupuk Kerupuk kulit Social Bookmark Dofollow Social Bookmark Kumpulan Puisi Kirim Puisi bola hantu Penumbuh Rambut Penumbuh Rambut timbangan WBC Wonogiri Jasa SEO Murah Jasa SEO Jam Tangan Murah
There are 3 comments on this page. [Display comments/form]