partial Windlight Setting using LSL during Collision (VolumeDetect)
needs info
DelicateSoul Resident
I'm trying to set a specific Windlight for a small area (30x30 meters). My approach works for a few seconds until the region Windlight (day cycle) apparently "reverts" the temporary setting.
The script is placed in a prim (phantom), and avatar entry is detected using llVolumeDetect.
Log In
Maestro Linden
marked this post as
needs info
Maestro Linden
Hi DelicateSoul Resident, I have a few questions:
- To clarify, are you only seeing this issue for objects located certain parcels?
- Using llGetEnvironment, looks like your 'working' and 'broken' parcels have distinct environment settings. Is one of the parcel using the region settings, or are they both using a custom setting?
- Are the 2 scripted objects trying to set the same environment override with llReplaceAgentEnvironment?
- If you swap the positions of the 2 scripted objects to the other parcel, does one start working and the other stop working?
I tried the following on my own parcel, and am not immediately seeing any issues with an environment set by llReplaceAgentEnvironment():
- Set a basic day cycle environment on a parcel you control. I used the 'Weird-O' environment from Library, with asset ID 58c1a524-6784-d17a-60eb-f1482a7ae5fe
- Rez a box and place the script below in it. The box requests experience permissions on volumedetect collision, and then calls llReplaceAgentEnvironment once granted. The environment I use is a static sky with a grey-red color to it.
- Walk into the box and accept experience permissions if prompted.
- Observe that the sky turns grey-red
default
{
state_entry()
{
llVolumeDetect(TRUE);
}
collision_start(integer total_number)
{
key agent_id = llDetectedKey(0);
if (llGetAgentSize(agent_id) != ZERO_VECTOR)
{
llSay(0, "Requesting experience permissions on " + (string)agent_id);
llRequestExperiencePermissions(agent_id, "");
}
}
experience_permissions(key agent_id)
{
float transitionTime = 5;
key env = "23636925-73a4-e559-6b73-7471e87c8fb7"; // this is a static scene with a grey-red sky
integer result = llReplaceAgentEnvironment(agent_id, transitionTime, env);
if (result == 1)
{
llSay(0, "Applying environment " + (string)env + "for " + (string)agent_id);
}
else
{
llRegionSayTo(agent_id, 0, "Cannot apply environment for " + (string)agent_id
+ " due to reason id: " + (string)result);
}
}
experience_permissions_denied(key agent_id, integer reason)
{
llRegionSayTo(agent_id, 0, "Denied experience permissions for " + (string)agent_id
+ " due to reason id: " + (string)reason + " " + llGetExperienceErrorMessage(reason));
}
}
DelicateSoul Resident
Maestro Linden
Thanks for the comments and the test script
I think I've already figured out what the problem was, as I mentioned in my last comment.
It seems to be the case that a daily cycle cannot be replaced by another daily cycle because they may well influence each other.
However, I am happy to answer the questions asked
1) The objects contain the WL change script. The goal was: when an AV enters the cube (Prim), the WL/EEP should change.
2) Both plots use personal WL/EEP settings, which differ from the region settings.
3) Same environment override
4) The objects don't move! These are fixed objects. They are using the same settings and script. The 2 parcels I just did create to have 2 several parcel environments to reproduce (or coming closer) to a solution of the issue. One parcel uses a fixed environment - the other one uses a day cycle. - thats the only different.
Conclusion:
The âmistakeâ only seems to occur when you try to replace an existing daily cycle with another.
> Yes, the sky turns red when you enter the area - just as it shows a night sky with my implementation.
I hope to have answered all questions. If any further questions have arisen, I will answer them.
Maestro Linden
DelicateSoul Resident: Hm, your explanation seems plausible, but I'm having trouble reproducing it with a few cases. The basic flow I'm trying is:
- Visit the test parcel with 2 viewers, so that it's 100% clear if one viewer is getting an override
- Set the parcel to a static sky, like "StrawberrySingh.com Closeups" (535d4a34-2b73-d5e9-348c-5c30dcbb7b22) from Library
- Rez 2 copies of the script in my child comment, with one configured to set a static sky (2363..) and another configured to use a day cycle
- Enter and exit both boxes a few times with one avatar, and note if the sky updates compared to what the other avatar sees
- Set the parcel to a day cycle, like "Weird-O" (58c1a524-6784-d17a-60eb-f1482a7ae5fe) from Library
- Repeat step (4)
I'm seeing that llReplaceAgentEnvironment() always has the expected effect on the targeted avatar, for all 4 combinations static sky vs day cycle.
I _can_ reproduce the issue with your test script at https://maps.secondlife.com/secondlife/Town%20Blue%20Port/136/98/21 , so I think we're just missing part of the repro case. This might even be a viewer bug, in which the viewer ignores the override message sometimes.
I see that you have my original test script rezzed at https://maps.secondlife.com/secondlife/Town%20Blue%20Port/136/98/21 , and that it's currently behaving properly to override with static sky asset 23636925-73a4-e559-6b73-7471e87c8fb7. If you update the script to override with the 541d7b61-91ea-5a36-f309-f3bc33f10d26 is the "Psycho Strobe!" day cycle, does that case also fail?
Maestro Linden
// Environment asset to use with llReplaceAgentEnvironment()
// 23636925-73a4-e559-6b73-7471e87c8fb7 is a static sky, with a grey-red color
// 541d7b61-91ea-5a36-f309-f3bc33f10d26 is the "Psycho Strobe!" day cycle from library
key env = "541d7b61-91ea-5a36-f309-f3bc33f10d26";
OverrideAgentEnvironment(key agent_id)
{
float transitionTime = 5;
integer result = llReplaceAgentEnvironment(agent_id, transitionTime, env);
if (result == 1)
{
llSay(0, "Applying environment " + (string)env + "for " + (string)agent_id);
}
else
{
llSay(0, "Cannot apply environment for " + (string)agent_id
+ " due to reason id: " + (string)result);
}
}
default
{
state_entry()
{
llSetText("Enter for env override to " + (string)env, <1,1,1>, 1);
llVolumeDetect(TRUE);
}
collision_start(integer total_number)
{
key agent_id = llDetectedKey(0);
if (llGetAgentSize(agent_id) != ZERO_VECTOR)
{
if(llAgentInExperience(agent_id))
{
OverrideAgentEnvironment(agent_id);
}
else
{
llSay(0, "Requesting experience permissions on " + (string)agent_id);
llRequestExperiencePermissions(agent_id, "");
}
}
}
collision_end(integer total_number)
{
key agent_id = llDetectedKey(0);
if(llAgentInExperience(agent_id))
{
// Clear experience
float transitionTime = 5;
integer result = llReplaceAgentEnvironment(agent_id, transitionTime, NULL_KEY);
if (result == 1)
{
llSay(0, "Clearing environment override for " + (string)agent_id);
}
else
{
llSay(0, "Cannot apply environment for " + (string)agent_id
+ " due to reason id: " + (string)result);
}
}
}
experience_permissions(key agent_id)
{
OverrideAgentEnvironment(agent_id);
}
experience_permissions_denied(key agent_id, integer reason)
{
llSay(0, "Denied experience permissions for " + (string)agent_id
+ " due to reason id: " + (string)reason + " " + llGetExperienceErrorMessage(reason));
}
}
Maestro Linden
And one more question: Could you send me a copy of the Day Cycle EEP item used in the broken https://maps.secondlife.com/secondlife/Town%20Blue%20Port/138/100/21 parcel ? I think there might be something special about that particular day cycle asset, since llReplaceAgentEnvironment() updates of day cycles on top of other day cycles seems to be working properly.
DelicateSoul Resident
oh ooops... there is a different between the 2 kind of WL's
the one does work fine - the other one don't
the first one you can use (fixed env)
the second on you shouldn't (dayzycle)
...if i understand it right
DelicateSoul Resident
To reproduce the error, I subdivided a plot of land and populated it with different WLs (Windlights). The green object contains the script that is supposed to change the WL. Depending on which plot you're on, it either works or it doesn't. As you can see, it's the same item. You might say: okay, it can't work because it's in a different plot... well, I copied the green object again and placed it in the plot where it doesn't work. The only difference between the two plots is the underlying windlight.
the shown RED MAKRER on the ground describes the several lands/plots/parcels
feel free to come, look and check on https://maps.secondlife.com/secondlife/Town%20Blue%20Port/142/99/21