CreateSky: Difference between revisions

From Onset Developer Wiki
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{Info|Function|Client|1.3.0}}
{{Info|Function|Client|1.3.0}}


{{FuncDescription|Create the default sky system on a custom map. This only works on custom maps.
{{FuncDescription|Creates the default Onset sky system on a custom map. This only works on custom maps.


The original sky includes a sky atmosphere, directional lights, exponential height fog and a sky light component. Your custom map scene can therefore be dark without any sky. After using [[CreateSky]], the sky and time functions are working as usual.
The default sky includes a sky atmosphere, directional lights (for sun and moon), exponential height fog and a sky light component. Your custom map scene can therefore be dark without any sky. After using [[CreateSky]], the sky and time functions are working as usual.
 
When using this method, there should be no sky lights in your custom map scene. If you still want some light in your scene (for editing the map in Unreal Editor) you can mark your sky light components as "Editor Only". This will prevent them from being packaged to your final .pak map.
}}
}}


Line 27: Line 29:


{{RelatedFunctions}}
{{RelatedFunctions}}
* [[GetGameVersionString]]
*[[GetGameVersion]]
*[[GetGameVersionString]]
*[[IsGameDevMode]]
*[[IsPlayerInMainMenu]]
*[[InvokeDamageFX]]
*[[UpdateDiscordActivity]]
*[[ConnectToServer]]
*[[SetNearClipPlane]]
*[[CreateSky]]
*[[GetAllPackages]]
*[[IsServer]]
*[[IsClient]]

Latest revision as of 09:52, 26 December 2020

CreateSky

Type: Function
Context: Client
Introduced: v1.3.0

Description

Creates the default Onset sky system on a custom map. This only works on custom maps.

The default sky includes a sky atmosphere, directional lights (for sun and moon), exponential height fog and a sky light component. Your custom map scene can therefore be dark without any sky. After using CreateSky, the sky and time functions are working as usual.

When using this method, there should be no sky lights in your custom map scene. If you still want some light in your scene (for editing the map in Unreal Editor) you can mark your sky light components as "Editor Only". This will prevent them from being packaged to your final .pak map.


Syntax

CreateSky()

Parameters

  • This function has no parameters.

Return Value

  • Returns an AActor reference to the sky actor. false on error.

Example

AddEvent("OnPackageStart", function()
	print("OnPackageStart")
	print(GetWorld():GetMapName())
	
      -- If the current map is not the original Island map then spawn the original sky.
	if GetWorld():GetMapName() ~= "Island" then
        CreateSky()
	end
end)

See also