Difference between revisions of "Script/LevelReference"
From SF3
(→Class Methods) |
|||
Line 143: | Line 143: | ||
| style = 'color: #505050; line-height: 0.5;' |''get any entity (creature, building, etc.) by its id'' | | style = 'color: #505050; line-height: 0.5;' |''get any entity (creature, building, etc.) by its id'' | ||
|- | |- | ||
− | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../ | + | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../Entity|Entity[]@]] |
− | | style='color: black; width: 90%; line-height: 0.8;' | ''' | + | | style='color: black; width: 90%; line-height: 0.8;' | '''GetEntitiesByName''' (const [[../BasicDataTypes|string]]&in ''_sName'') |
|- | |- | ||
| | | | ||
− | | style = 'color: #505050; line-height: 0.5;' |'' | + | | style = 'color: #505050; line-height: 0.5;' |''get any entities with the given name. will return at most one entity of each type, as names must be unique within each entity type.'' |
|- | |- | ||
− | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../ | + | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../Building|Building[]@]] |
− | | style='color: black; width: 90%; line-height: 0.8;' | ''' | + | | style='color: black; width: 90%; line-height: 0.8;' | '''FindBuildingsByDescription''' (const [[../BasicDataTypes|uint8]] ''_uFaction'', const [[../BasicDataTypes|string]]&in ''_sDescriptionName'') |
|- | |- | ||
| | | | ||
− | | style = 'color: #505050; line-height: 0.5;' |''find | + | | style = 'color: #505050; line-height: 0.5;' |''find all buildings with the given description currently owned by the given faction.'' |
+ | |- | ||
+ | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../Building|Building[]@]] | ||
+ | | style='color: black; width: 90%; line-height: 0.8;' | '''FindBuildingsByType''' (const [[../BasicDataTypes|uint8]] ''_uFaction'', const [[../BasicDataTypes|EBuildingType]] ''_Type'') | ||
+ | |- | ||
+ | | | ||
+ | | style = 'color: #505050; line-height: 0.5;' |''find all buildings of the given type currently owned by the given faction.'' | ||
+ | |- | ||
+ | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../Creature|Creature[]@]] | ||
+ | | style='color: black; width: 90%; line-height: 0.8;' | '''FindCreaturesByDescription''' (const [[../BasicDataTypes|uint8]] ''_uFaction'', const [[../BasicDataTypes|string]]&in ''_sDescriptionName'') | ||
+ | |- | ||
+ | | | ||
+ | | style = 'color: #505050; line-height: 0.5;' |''find all creatures with the given description currently owned by the given faction.'' | ||
+ | |- | ||
+ | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../Creature|Creature[]@]] | ||
+ | | style='color: black; width: 90%; line-height: 0.8;' | '''FindCreaturesByType''' (const [[../BasicDataTypes|uint8]] ''_uFaction'', const [[../BasicDataTypes|ECreatureType]] ''_Type'') | ||
+ | |- | ||
+ | | | ||
+ | | style = 'color: #505050; line-height: 0.5;' |''find all creatures of the given type currently owned by the given faction.'' | ||
|- | |- | ||
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]] | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]] |
Revision as of 11:06, 21 September 2016
class LevelReference
The main interface for interacting with the level the player is currently in.
Class Methods
void | RegisterHeroPartyEvent (const string&in _sEventTypeName, TOnHeroPartyEvent@ _pFunction, const string&in _sTargetName, const uint8 _Faction) |
register an event concerning the hero party | |
void | RegisterInventoryEvent (const string&in _sEventTypeName, TOnInventoryEvent@ _pFunction, const string&in _sTargetName, const uint8 _Faction) |
register an event concerning the hero party's inventory | |
void | RegisterCreatureEventByDescription (const string&in _sEventTypeName, TOnCreatureEvent@ _pFunction, const string&in _sDescriptionName, const uint8 _Faction) |
register creature event by description name | |
void | RegisterCreatureEventByIndividual (const string&in _sEventTypeName, TOnCreatureEvent@ _pFunction, const string&in _sCreatureName) |
register creature event by individual creature name (e.g. | |
void | RegisterBuildingEventByDescription (const string&in _sEventTypeName, TOnBuildingEvent@ _pFunction, const string&in _sDescriptionName, const uint8 _Faction) |
register building event by description name | |
void | RegisterBuildingEventByIndividual (const string&in _sEventTypeName, TOnBuildingEvent@ _pFunction, const string&in _sBuildingName) |
register building event by individual building name (i.e. | |
void | RegisterUIEvent (const string&in _sEventTypeName, TOnUIEvent@ _pFunction, const uint8 _Faction) |
register an event to be called when a certain event happens in the ui of the given faction's player | |
void | RegisterUIEventByDescription (const string&in _sEventTypeName, TOnUIEntityEvent@ _pFunction, const string&in _sDescriptionName, const uint8 _Faction) |
register an event to be called when a certain event happens in the ui of the given faction's player | |
void | RegisterUIEventByIndividual (const string&in _sEventTypeName, TOnUIEntityEvent@ _pFunction, const string&in _sTargetName, const uint8 _Faction) |
register an event to be called when a certain event happens in the ui of the given faction's player | |
World@ | GetWorld () |
get world | |
Random@ | GetRandom () |
get the random number generator | |
HeroParty@ | GetHeroParty (const uint8 _uFaction) |
get the hero party for the given faction | |
Sector@ | GetSectorByName (const string&in _sName) |
get sector script class by name | |
Sector@ | GetSectorByIndex (const uint _uIndex) |
get sector script class by index | |
Building | GetBuildingByName (const string&in _sName) |
get building by name | |
Building | GetBuildingById (const uint _uId) |
get building by id | |
Creature | GetCreatureByName (const string&in _sName) |
get creature by name | |
Creature | GetCreatureById (const uint _uId) |
get creature by id | |
LogicObject | GetLogicObjectByName (const string&in _sName) |
get logic object by name | |
LogicObject | GetLogicObjectById (const uint _uId) |
get logic object by id | |
ResourceDeposit | GetResourceDepositByName (const string&in _sName) |
get resource deposit by name | |
ResourceDeposit | GetResourceDepositById (const uint _uId) |
get resource deposit by id | |
Entity | GetEntityById (const uint _uId) |
get any entity (creature, building, etc.) by its id | |
Entity[]@ | GetEntitiesByName (const string&in _sName) |
get any entities with the given name. will return at most one entity of each type, as names must be unique within each entity type. | |
Building[]@ | FindBuildingsByDescription (const uint8 _uFaction, const string&in _sDescriptionName) |
find all buildings with the given description currently owned by the given faction. | |
Building[]@ | FindBuildingsByType (const uint8 _uFaction, const EBuildingType _Type) |
find all buildings of the given type currently owned by the given faction. | |
Creature[]@ | FindCreaturesByDescription (const uint8 _uFaction, const string&in _sDescriptionName) |
find all creatures with the given description currently owned by the given faction. | |
Creature[]@ | FindCreaturesByType (const uint8 _uFaction, const ECreatureType _Type) |
find all creatures of the given type currently owned by the given faction. | |
void | TransferFactionAssets (const uint8 _SourceFaction, const uint8 _DestinationFaction) |
transfer ownership of all buildings and units of _uSourceFaction to _uDestFaction | |
void | DestroyFactionAssets (const uint8 _Faction) |
destroy or kill all buildings and creatures belonging to the given faction | |
void | DamageFactionAssets (const uint8 _Faction) |
apply damage to all buildings and creatures belonging to the given faction | |
void | SetFactionRelation (const uint8 _FactionA, const uint8 _FactionB, const string&in _sRelation) |
set the relation between the two given factions. | |
void | WinGame (const uint8 _Faction) |
show the victory screen to the given faction | |
void | LoseGame (const uint8 _Faction) |
show the defeat screen to the given faction | |
void | BlockNavMesh (const string&in _sName, const bool _bBlocked) |
activate or deactivate the nav blocker with the given name | |
void | ActivateSpawn (const string&in _sName, const bool _bActive) |
activate the spawn of the given name | |
void | ActivateAI (const uint8 _Faction) |
activate an existing AI for the given faction | |
void | ShowTutorial (const uint8 _Faction, const string&in _sTutorialName) |
show the given tutorial, provided that it has not already been shown. | |
void | ShowTutorial (const uint8 _Faction, const string&in _sTutorialName, const Entity&in _Target) |
show the given tutorial, provided that it has not already been shown. | |
void | ShowNotification (const uint8 _Faction, const string&in _sNotificationName, const Entity&in _Location) |
show a one-off notification at the given location for the given faction. | |
void | BeginNotification (const uint8 _Faction, const string&in _sNotificationName, const Entity&in _Location) |
begin an ongoing notification at the given location for the given faction. | |
void | EndNotification (const uint8 _Faction, const string&in _sNotificationName, const Entity&in _Location) |
end an ongoing notification at the given location for the given faction. |