Configurable Daytime System
De DigiWiki.
Version du 9 mai 2015 à 18:50 par Djphil (discuter | contributions)
// Configurable Daytime System v0.1 by djphil (CC-BY-NC-SA 4.0) float new_day_length = 1.0; // "day_length" = "number of seconds to a day" float new_year_length = 60.0; // "year_length" = "number of days to a year" float new_day_night_offset = 0.45; // "day_night_offset" = "induces a horizon shift" float new_update_interval = 100.0; // "update_interval" = "how often to update the sun's position in frames" float new_day_time_sun_hour_scale = 0.0; // "day_time_sun_hour_scale" = "scales day light vs nite hours to change day/night ratio" float def_day_length = 24.0; float def_year_length = 360.0; float def_day_night_offset = 0.45; float def_update_interval = 100.0; float def_day_time_sun_hour_scale = 0.0; float value; integer power; string param; string param_day_length = "day_length"; string param_year_length = "year_length"; string param_day_night_offset = "day_night_offset"; string param_update_interval = "update_interval"; string param_day_time_sun_hour_scale = "day_time_sun_hour_scale"; default { state_entry() { llSay(PUBLIC_CHANNEL, "Initialisation ..."); } touch_start(integer number) { param = param_day_length; power = !power; if (power) { value = new_day_length; } else { value = def_day_length; } osSetSunParam(param, value); llSay(PUBLIC_CHANNEL, param + " = " + (string)osGetSunParam(param)); } }