Passer au contenu principal
Version: latest - a1.7.0 ⚖️

🌍 World

Interaction with World and Environment elements

info

🟧 Authority: This can be accessed only on Client.

🗿 Static Class: This is a Static Class. You can access it’s methods directly with .. It is not possible to initialize or create new instances.

info

Please check Interacting with Sun for further information and examples.

Interagir avec le Soleilcore-concepts/scripting/interacting-with-the-sun

Fonctions statiques

Valeur retournéeNomDescription
LoadStreamLevelCharge un niveau pendant le temps d'exécution
UnloadStreamLevelUnloads a Level in runtime
SetFogDensity
SetFogHeightFalloff
SetFogHeightOffset
SetSunLightColor
SetSkyLightIntensity
SetSkyRayleighScattering
SetSunLightIntensity
SetSunTemperatureMultiplier
SetPPBloomSet Post Process Bloom Settings
SetPPChromaticAberrationDéfinir les paramètres d'aberration chromatique du post-traitement
SetPPImageEffectsDéfinir les paramètres d'effet d'image du post-traitement
SetPPFilmSet Post Process Film Settings
SetPPGlobalSaturationDéfinir la saturation de couleurs du post-traitement
SetPPMaterialSets a PostProcess Material
RemovePPMaterialRemoves the PostProcess Material
SetSunAngleSets the Sun's angle
SetSunSpeedSets the Sun's time speed
SetTimeSets the global time of the day
SetWeatherSets the global Predefined Weather
SpawnDefaultSunOverrides all Light/Sun Actors with the NanosWorld's Official one
SetWindSets the global Wind intensity
numberGetSunAngle
numberGetSunSpeed
tableGetTimeReturns a table containing current Sun hours and minutes
WeatherTypeGetWeather
numberGetWind

Events

NomDescription
StreamLevelLoadedCalled when a Stream Level is loaded
StreamLevelUnloadedCalled when a Stream Level is unloaded

Functions Detailed

LoadStreamLevel

Charge un niveau pendant le temps d'exécution

World.LoadStreamLevel(level_name, should_block_on_load)
TypeParameterDefault ValueDescription
stringlevel_name
booleanshould_block_on_loadfalseIf this should be a blocking operation - the game will freeze

UnloadStreamLevel

Unloads a Level in runtime

World.UnloadStreamLevel(level_name, should_block_on_unload)
TypeParameterDefault ValueDescription
stringlevel_name
booleanshould_block_on_unloadfalseIf this should be a blocking operation - the game will freeze

SetFogDensity

World.SetFogDensity(density, second_density)
TypeParameterDefault ValueDescription
numberdensity
numbersecond_density0

SetFogHeightFalloff

World.SetFogHeightFalloff(falloff)
TypeParameterDefault ValueDescription
numberfalloff

SetFogHeightOffset

World.SetFogHeightOffset(offset)
TypeParameterDefault ValueDescription
numberoffset

SetSunLightColor

World.SetSunLightColor(color)
TypeParameterDefault ValueDescription
Colorcolor

SetSkyLightIntensity

World.SetSkyLightIntensity(ntensity)
TypeParameterDefault ValueDescription
numberintensity

SetSkyRayleighScattering

World.SetSkyRayleighScattering(color)
TypeParameterDefault ValueDescription
Colorcolor

SetSunLightIntensity

World.SetSunLightIntensity(<BasicType.Number />
TypeParameterDefault ValueDescription
numberintensity

SetSunTemperatureMultiplier

World.SetSunTemperatureMultiplier(multiplier)
TypeParameterDefault ValueDescription
numbermultiplier

SetPPBloom

Set Post Process Bloom Settings

World.SetPPBloom(intensity, threshold)
TypeParameterDefault ValueDescription
numberintensity0.675
numberthreshold-1

SetPPChromaticAberration

Définir les paramètres d'aberration chromatique du post-traitement

World.SetPPChromaticAberration(intensity, start_offset)
TypeParameterDefault ValueDescription
numberintensity0
numberstart_offset0

SetPPImageEffects

Définir les paramètres d'effet d'image du post-traitement

World.SetPPImageEffects(vignette_intensity, grain_jitter, grain_intensity)
TypeParameterDefault ValueDescription
numbervignette_intensity0.6
numbergrain_jitter0
numbergrain_intensity0

SetPPFilm

Set Post Process Film Settings

World.SetPPFilm(slope , toe, shoulder, black_clip, white_clip)
TypeParameterDefault ValueDescription
numberslope0.8
numbertoe0.55
numbershoulder0.26
numberblack_clip0
numberwhite_clip0.3

SetPPGlobalSaturation

Set Post Process Saturation Colors. Use Alpha for overall Saturation intensity

World.SetPPGlobalSaturation(color)
TypeParameterDefault ValueDescription
Colorcolor

SetPPMaterial

Sets a PostProcess Material

World.SetPPMaterial(material_path)
TypeParameterDefault ValueDescription
stringmaterial_pathThe Material Asset to set as Post Process

RemovePPMaterial

Removes the current Post Process Material

World.RemovePPMaterial()

SetSunAngle

Sets the sun's angle (0-360)

World.SetSunAngle(angle)
TypeParameterDefault ValueDescription
numberangle

SetSunSpeed

Sets the sun's time speed (default: '60', which means 60 seconds in game = 1 second in real world)

World.SetSunSpeed(speed)
TypeParameterDefault ValueDescription
numberspeed

SetTime

Sets the Global time of the day

World.SetTime(hours, minutes)
TypeParameterDefault ValueDescription
numberhours
numberminutes

SetWeather

Sets the global Predefined Weather (Clear, Rain, Cloudy, Thunderstorm)

World.SetWeather(weather)
TypeParameterDefault ValueDescription
WeatherTypeweather

SpawnDefaultSun

Overrides all Light/Sun Actors with the NanosWorld's Official one, to be able to use the functions from this page

World.SpawnDefaultSun()

SetWind

Sets the global Wind intensity

World.SetWind(intensity)
TypeParameterDefault ValueDescription
numberintensity

GetSunAngle

Returns number

World.GetSunAngle()

GetSunSpeed

Returns number

World.GetSunSpeed()

GetTime

Returns a table containing current Sun hours and minutes

Returns {hours, minutes}

World.GetTime()

GetWeather

Returns WeatherType

World.GetWeather()

GetWind

Returns number

World.GetWind()

Events Detailed

StreamLevelLoaded

Called when a Stream Level is loaded

TypeParameterDescription
stringlevel_name
Client.Subscribe("StreamLevelLoaded", function(level_name)

end)

StreamLevelUnloaded

Called when a Stream Level is unloaded

TypeParameterDescription
stringlevel_name
Client.Subscribe("StreamLevelUnloaded", function(level_name)

end)