Difference between revisions of "Script/Creature"
From SF3
(Created page with "==class Creature== Represents a reference to a creature in the game world. === Class Methods === {| border='0' style ='border:solid 1px #eeeedd; color: black; width: 1024px;ba...") |
(→class Creature) |
||
Line 2: | Line 2: | ||
Represents a reference to a creature in the game world. | Represents a reference to a creature in the game world. | ||
=== Class Methods === | === Class Methods === | ||
− | {| border='0' style ='border:solid 1px #eeeedd; color: black; width: | + | {| 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;' | [[../string]] | + | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|string]] |
| style='color: black; width: 90%; line-height: 0.8;' | '''GetDescriptionName''' () const | | style='color: black; width: 90%; line-height: 0.8;' | '''GetDescriptionName''' () const | ||
|- | |- | ||
Line 10: | Line 10: | ||
| style = 'color: #505050; line-height: 0.5;' |''get creature description name'' | | style = 'color: #505050; line-height: 0.5;' |''get creature description name'' | ||
|- | |- | ||
− | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../string]] | + | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|string]] |
| style='color: black; width: 90%; line-height: 0.8;' | '''GetCreatureType''' () const | | style='color: black; width: 90%; line-height: 0.8;' | '''GetCreatureType''' () const | ||
|- | |- | ||
Line 34: | Line 34: | ||
| style = 'color: #505050; line-height: 0.5;' |''can the creature be given commands by the player?'' | | style = 'color: #505050; line-height: 0.5;' |''can the creature be given commands by the player?'' | ||
|- | |- | ||
− | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../void]] | + | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]] |
| style='color: black; width: 90%; line-height: 0.8;' | '''SetPlayerControllable''' (const [[../BasicDataTypes|bool]] ''_bControllable'') | | style='color: black; width: 90%; line-height: 0.8;' | '''SetPlayerControllable''' (const [[../BasicDataTypes|bool]] ''_bControllable'') | ||
|- | |- | ||
Line 46: | Line 46: | ||
| style = 'color: #505050; line-height: 0.5;' |''can the creature be pushed around by others while idle?'' | | style = 'color: #505050; line-height: 0.5;' |''can the creature be pushed around by others while idle?'' | ||
|- | |- | ||
− | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../void]] | + | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]] |
| style='color: black; width: 90%; line-height: 0.8;' | '''SetImmovable''' (const [[../BasicDataTypes|bool]] ''_bImmovable'') | | style='color: black; width: 90%; line-height: 0.8;' | '''SetImmovable''' (const [[../BasicDataTypes|bool]] ''_bImmovable'') | ||
|- | |- | ||
Line 53: | Line 53: | ||
|- | |- | ||
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]] | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]] | ||
− | | style='color: black; width: 90%; line-height: 0.8;' | '''Damage''' (const [[../string]]&in ''_sDamageTypeName'', const [[../BasicDataTypes|uint]] ''_uAmount'') | + | | style='color: black; width: 90%; line-height: 0.8;' | '''Damage''' (const [[../BasicDataTypes|string]]&in ''_sDamageTypeName'', const [[../BasicDataTypes|uint]] ''_uAmount'') |
|- | |- | ||
| | | | ||
| style = 'color: #505050; line-height: 0.5;' |''damage the creature for _uAmount HP of the given damage type, returns true if killed'' | | style = 'color: #505050; line-height: 0.5;' |''damage the creature for _uAmount HP of the given damage type, returns true if killed'' | ||
|- | |- | ||
− | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../void]] | + | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]] |
| style='color: black; width: 90%; line-height: 0.8;' | '''Kill''' () | | style='color: black; width: 90%; line-height: 0.8;' | '''Kill''' () | ||
|- | |- | ||
Line 64: | Line 64: | ||
| style = 'color: #505050; line-height: 0.5;' |''immediately kill the creature'' | | style = 'color: #505050; line-height: 0.5;' |''immediately kill the creature'' | ||
|- | |- | ||
− | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../void]] | + | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]] |
− | | style='color: black; width: 90%; line-height: 0.8;' | '''Stop''' ([[../LevelReference@]] ''_Level'') | + | | style='color: black; width: 90%; line-height: 0.8;' | '''Stop''' ([[../LevelReference@|LevelReference@]] ''_Level'') |
|- | |- | ||
| | | | ||
| style = 'color: #505050; line-height: 0.5;' |''stop the creature dead in its tracks immediately. cancels any pending orders.'' | | style = 'color: #505050; line-height: 0.5;' |''stop the creature dead in its tracks immediately. cancels any pending orders.'' | ||
|- | |- | ||
− | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../void]] | + | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]] |
− | | style='color: black; width: 90%; line-height: 0.8;' | '''FollowPath''' ([[../LevelReference@]] ''_Level'', const [[../string]]&in ''_sPathName'', const [[../BasicDataTypes|bool]] ''_bForward'', const [[../BasicDataTypes|bool]] ''_bQueued'') | + | | style='color: black; width: 90%; line-height: 0.8;' | '''FollowPath''' ([[../LevelReference@|LevelReference@]] ''_Level'', const [[../BasicDataTypes|string]]&in ''_sPathName'', const [[../BasicDataTypes|bool]] ''_bForward'', const [[../BasicDataTypes|bool]] ''_bQueued'') |
|- | |- | ||
|- | |- | ||
− | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../void]] | + | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]] |
− | | style='color: black; width: 90%; line-height: 0.8;' | '''GoTo''' ([[../LevelReference@]] ''_Level'', const [[../Entity]]&in ''_Target'', const [[../BasicDataTypes|uint]] ''_uMinDistance'', const [[../BasicDataTypes|uint]] ''_uMaxDistance'', const [[../BasicDataTypes|bool]] ''_bQueued'') | + | | style='color: black; width: 90%; line-height: 0.8;' | '''GoTo''' ([[../LevelReference@|LevelReference@]] ''_Level'', const [[../Entity|Entity]]&in ''_Target'', const [[../BasicDataTypes|uint]] ''_uMinDistance'', const [[../BasicDataTypes|uint]] ''_uMaxDistance'', const [[../BasicDataTypes|bool]] ''_bQueued'') |
|- | |- | ||
| | | | ||
Line 81: | Line 81: | ||
|- | |- | ||
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]] | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]] | ||
− | | style='color: black; width: 90%; line-height: 0.8;' | '''Interact''' ([[../LevelReference@]] ''_Level'', const [[../Entity]]&in ''_Target'', const [[../BasicDataTypes|bool]] ''_bQueued'') | + | | style='color: black; width: 90%; line-height: 0.8;' | '''Interact''' ([[../LevelReference@|LevelReference@]] ''_Level'', const [[../Entity|Entity]]&in ''_Target'', const [[../BasicDataTypes|bool]] ''_bQueued'') |
|- | |- | ||
| | | | ||
Line 87: | Line 87: | ||
|- | |- | ||
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]] | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]] | ||
− | | style='color: black; width: 90%; line-height: 0.8;' | '''Talk''' ([[../LevelReference@]] ''_Level'', const [[../Entity]]&in ''_Target'', const [[../string]]&in ''_sContainerName'', const [[../string]]&in ''_sTopicName'', const [[../BasicDataTypes|bool]] ''_bQueued'') | + | | style='color: black; width: 90%; line-height: 0.8;' | '''Talk''' ([[../LevelReference@|LevelReference@]] ''_Level'', const [[../Entity|Entity]]&in ''_Target'', const [[../BasicDataTypes|string]]&in ''_sContainerName'', const [[../BasicDataTypes|string]]&in ''_sTopicName'', const [[../BasicDataTypes|bool]] ''_bQueued'') |
|- | |- | ||
| | | | ||
Line 93: | Line 93: | ||
|- | |- | ||
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]] | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]] | ||
− | | style='color: black; width: 90%; line-height: 0.8;' | '''Shoutout''' ([[../LevelReference@]] ''_Level'', const [[../string]]&in ''_sContainerName'', const [[../string]]&in ''_sTopicName'', const [[../BasicDataTypes|bool]] ''_bQueued'') | + | | style='color: black; width: 90%; line-height: 0.8;' | '''Shoutout''' ([[../LevelReference@|LevelReference@]] ''_Level'', const [[../BasicDataTypes|string]]&in ''_sContainerName'', const [[../BasicDataTypes|string]]&in ''_sTopicName'', const [[../BasicDataTypes|bool]] ''_bQueued'') |
|- | |- | ||
| | | | ||
| style = 'color: #505050; line-height: 0.5;' |''make the creature talk to itself.'' | | style = 'color: #505050; line-height: 0.5;' |''make the creature talk to itself.'' | ||
|- | |- | ||
− | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../void]] | + | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]] |
− | | style='color: black; width: 90%; line-height: 0.8;' | '''DropItem''' ([[../LevelReference@]] ''_Level'', const [[../string]]&in ''_sItemName'', const [[../BasicDataTypes|uint]] ''_uAmount'') | + | | style='color: black; width: 90%; line-height: 0.8;' | '''DropItem''' ([[../LevelReference@|LevelReference@]] ''_Level'', const [[../BasicDataTypes|string]]&in ''_sItemName'', const [[../BasicDataTypes|uint]] ''_uAmount'') |
|- | |- | ||
| | | | ||
| style = 'color: #505050; line-height: 0.5;' |''drop the given item at the creature's feet'' | | style = 'color: #505050; line-height: 0.5;' |''drop the given item at the creature's feet'' | ||
|- | |- | ||
− | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../Creature]]& | + | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../Creature|Creature]]& |
− | | style='color: black; width: 90%; line-height: 0.8;' | '''operator=''' (const [[../Creature]]&in) | + | | style='color: black; width: 90%; line-height: 0.8;' | '''operator=''' (const [[../Creature|Creature]]&in) |
|- | |- | ||
|- | |- | ||
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]] | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]] | ||
− | | style='color: black; width: 90%; line-height: 0.8;' | '''operator==''' (const [[../Creature]]&in) | + | | style='color: black; width: 90%; line-height: 0.8;' | '''operator==''' (const [[../Creature|Creature]]&in) |
|- | |- | ||
|- | |- | ||
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]] | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|bool]] | ||
− | | style='color: black; width: 90%; line-height: 0.8;' | '''operator==''' (const [[../Entity]]&in) | + | | style='color: black; width: 90%; line-height: 0.8;' | '''operator==''' (const [[../Entity|Entity]]&in) |
|- | |- | ||
|- | |- | ||
Line 128: | Line 128: | ||
|- | |- | ||
|- | |- | ||
− | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../void]] | + | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]] |
| style='color: black; width: 90%; line-height: 0.8;' | '''SetFaction''' (const [[../BasicDataTypes|uint8]] ''_Faction'') | | style='color: black; width: 90%; line-height: 0.8;' | '''SetFaction''' (const [[../BasicDataTypes|uint8]] ''_Faction'') | ||
|- | |- | ||
|- | |- | ||
− | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../string]] | + | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|string]] |
| style='color: black; width: 90%; line-height: 0.8;' | '''GetEntityType''' () const | | style='color: black; width: 90%; line-height: 0.8;' | '''GetEntityType''' () const | ||
|- | |- | ||
Line 140: | Line 140: | ||
|- | |- | ||
|- | |- | ||
− | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../void]] | + | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]] |
| style='color: black; width: 90%; line-height: 0.8;' | '''Enable''' (const [[../BasicDataTypes|bool]] ''_bEnabled'') | | style='color: black; width: 90%; line-height: 0.8;' | '''Enable''' (const [[../BasicDataTypes|bool]] ''_bEnabled'') | ||
|- | |- | ||
Line 148: | Line 148: | ||
|- | |- | ||
|- | |- | ||
− | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../void]] | + | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]] |
| style='color: black; width: 90%; line-height: 0.8;' | '''SetInteractive''' (const [[../BasicDataTypes|bool]] ''_bInteractive'') | | style='color: black; width: 90%; line-height: 0.8;' | '''SetInteractive''' (const [[../BasicDataTypes|bool]] ''_bInteractive'') | ||
|- | |- | ||
Line 156: | Line 156: | ||
|- | |- | ||
|- | |- | ||
− | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../void]] | + | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]] |
| style='color: black; width: 90%; line-height: 0.8;' | '''SetAttackable''' (const [[../BasicDataTypes|bool]] ''_bAttackable'') | | style='color: black; width: 90%; line-height: 0.8;' | '''SetAttackable''' (const [[../BasicDataTypes|bool]] ''_bAttackable'') | ||
|- | |- | ||
|- | |- | ||
− | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../Entity]] | + | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../Entity|Entity]] |
| style='color: black; width: 90%; line-height: 0.8;' | '''opImplConv''' () const | | style='color: black; width: 90%; line-height: 0.8;' | '''opImplConv''' () const | ||
|- | |- | ||
|} | |} |
Revision as of 13:20, 26 August 2016
class Creature
Represents a reference to a creature in the game world.
Class Methods
string | GetDescriptionName () const |
get creature description name | |
string | GetCreatureType () const |
get creature type name | |
int | GetCurrentHP () const |
get current creature health | |
int | GetMaxHP () const |
get maximum creature health | |
bool | IsPlayerControllable () const |
can the creature be given commands by the player? | |
void | SetPlayerControllable (const bool _bControllable) |
set whether the creature can be controlled by the player | |
bool | IsImmovable () const |
can the creature be pushed around by others while idle? | |
void | SetImmovable (const bool _bImmovable) |
set whether the creature can be pushed around by others while idle (only valid until the creature gets another command). | |
bool | Damage (const string&in _sDamageTypeName, const uint _uAmount) |
damage the creature for _uAmount HP of the given damage type, returns true if killed | |
void | Kill () |
immediately kill the creature | |
void | Stop (LevelReference@ _Level) |
stop the creature dead in its tracks immediately. cancels any pending orders. | |
void | FollowPath (LevelReference@ _Level, const string&in _sPathName, const bool _bForward, const bool _bQueued) |
void | GoTo (LevelReference@ _Level, const Entity&in _Target, const uint _uMinDistance, const uint _uMaxDistance, const bool _bQueued) |
make the creature walk to the given target | |
bool | Interact (LevelReference@ _Level, const Entity&in _Target, const bool _bQueued) |
make the creature interact with the given target | |
bool | Talk (LevelReference@ _Level, const Entity&in _Target, const string&in _sContainerName, const string&in _sTopicName, const bool _bQueued) |
make the creature talk to the given target | |
bool | Shoutout (LevelReference@ _Level, const string&in _sContainerName, const string&in _sTopicName, const bool _bQueued) |
make the creature talk to itself. | |
void | DropItem (LevelReference@ _Level, const string&in _sItemName, const uint _uAmount) |
drop the given item at the creature's feet | |
Creature& | operator= (const Creature&in) |
bool | operator== (const Creature&in) |
bool | operator== (const Entity&in) |
bool | Exists () const |
uint | GetId () const |
uint8 | GetFaction () const |
void | SetFaction (const uint8 _Faction) |
string | GetEntityType () const |
bool | IsEnabled () const |
void | Enable (const bool _bEnabled) |
bool | IsInteractive () const |
void | SetInteractive (const bool _bInteractive) |
bool | CanBeAttacked () const |
void | SetAttackable (const bool _bAttackable) |
Entity | opImplConv () const |