Ir para o conteúdo principal
Version: latest - a1.172.0 ⚖️

🏝️ Level

Work with Unreal level in runtime

🗿Static ClassClient Only🧑‍💻API Source

🗿 Static Functions​

CallLevelBlueprintEvent: varargs of anyCalls a Level Blueprint custom event (which can be added when creating levels through Unreal Engine)
GetStreamLevels: table of tableGets a list of all Stream Levels
LoadStreamLevelLoads a Level in runtime
SetStreamLevelVisibilitySets a Stream Level visibility
Subscribe: functionSubscribes to an Event
UnloadStreamLevelUnloads a Level in runtime
UnsubscribeUnsubscribes from all subscribed Events in this Class and in this Package, optionally passing the function to unsubscribe only that callback

CallLevelBlueprintEventSlow​

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

local ret_01, ret_02, ... = Level.CallLevelBlueprintEvent(event_name, arguments...?)
Parameters
NameTypeDescrição
event_namestringEvent or Function name
arguments...?anySequence of arguments to pass to the event Default nil
Returns
TypeDescrição
varargs of anythe function return values

GetStreamLevelsModerate​

Gets a list of all Stream Levels

local ret = Level.GetStreamLevels()
Returns
TypeDescrição
table of tableList of all Stream Levels
Table keys
NameTypeDescrição
namestringThe short name of the Level
pathstringThe full path to the Level file
is_loadedbooleanIf the Level was marked to be loaded
is_visiblebooleanIf the Level is currently visible
is_tempbooleanIf the Level is temporary (an instance loaded, shouldn't be directly unloaded)

LoadStreamLevelSlow​

Loads a Level in runtime

Level.LoadStreamLevel(level_name, should_block_on_load?, make_visible_after_load?)
Parameters
NameTypeDescrição
level_namestringName of the Stream Level
should_block_on_load?booleanIf this should be a blocking operation - the game will freeze Default false
make_visible_after_load?booleanIf this should be visible automatically after loaded Default true

SetStreamLevelVisibilityModerate​

Sets a Stream Level visibility

Level.SetStreamLevelVisibility(level_name, visibility)
Parameters
NameTypeDescrição
level_namestringName of the Stream Level
visibilitybooleanIf this level should be visible

SubscribeOptimal​

Subscribes to an Event

local ret = Level.Subscribe(event_name, callback)
Parameters
NameTypeDescrição
event_namestringEvent to subscribe to
callbackfunctionCallback to run on the event occurring
Returns
TypeDescrição
functionThe function callback

UnloadStreamLevelModerate​

Unloads a Level in runtime

Level.UnloadStreamLevel(level_name, should_block_on_unload?)
Parameters
NameTypeDescrição
level_namestringName of the Stream Level
should_block_on_unload?booleanIf this should be a blocking operation - the game will freeze Default false

UnsubscribeOptimal​

Unsubscribes from all subscribed Events in this Class and in this Package, optionally passing the function to unsubscribe only that callback

Level.Unsubscribe(event_name, callback?)
Parameters
NameTypeDescrição
event_namestringEvent to unsubscribe to
callback?functionOptional callback to specifically unsubscribe to Default nil

🚀 Events​

StreamLevelBeginPauseCalled when streaming pause begins
StreamLevelEndPauseCalled when streaming pause ends
StreamLevelHideCalled when a Stream Level is hidden
StreamLevelLoadCalled when a Stream Level is loaded
StreamLevelShowCalled when a Stream Level is shown
StreamLevelUnloadCalled when a Stream Level is unloaded

StreamLevelBeginPause​

Called when streaming pause begins

Level.Subscribe("StreamLevelBeginPause", function()
-- StreamLevelBeginPause was called
end)

StreamLevelEndPause​

Called when streaming pause ends

Level.Subscribe("StreamLevelEndPause", function()
-- StreamLevelEndPause was called
end)

StreamLevelHide​

Called when a Stream Level is hidden

Level.Subscribe("StreamLevelHide", function(level_name)
-- StreamLevelHide was called
end)
Arguments
NameTypeDescrição
level_namestringName of the Stream Level

StreamLevelLoad​

Called when a Stream Level is loaded

Level.Subscribe("StreamLevelLoad", function(level_name)
-- StreamLevelLoad was called
end)
Arguments
NameTypeDescrição
level_namestringName of the Stream Level

StreamLevelShow​

Called when a Stream Level is shown

Level.Subscribe("StreamLevelShow", function(level_name)
-- StreamLevelShow was called
end)
Arguments
NameTypeDescrição
level_namestringName of the Stream Level

StreamLevelUnload​

Called when a Stream Level is unloaded

Level.Subscribe("StreamLevelUnload", function(level_name)
-- StreamLevelUnload was called
end)
Arguments
NameTypeDescrição
level_namestringName of the Stream Level