Scripting Bugs

  • Search existing bugs before submitting
  • Use support.secondlife.com for customer support issues
  • Keep posts on-topic
llGetDayLength() reports incorrect time when sitting on an object
This is an elusive bug because it doesn't happen with the default 4-hour day length, but it can be reproduced consistently with any other day length. If you put this script into an object: default { state_entry() { llSetTimerEvent(1); } timer() { integer daylength = llGetDayLength(); llOwnerSay((string)daylength); } } (timer event can be more than 1 second if you want it less spammy) 1: Make sure the parcel's day length, as shown in About Land > Environment, is the default 4 hours. 2: Wear the object while standing, you will see that the reported day length will be correct, as shown in About Land > Environment. (14400 seconds = 4 hours) 3: Then sit on an object. The script will still report the correct day length. 4: Change the parcel's day length to any other value while you're still sitting. 5: The script keeps reporting the 4-hour day length. 6: Stand up and the script will report the correct day length, as shown in About Land > Environment. This means for some reason llGetDayLength() keeps reporting the default 4-hour day length when the avatar wearing the script is sitting on an object, no matter what the parcel's day length is set to. I know there is a newer llGetEnvironment() function that can retrieve parcel day length, I tested it and it does not have this issue. However I believe it is less costly to run llGetDayLength() and llGetTimeOfDay() separately every second in a watch than calling llGetEnvironment() and then retrieving the time of day and day length values from the list, so it would be crucial for this function to work correctly under all circumstances.
3
·
tracked
Load More
→