scene_add_environment
Creates a fixed-hour sky environment in a copied save, with stars, Milky Way, and clouds, so graphs can switch players between day and night skies.
Instructions
Add a second sky to a copy of a save: an environment configuration (环境配置) fixed at one hour, with stars, the milky way and clouds as asked. This is how night is done on this platform: changing the level clock alone does not darken the sky that is in force, a graph switches the players to another environment configuration with f.modifyEnvironmentSettings(environmentId, players, false, 0n), and back with the id of the map's own. The new configuration applies to nobody until a graph switches to it. hour is 0 to 23 (0 is midnight). Returns environmentId. Writes a new .gil in the workspace; the official save is not touched. Verified in play on 2026-10-10: a midnight configuration is dark with stars, and stars and clouds follow their switches. On a map of the current version the sky is written the way the editor fixes one at an hour (the 34 brightness and colour curves of the map's own sky, each taken at that hour), so a day sky looks like the sky of the map at that hour and not brighter (seen in play on 2026-10-13, examples/hazards/hazards_sky.json; until that day a day sky came out washed out). For day and night make two, one for the night and one for the day (hour 11, stars and milkyWay false), and switch between them: the map's own configuration follows a clock that stays at the hour of the last fixed one, so going back to it after a night stays dark.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hour | No | ||
| name | Yes | ||
| stars | No | ||
| clouds | No | ||
| mapPath | No | ||
| milkyWay | No | ||
| outputName | No |