Difference between revisions of "Script/World"

From SF3
Jump to: navigation, search
(Global Variables)
(class World)
Line 168: Line 168:
 
|
 
|
 
| style = 'color: #505050; line-height: 0.5;' |''remove all global variables in the given category''
 
| style = 'color: #505050; line-height: 0.5;' |''remove all global variables in the given category''
 +
|}
 +
 +
==== Creature Drop Lists ====
 +
{| border='0' style ='border:solid 1px #eeeedd; color: black; width: 1200px;background-color: #ffffcc;' cellspacing='0' cellpadding='7'
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''AddItemToCreatureDrops''' (const [[../BasicDataTypes|string]]&in ''_sCreatureDescriptionName'', const [[../BasicDataTypes|string]]&in ''_sItemName'', const [[../BasicDataTypes|uint]] ''_uAmount'', const [[../BasicDataTypes|uint8]] ''_uPercentChance'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''add a chance to drop the given item to any creature with the given description name''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''RemoveItemFromCreatureDrops''' (const [[../BasicDataTypes|string]]&in ''_sCreatureDescriptionName'', const [[../BasicDataTypes|string]]&in ''_sItemName'', const [[../BasicDataTypes|uint]] ''_uAmount'', const [[../BasicDataTypes|uint8]] ''_uPercentChance'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''remove a specific previously added entry from the given creature's list of drops''
 +
|-
 +
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]]
 +
| style='color: black; width: 90%; line-height: 1.0;' | '''RemoveItemFromCreatureDrops''' (const [[../BasicDataTypes|string]]&in ''_sCreatureDescriptionName'', const [[../BasicDataTypes|string]]&in ''_sItemName'')
 +
|-
 +
|
 +
| style = 'color: #505050; line-height: 0.5;' |''remove a specific previously added entry from the given creature's list of drops''
 
|}
 
|}

Revision as of 16:07, 3 March 2017

class World

The main interface for interacting with the global game state, persistent across all levels.

Class Methods

World Map / Travel

bool IsTravelAllowed () const
is travelling (leaving the level/fast travelling) currently allowed?
void AllowTravel (const bool _bAllow)
set whether the player is allowed to leave the current level or fast travel within it.
bool IsMapAccessible (const uint _uMapId) const
is the given level currently accessible?
void SetMapAccessible (const uint _uMapId, const bool _bAccessible = true, const uint8 _uSetting = uint8 ( - 1 ))
set whether the given map is accessible by the player from the world map.
uint8 GetCurrentMapSetting (const uint _uMapId) const
get the current setting for the given map
void SetMapSetting (const uint _uMapId, const uint8 _uSetting)
set the active setting for the given map. the setting change will only take effect the next time the level is visited.
void SetMapEntryPoint (const uint _uMapId, const string&in _sEntryPoint)
set the entry point for _uMapId. will be used when the player travels to the map the next time.
void TravelToMap (const uint _uMapId, const uint8 _uSetting = uint8 ( - 1 ), const string&in _sEntryPoint = "")
go to the given map in the given setting (or current setting, if not specified)

Blueprints

bool IsBlueprintUnlocked (const string&in _sBlueprintName) const
is the given blueprint currently unlocked?
bool UnlockBlueprint (const string&in _sBlueprintName, const bool _bTemporary)
unlock the blueprint of this name for the player (if _bTemporary is true, the blueprint will be re-locked as soon as the player leaves the current level)
bool IsBlueprintUpgradeUnlocked (const string&in _sBlueprintName, const string&in _sUpgradeName) const
is the given upgrade for the given blueprint currently unlocked?
bool UnlockBlueprintUpgrade (const string&in _sBlueprintName, const string&in _sUpgradeName, const bool _bTemporary)
unlock the given blueprint upgrade (if _bTemporary is true, the upgrade will be re-locked as soon as the player leaves the current level)

Dialogues

string[]@ GetEnabledTopics (const string&in _sContainerName) const
get all currently enabled topics within the given container.
string[]@ GetValidTopics (const string&in _sContainerName) const
get all topics in the given container which are enabled and can be initiated at this very moment (checks script conditions, required participants, range, etc.).
void EnableDialogueTopic (const string&in _sContainerName, const string&in _sTopicName, const bool _bEnabled)
enable or disable the given dialogue topic
void BlockDialogueTopicNode (const string&in _sContainerName, const string&in _sNodeName)
disable a dialogue topic node
void UnblockDialogueTopicNode (const string&in _sContainerName, const string&in _sNodeName)
enable a dialogue topic node

Global Variables

bool GetGlobalBool (const string&in _sVarName, const bool _bDefault = false) const
get global variable of type bool
int GetGlobalInt (const string&in _sVarName, const int _iDefault = - 1) const
get global variable of type integer
void SetGlobalBool (const string&in _sVarName, const bool _bValue)
set global variable of type bool
void SetGlobalInt (const string&in _sVarName, const int _iValue)
set global variable of type integer
void RemoveGlobalVar (const string&in _sVarName)
remove the given global variable
string[]@ GetGlobalVarNamesInCategory (const string&in _sCategoryName, const bool _bFullVarNames = true) const
get a list of all variable names in the given category. if _bFullVarNames is false, the returned names will not contain the "_sCategoryName." prefix.
dictionary@ GetGlobalVarsInCategory (const string&in _sCategoryName, const bool _bFullVarNames = true) const
get a dictionary mapping all variable names in the given category to their respective values (all represented as integers).

