Skip to main content

Level

Work with Unreal level in runtime.

🗿Static Class
This is a Static Class. Access it's methods directly with .. It's not possible to spawn new instances.
💂Authority
This static class can be accessed only on 🟧 Client side.

Static Functions​

ReturnsNameDescription
LoadStreamLevelLoads a Level in runtime
UnloadStreamLevelUnloads a Level in runtime
SetStreamLevelVisibilitySets a Stream Level visibility
table of tableGetStreamLevelsGets a list of all Stream Levels
CallLevelBlueprintEventCalls a Level Blueprint custom event (which can be added when creating levels through Unreal Engine)

LoadStreamLevel​

Loads a Level in runtime

Level.LoadStreamLevel(level_name, should_block_on_load?, make_visible_after_load?)
TypeParameterDefaultDescription
stringlevel_name
booleanshould_block_on_load?falseIf this should be a blocking operation - the game will freeze
booleanmake_visible_after_load?trueIf this should be visible automatically after loaded

UnloadStreamLevel​

Unloads a Level in runtime

Level.UnloadStreamLevel(level_name, should_block_on_unload?)
TypeParameterDefaultDescription
stringlevel_name
booleanshould_block_on_unload?falseIf this should be a blocking operation - the game will freeze

SetStreamLevelVisibility​

Sets a Stream Level visibility

Level.SetStreamLevelVisibility(level_name, visibility)
TypeParameterDefaultDescription
stringlevel_name
booleanvisibilityIf this level should be visible

GetStreamLevels​

Gets a list of all Stream Levels

— Returns table of table (in the format <code>{ name, is_loaded, is_visible }</code>).

local ret = Level.GetStreamLevels()

CallLevelBlueprintEvent​

Calls a Level Blueprint custom event (which can be added when creating levels through Unreal Engine)

Level.CallLevelBlueprintEvent(event_name)
TypeParameterDefaultDescription
stringevent_name

Events​

NameDescription
StreamLevelLoadCalled when a Stream Level is loaded
StreamLevelUnloadCalled when a Stream Level is unloaded
StreamLevelShowCalled when a Stream Level is shown
StreamLevelHideCalled when a Stream Level is hidden

StreamLevelLoad​

Called when a Stream Level is loaded
Level.Subscribe("StreamLevelLoad", function(level_name)
-- StreamLevelLoad was called
end)
TypeArgumentDescription
stringlevel_name

StreamLevelUnload​

Called when a Stream Level is unloaded
Level.Subscribe("StreamLevelUnload", function(level_name)
-- StreamLevelUnload was called
end)
TypeArgumentDescription
stringlevel_name

StreamLevelShow​

Called when a Stream Level is shown
Level.Subscribe("StreamLevelShow", function(level_name)
-- StreamLevelShow was called
end)
TypeArgumentDescription
stringlevel_name

StreamLevelHide​

Called when a Stream Level is hidden
Level.Subscribe("StreamLevelHide", function(level_name)
-- StreamLevelHide was called
end)
TypeArgumentDescription
stringlevel_name