Difference between revisions of "Script/LogicObject"
Line 55: | Line 55: | ||
| | | | ||
| style = 'color: #505050; line-height: 0.5;' |''set whether the object should block line of sight'' | | style = 'color: #505050; line-height: 0.5;' |''set whether the object should block line of sight'' | ||
+ | |- | ||
+ | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]] | ||
+ | | style='color: black; width: 90%; line-height: 1.0;' | '''IsLocked''' () const | ||
+ | |- | ||
+ | | | ||
+ | | style = 'color: #505050; line-height: 0.5;' |''is this object currently locked?'' | ||
+ | |- | ||
+ | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]] | ||
+ | | style='color: black; width: 90%; line-height: 1.0;' | '''RequiresKey''' () const | ||
+ | |- | ||
+ | | | ||
+ | | style = 'color: #505050; line-height: 0.5;' |''can this object be unlocked using a key?'' | ||
+ | |- | ||
+ | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]] | ||
+ | | style='color: black; width: 90%; line-height: 1.0;' | '''Lock''' ([[../LevelReference|const LevelReference@]] ''_Level'', const [[../BasicDataTypes|string]]&in ''_sKeyName'' = "") | ||
+ | |- | ||
+ | | | ||
+ | | style = 'color: #505050; line-height: 0.5;' |''lock the object with the given key (leave _sKeyName empty if the object should not be unlockable manually)'' | ||
+ | |- | ||
+ | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]] | ||
+ | | style='color: black; width: 90%; line-height: 1.0;' | '''Unlock''' () | ||
+ | |- | ||
+ | | | ||
+ | | style = 'color: #505050; line-height: 0.5;' |''remove the lock from this object'' | ||
|- | |- | ||
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../LogicObject|LogicObject]]& | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../LogicObject|LogicObject]]& |
Revision as of 10:57, 9 March 2017
class LogicObject
Represents a reference to a logic object in the game world. A logic object may be e.g. a switch, loot container, etc. Yes, it is kind of inconsequent to call this one LogicObject in the script but LevelObject in the native code, but that's what our dear scripters wanted. An instance of this class acts like a weak pointer to an existing logic object in the game world and provides an interface to interact with it. Before interacting with the object, you should call Exists() in order to check if the object actually (still) exists. IMPORTANT: This class must NOT be stored as a class member. If you want to store the object for later reference, store the id obtained by GetId instead. You can then later retrieve the object from the LevelReference class by calling GetLogicObjectById.
Inherits from: Entity
Class Methods
ELogicObjectType | GetLogicObjectType () const |
get logic object type | |
bool | GetToggleState () const |
get toggle state of the logic object | |
void | SetToggleState (const bool _bToggled) |
set toggle state of the logic object (e.g. position of a switch, whether a nav blocker is enabled or disabled, whether a chest is open or closed) | |
int | GetSightRange () const |
get sight range of the logic object | |
void | SetSightRange (const int _iSightRange) |
set sight range of the logic object | |
bool | IsSightBlocking () const |
does the object block line of sight? | |
void | SetSightBlocking (const bool _bBlocking) |
set whether the object should block line of sight | |
bool | IsLocked () const |
is this object currently locked? | |
bool | RequiresKey () const |
can this object be unlocked using a key? | |
void | Lock (const LevelReference@ _Level, const string&in _sKeyName = "") |
lock the object with the given key (leave _sKeyName empty if the object should not be unlockable manually) | |
void | Unlock () |
remove the lock from this object | |
LogicObject& | operator= (const LogicObject&in) |
bool | operator== (const LogicObject&in) |
bool | operator== (const Entity&in) |
bool | Exists () const |
does the entity actually exist? (always check this before doing anything with the entity!) | |
uint | GetId () const |
get persistent entity id, use this to save the entity for later reference. | |
uint8 | GetFaction () const |
get owner faction | |
void | SetFaction (const uint8 _Faction) |
set owner faction | |
EEntityType | GetEntityType () const |
get entity type | |
bool | IsEnabled () const |
whether the entity is currently enabled (i.e. is visible in the game world) | |
void | Enable (const bool _bEnabled) |
enabled or disable the entity | |
bool | IsInteractive () const |
can the entity be interacted with? | |
void | SetInteractive (const bool _bInteractive) |
set whether the entity can be interacted with | |
bool | IsSelectable () const |
can the entity (theoretically) be selected by the player? | |
void | SetSelectable (const bool _bSelectable) |
set whether the entity can be selected by the player
(note that depending on the type of entity, there may be additional checks preventing the entity from being selected) | |
bool | IsBusy () const |
is the entity currently marked as busy? | |
void | SetBusy (const bool _bBusy) |
mark the entity as busy | |
void | SetInspectionText (const uint _uTextId) |
make the entity inspectable and set the text to be displayed upon inspection | |
bool | CanBeAttacked () const |
can the entity be attacked? | |
void | SetAttackable (const bool _bAttackable) |
set whether the entity can be attacked | |
Entity | opImplConv () const |