if _bFullVarNames is false, the key names will not contain the "_sCategoryName." prefix.

void ClearGlobalVarCategory (const string&in _sCategoryName)
remove all global variables in the given category

Creature Drop Lists

void AddItemToCreatureDrops (const string&in _sCreatureDescriptionName, const string&in _sItemName, const uint _uAmount, const uint8 _uPercentChance)
add a chance to drop the given item to any creature with the given description name
void RemoveItemFromCreatureDrops (const string&in _sCreatureDescriptionName, const string&in _sItemName, const uint _uAmount, const uint8 _uPercentChance)
remove a specific previously added entry from the given creature's list of drops
void RemoveItemFromCreatureDrops (const string&in _sCreatureDescriptionName, const string&in _sItemName)
remove a specific previously added entry from the given creature's list of drops

class World

The main interface for interacting with the global game state, persistent across all levels.

Class Methods

World Map / Travel

bool IsTravelAllowed () const
is travelling (leaving the level/fast travelling) currently allowed?
void AllowTravel (const bool _bAllow)
set whether the player is allowed to leave the current level or fast travel within it.
bool IsMapAccessible (const uint _uMapId) const
is the given level currently accessible?
void SetMapAccessible (const uint _uMapId, const bool _bAccessible = true, const uint8 _uSetting = uint8 ( - 1 ))
set whether the given map is accessible by the player from the world map.
uint8 GetCurrentMapSetting (const uint _uMapId) const
get the current setting for the given map
void SetMapSetting (const uint _uMapId, const uint8 _uSetting)
set the active setting for the given map. the setting change will only take effect the next time the level is visited.
void SetMapEntryPoint (const uint _uMapId, const string&in _sEntryPoint)
set the entry point for _uMapId. will be used when the player travels to the map the next time.
void TravelToMap (const uint _uMapId, const uint8 _uSetting = uint8 ( - 1 ), const string&in _sEntryPoint = "")
go to the given map in the given setting (or current setting, if not specified)

Blueprints

bool IsBlueprintUnlocked (const string&in _sBlueprintName) const
is the given blueprint currently unlocked?
bool UnlockBlueprint (const string&in _sBlueprintName, const bool _bTemporary)
unlock the blueprint of this name for the player (if _bTemporary is true, the blueprint will be re-locked as soon as the player leaves the current level)
bool IsBlueprintUpgradeUnlocked (const string&in _sBlueprintName, const string&in _sUpgradeName) const
is the given upgrade for the given blueprint currently unlocked?
bool UnlockBlueprintUpgrade (const string&in _sBlueprintName, const string&in _sUpgradeName, const bool _bTemporary)
unlock the given blueprint upgrade (if _bTemporary is true, the upgrade will be re-locked as soon as the player leaves the current level)

Dialogues

string[]@ GetEnabledTopics (const string&in _sContainerName) const
get all currently enabled topics within the given container.
string[]@ GetValidTopics (const string&in _sContainerName) const
get all topics in the given container which are enabled and can be initiated at this very moment (checks script conditions, required participants, range, etc.).
void EnableDialogueTopic (const string&in _sContainerName, const string&in _sTopicName, const bool _bEnabled)
enable or disable the given dialogue topic
void BlockDialogueTopicNode (const string&in _sContainerName, const string&in _sNodeName)
disable a dialogue topic node
void UnblockDialogueTopicNode (const string&in _sContainerName, const string&in _sNodeName)
enable a dialogue topic node

Global Variables

bool GetGlobalBool (const string&in _sVarName, const bool _bDefault = false) const
get global variable of type bool
int GetGlobalInt (const string&in _sVarName, const int _iDefault = - 1) const
get global variable of type integer
void SetGlobalBool (const string&in _sVarName, const bool _bValue)
set global variable of type bool
void SetGlobalInt (const string&in _sVarName, const int _iValue)
set global variable of type integer
void RemoveGlobalVar (const string&in _sVarName)
remove the given global variable
string[]@ GetGlobalVarNamesInCategory (const string&in _sCategoryName, const bool _bFullVarNames = true) const
get a list of all variable names in the given category. if _bFullVarNames is false, the returned names will not contain the "_sCategoryName." prefix.
dictionary@ GetGlobalVarsInCategory (const string&in _sCategoryName, const bool _bFullVarNames = true) const
get a dictionary mapping all variable names in the given category to their respective values (all represented as integers).

if _bFullVarNames is false, the key names will not contain the "_sCategoryName." prefix.

void ClearGlobalVarCategory (const string&in _sCategoryName)
remove all global variables in the given category