Elaztek Developer Hub
Blamite Game Engine - Sapien (Library)  00432.02.10.25.1019.blamite
The level editor application for the Blamite Game Engine.
Sapien::Scenario Namespace Reference

Namespace containing functions for interacting with a scenario. More...

Functions

SAPIEN_LIB_API BlamTag * GetActiveScenarioTag ()
 Retrieves the currently active scenario tag. More...
 
SAPIEN_LIB_API void PreScenarioLoad ()
 Performs tasks that must be run prior to loading a new scenario tag. More...
 
SAPIEN_LIB_API bool LoadScenario (std::string tag_path)
 Loads a scenario tag. More...
 
SAPIEN_LIB_API bool LoadScenario_Stage1 (std::string tag_path)
 Performs stage 1 of loading a scenario tag. More...
 
SAPIEN_LIB_API bool LoadScenario_Stage2 (std::string tag_path)
 Performs stage 2 of loading a scenario tag. More...
 
SAPIEN_LIB_API bool LoadScenario_Stage3 (std::string tag_path)
 Performs stage 3 of loading a scenario tag. More...
 
SAPIEN_LIB_API bool LoadScenario_Stage4 (std::string tag_path)
 Performs stage 4 of loading a scenario tag. More...
 
SAPIEN_LIB_API void SaveScenario ()
 Attempts to save any changes back to the scenario tag. More...
 
SAPIEN_LIB_API std::vector< std::string > GetPaletteTypes ()
 Retrieves a list of available scenario palette types, where each item is a string representing a long tag class name. More...
 
SAPIEN_LIB_API BlamTagField_Block * GetPalette (BlamTag *scenario, std::string type)
 Retrieves a palette block from a scenario tag. More...
 
SAPIEN_LIB_API BlamTagField_Block * GetPaletteItems (BlamTag *scenario, std::string type)
 Retrieves a palette items block from a scenario tag. More...
 
SAPIEN_LIB_API bool PlaceNewInstance (BlamVector3 position, std::string type, int index, int folder_index)
 Places a new instance of a tag within the scenario. More...
 
SAPIEN_LIB_API int ReserveFolderIndex ()
 Reserves a new folder index within the current scenario. More...
 

Detailed Description

Namespace containing functions for interacting with a scenario.

A scenario can be thought of as a self-contained "level" (or "scene" if you're familiar with other game engines). It will generally reference all data required for the level to load and operate.

Function Documentation

◆ GetActiveScenarioTag()

BlamTag * Sapien::Scenario::GetActiveScenarioTag ( )

Retrieves the currently active scenario tag.

Returns
Pointer to the currently active scenario tag.
+ Here is the caller graph for this function:

◆ GetPalette()

BlamTagField_Block * Sapien::Scenario::GetPalette ( BlamTag *  scenario,
std::string  type 
)

Retrieves a palette block from a scenario tag.

Parameters
scenario- The scenario tag to retrieve a palette from.
type- The palette type name. Should match a long tag class name and be present in GetPaletteTypes.
Returns
Pointer to the specified palette block, or nullptr if no matching block was found.
+ Here is the caller graph for this function:

◆ GetPaletteItems()

BlamTagField_Block * Sapien::Scenario::GetPaletteItems ( BlamTag *  scenario,
std::string  type 
)

Retrieves a palette items block from a scenario tag.

Parameters
scenario- The scenario tag to retrieve palette items from.
type- The palette type name. Should match a long tag class name and be present in GetPaletteTypes.
Returns
Pointer to the specified palette items block, or nullptr if no matching block was found.
+ Here is the caller graph for this function:

◆ GetPaletteTypes()

std::vector< std::string > Sapien::Scenario::GetPaletteTypes ( )

Retrieves a list of available scenario palette types, where each item is a string representing a long tag class name.

Returns
A vector containing all available palette types.
+ Here is the caller graph for this function:

◆ LoadScenario()

bool Sapien::Scenario::LoadScenario ( std::string  tag_path)

Loads a scenario tag.

Parameters
tag_path- The tag path of the desired scenario tag.
Returns
true if the scenario was loaded successfuly, otherwise returns false.
+ Here is the call graph for this function:

◆ LoadScenario_Stage1()

bool Sapien::Scenario::LoadScenario_Stage1 ( std::string  tag_path)

Performs stage 1 of loading a scenario tag.

This stage is responsible for loading the desired scenario tag data. It will first try to load a decompiled tag if available, but will fall back to a compiled tag if needed. When loading a compiled tag, its version must exactly match - or else the load will be aborted.

Parameters
tag_path- The tag path of the desired scenario tag.
Returns
true if the stage completed successfuly, otherwise returns false.
+ Here is the caller graph for this function:

◆ LoadScenario_Stage2()

bool Sapien::Scenario::LoadScenario_Stage2 ( std::string  tag_path)

Performs stage 2 of loading a scenario tag.

This stage is responsible for recompiling a decompiled scenario tag. This ensures that there aren't any changes made to the decompiled tag that have not yet been compiled.

Parameters
tag_path- The tag path of the desired scenario tag.
Returns
true if the stage completed successfuly, otherwise returns false.
+ Here is the caller graph for this function:

◆ LoadScenario_Stage3()

bool Sapien::Scenario::LoadScenario_Stage3 ( std::string  tag_path)

Performs stage 3 of loading a scenario tag.

This stage is responsible for reading the loaded scenario tag data into the game engine. This will also load any other tags referenced within the scenario as well.

Parameters
tag_path- The tag path of the desired scenario tag.
Returns
true if the stage completed successfuly, otherwise returns false.
+ Here is the caller graph for this function:

◆ LoadScenario_Stage4()

bool Sapien::Scenario::LoadScenario_Stage4 ( std::string  tag_path)

Performs stage 4 of loading a scenario tag.

This stage is responsible for building the scenario hierarchy from the scenario tag.

Parameters
tag_path- The tag path of the desired scenario tag.
Returns
true if the stage completed successfuly, otherwise returns false.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PlaceNewInstance()

bool Sapien::Scenario::PlaceNewInstance ( BlamVector3  position,
std::string  type,
int  index,
int  folder_index 
)

Places a new instance of a tag within the scenario.

Parameters
position- The world position to place the object at.
type- The palette containing the desired object.
index- The index within the palette of the desired object.
folder_index- The index of the folder that the new object should belong to.
Returns
true if the object was placed successfully, otherwise returns false.
+ Here is the call graph for this function:

◆ PreScenarioLoad()

void Sapien::Scenario::PreScenarioLoad ( )

Performs tasks that must be run prior to loading a new scenario tag.

+ Here is the caller graph for this function:

◆ ReserveFolderIndex()

int Sapien::Scenario::ReserveFolderIndex ( )

Reserves a new folder index within the current scenario.

Folder IDs within a scenario each have an index, starting from 0. Each folder must have a unique index in order for various objects to be able to properly detect what folder they are contained within.

Returns
An index for a new scenario folder. This index is reserved within the scenario and will never be used again.

◆ SaveScenario()

void Sapien::Scenario::SaveScenario ( )

Attempts to save any changes back to the scenario tag.

+ Here is the call graph for this function: