Skip to main content
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.

Interacting with the Suncore-concepts/scripting/interacting-with-the-sun

Static Functions​

ReturnsNameBeschreibung
LoadStreamLevelLaden eines Levels wΓ€hrend der Laufzeit
UnloadStreamLevelEntladen eines Levels wΓ€hrend der Laufzeit
SetFogDensity
SetFogHeightFalloff
SetFogHeightOffset
SetSunLightColor
SetSunLightColor
SetSkyRayleighScattering
SetSunLightIntensity
SetSunTemperatureMultiplier
SetPPBloomPost-Prozess-Bloom-Einstellungen
SetPPChromaticAberrationSet Post Process Chromatic Aberration Settings
SetPPImageEffectsEinstellungen fΓΌr Postprozess-Bildeffekt festlegen
SetPPFilmSet Post Process Film Settings
SetPPGlobalSaturationSet Post Process Saturation Colors
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​

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

Functions Detailed​

LoadStreamLevel​

Laden eines Levels wΓ€hrend der Laufzeit

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

UnloadStreamLevel​

Entladen eines Levels wΓ€hrend der Laufzeit

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

SetFogDensity​

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

SetFogHeightFalloff​

World.SetFogHeightFalloff(falloff)
TypeParameterDefault ValueBeschreibung
numberfalloff

SetFogHeightOffset​

World.SetFogHeightOffset(offset)
TypeParameterDefault ValueBeschreibung
numberoffset

SetSunLightColor​

World.SetSunLightColor(color)
TypeParameterDefault ValueBeschreibung
Colorcolor

SetSunLightColor​

World.SetSkyLightIntensity(ntensity)
TypeParameterDefault ValueBeschreibung
numberintensity

SetSkyRayleighScattering​

World.SetSkyRayleighScattering(color)
TypeParameterDefault ValueBeschreibung
Colorcolor

SetSunLightIntensity​

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

SetSunTemperatureMultiplier​

World.SetSunTemperatureMultiplier(multiplier)
TypeParameterDefault ValueBeschreibung
numbermultiplier

SetPPBloom​

Post-Prozess-Bloom-Einstellungen

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

SetPPChromaticAberration​

Set Post Process Chromatic Aberration Settings

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

SetPPImageEffects​

Einstellungen fΓΌr Postprozess-Bildeffekt festlegen

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

SetPPFilm​

Set Post Process Film Settings

World.SetPPFilm(slope , toe, shoulder, black_clip, white_clip)
TypeParameterDefault ValueBeschreibung
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 ValueBeschreibung
Colorcolor

SetPPMaterial​

Sets a PostProcess Material

World.SetPPMaterial(material_path)
TypeParameterDefault ValueBeschreibung
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 ValueBeschreibung
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 ValueBeschreibung
numberspeed

SetTime​

Sets the Global time of the day

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

SetWeather​

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

World.SetWeather(weather)
TypeParameterDefault ValueBeschreibung
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 ValueBeschreibung
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

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

end)

StreamLevelUnloaded​

Called when a Stream Level is unloaded

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

end)