MantisBT - opensim
View Issue Details
0008056opensim[REGION] Script Functionspublic2016-11-12 11:362017-03-22 13:59
mikelorrey 
 
normalminoralways
newopen 
KitelyOpenSim 0.8.2.1 Release 0.8.2.1
 
 
Grid (Multiple Regions per Sim)
ODE
Mono / Linux64
None
0008056: llVolumeDetect(TRUE); fails on region restart/bootup
Created a volume detect script for entryway "force fields" to flash when someone passes through the door. When the region shuts down and reboots, the volume detect function breaks/ceases function, requiring a touch reset by the owner, with the following script:

//Force Field Flashy Thingy v0.1 by Mike Lorrey
default
{
    state_entry()
    {
        llSay(0, "Entry Scanners Active...4...3....2...57...42...1...");
        llVolumeDetect(TRUE);
    }
    on_rez(integer start) {
        llResetScript();
        llSay(0, "Entry Scanners Active...4...3....2...57...42...1...");
        llVolumeDetect(TRUE);
    }
    
    collision_start(integer number){
       llSetLinkPrimitiveParamsFast(LINK_ROOT,[PRIM_GLOW,ALL_SIDES,0.5]);
       llSleep(0.5);
       llSetLinkPrimitiveParamsFast(LINK_ROOT,[PRIM_GLOW,ALL_SIDES,0.0]);
    }
    touch_start(integer number) {
      if (llDetectedKey(0)==llGetOwnerKey(llGetKey())) {
         llResetScript();
        }
    }
}

I had to make the klunky fix to make it work, which resets the script and turns volume detect to false then true again:

//Force Field Flashy Thingy v1.1 by Mike Lorrey
default
{
    state_entry()
    {
        llResetScript();
        llVolumeDetect(FALSE);
        llSleep(1.0);
        llSay(0, "Entry Scanners Active...4...3....2...57...42...1...");
        llVolumeDetect(TRUE);
    }
    on_rez(integer start) {
        llResetScript();
        llVolumeDetect(FALSE);
        llSleep(1.0);
        llSay(0, "Entry Scanners Active...4...3....2...57...42...1...");
        llVolumeDetect(TRUE);
    }
    changed(integer change)
    {
        if (change & CHANGED_REGION_RESTART) {
        llResetScript();
        llVolumeDetect(FALSE);
        llSleep(1.0);
        llSay(0, "Entry Scanners Active...4...3....2...57...42...1...");
        llVolumeDetect(TRUE);
        }
    }
    
    collision_start(integer number){
       llSetLinkPrimitiveParamsFast(LINK_ROOT,[PRIM_GLOW,ALL_SIDES,0.5]);
       llSleep(0.5);
       llSetLinkPrimitiveParamsFast(LINK_ROOT,[PRIM_GLOW,ALL_SIDES,0.0]);
    }
    touch_start(integer number) {
      if (llDetectedKey(0)==llGetOwnerKey(llGetKey())) {
         llResetScript();
        }
    }
}

1) Apply the first example script above to a prim in a region using 0.8.2.1 with ODE
2) try it out
3) shut down your region
4) restart your region
5) prim remains phantom, but doesn't register any collisions. Flashing fails to occur.
No tags attached.
Issue History
2016-11-12 11:36mikelorreyNew Issue
2016-11-12 12:17UbitUmarovNote Added: 0031274
2017-02-04 13:43Ferd FrederixNote Added: 0031580
2017-03-22 13:59Ferd FrederixNote Added: 0031655
2017-04-08 23:30Ferd FrederixNote Deleted: 0031655
2017-04-08 23:31Ferd FrederixNote Edited: 0031580bug_revision_view_page.php?bugnote_id=31580#r6099

Notes
(0031274)
UbitUmarov   
2016-11-12 12:17   
I can only say that your script seems to work correctly with 0.9/0.91 master.
I personally can not support older versions.
Also even with 0.9x problems specific to old ODE may not be fixed, since its only maintained for compatibility, and that does include some of its bugs.
(0031580)
Ferd Frederix   
2017-02-04 13:43   
(edited on: 2017-04-08 23:31)
This is dependent upon Linux versus Windows, too. I had to add a llSetStatus(STATUS_PHANTOM,FALSE) on a Linux box, which was not necessary on Windows 0.8.2.1

This code below has always worked for me on various revs, Linux and Windows operating systems, 0.8.2.1, and 0.9 systems.

    state_entry()
    {
        llVolumeDetect(FALSE);
        llSetStatus(STATUS_PHANTOM,FALSE); // Linux specific
        llSleep(0.1); // necessary evil to wait a frame so the physics engine knows.
        llVolumeDetect(TRUE);
    }
    changed(integer change)
    {
        if (change & CHANGED_REGION_START) {
             llResetScript();
        }
    }