Difference between revisions of "Script/CreatureGroup"
From SF3
(→Class Methods) |
|||
(9 intermediate revisions by the same user not shown) | |||
Line 34: | Line 34: | ||
| | | | ||
| style = 'color: #505050; line-height: 0.5;' |''get the faction of the creatures in the group. may return kMaxFactions if the group is empty.'' | | style = 'color: #505050; line-height: 0.5;' |''get the faction of the creatures in the group. may return kMaxFactions if the group is empty.'' | ||
+ | |- | ||
+ | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]] | ||
+ | | style='color: black; width: 90%; line-height: 1.0;' | '''SetFaction''' (const [[../BasicDataTypes|uint8]] ''_Faction'') | ||
+ | |- | ||
+ | | | ||
+ | | style = 'color: #505050; line-height: 0.5;' |''set the faction of all creatures in this group'' | ||
|- | |- | ||
| style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../Creature|Creature[]@]] | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../Creature|Creature[]@]] | ||
Line 78: | Line 84: | ||
|- | |- | ||
| 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]] | ||
− | | style='color: black; width: 90%; line-height: 0.8;' | ''' | + | | style='color: black; width: 90%; line-height: 1.0;' | '''FollowPath''' (const [[../BasicDataTypes|string]]&in ''_sPathName'', const [[../BasicDataTypes|bool]] ''_bForward'', const [[../BasicDataTypes|bool]] ''_bQueued'' = false, const [[../BasicDataTypes|bool]] ''_bWalk'' = false) |
+ | |- | ||
+ | | | ||
+ | | style = 'color: #505050; line-height: 0.5;' |''make the creatures walk along the given path (will first go to the closest point on the path and then follow from there)'' | ||
+ | |- | ||
+ | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]] | ||
+ | | style='color: black; width: 90%; line-height: 1.0;' | '''FollowPathFromBeginning''' (const [[../BasicDataTypes|string]]&in ''_sPathName'', const [[../BasicDataTypes|bool]] ''_bForward'', const [[../BasicDataTypes|bool]] ''_bQueued'' = false, const [[../BasicDataTypes|bool]] ''_bWalk'' = false) | ||
+ | |- | ||
+ | | | ||
+ | | style = 'color: #505050; line-height: 0.5;' |''make the creature walk along the given path (will go to the first point of the path and then follow from there)'' | ||
+ | |- | ||
+ | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]] | ||
+ | | style='color: black; width: 90%; line-height: 1.0;' | '''FollowPathWait''' (const [[../BasicDataTypes|string]]&in ''_sPathName'', const [[../BasicDataTypes|bool]] ''_bForward'', const [[../BasicDataTypes|bool]] ''_bFromBeginning'', const [[../BasicDataTypes|uint8]] ''_WaitForHeroesFaction'', const [[../LogicEnums#EFollowPathWaitMode|EFollowPathWaitMode]] ''_WaitMode'', const [[../BasicDataTypes|bool]] ''_bQueued'' = false, const [[../BasicDataTypes|bool]] ''_bWalk'' = false) | ||
+ | |- | ||
+ | | | ||
+ | | style = 'color: #505050; line-height: 0.5;' |''make the creature walk along the given path, but wait for heroes of the given party to be nearby before continuing to the next waypoint'' | ||
+ | |- | ||
+ | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]] | ||
+ | | style='color: black; width: 90%; line-height: 1.0;' | '''FollowPathSmooth''' (const [[../BasicDataTypes|string]]&in ''_sPathName'', const [[../BasicDataTypes|bool]] ''_bForward'', const [[../BasicDataTypes|bool]] ''_bFromBeginning'' = true, const [[../BasicDataTypes|uint8]] ''_WaitForHeroesFaction'' = kMaxFactions, const [[../LogicEnums#EFollowPathWaitMode|EFollowPathWaitMode]] ''_WaitMode'' = WaitForAnyHeroes, const [[../BasicDataTypes|bool]] ''_bQueued'' = false, const [[../BasicDataTypes|bool]] ''_bWalk'' = false) | ||
+ | |- | ||
+ | | | ||
+ | | style = 'color: #505050; line-height: 0.5;' |''same as FollowPathWait, but creatures will not stop at every waypoint. may cause creatures to get spread over long distances.'' | ||
+ | |- | ||
+ | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]] | ||
+ | | style='color: black; width: 90%; line-height: 1.0;' | '''Patrol''' (const [[../BasicDataTypes|string]]&in ''_sPathName'', const [[../BasicDataTypes|bool]] ''_bPingPong'', const [[../BasicDataTypes|bool]] ''_bForward'', const [[../BasicDataTypes|bool]] ''_bSmooth'', const [[../BasicDataTypes|bool]] ''_bQueued'' = false, const [[../BasicDataTypes|bool]] ''_bWalk'' = false) | ||
+ | |- | ||
+ | | | ||
+ | | style = 'color: #505050; line-height: 1.0;' |''make the group continuously patrol along the given path. if _bPingPong is true, the group will alternate between walking the path forward and backward. otherwise, it will start over from the beginning after reaching the end.'' | ||
+ | |- | ||
+ | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]] | ||
+ | | style='color: black; width: 90%; line-height: 1.0;' | '''FollowCreature''' (const [[../Creature|Creature]]&in ''_Creature'', const [[../BasicDataTypes|uint]] ''_uMaxDistance'' = 80, const [[../BasicDataTypes|uint]] ''_uMinDistance'' = 20, const [[../BasicDataTypes|bool]] ''_bQueued'' = false, const [[../BasicDataTypes|bool]] ''_bWalk'' = false) | ||
|- | |- | ||
| | | | ||
− | | style = 'color: #505050; line-height: 0.5;' |'' | + | | style = 'color: #505050; line-height: 0.5;' |''follow the given creature, trying to stay within the given distance from it'' |
|- | |- | ||
| 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]] | ||
− | | style='color: black; width: 90%; line-height: 0.8;' | '''Move''' (const [[../Entity|Entity]]&in ''_Target'', const [[../BasicDataTypes|bool]] ''_bQueued'' = false) | + | | style='color: black; width: 90%; line-height: 0.8;' | '''Move''' (const [[../Entity|Entity]]&in ''_Target'', const [[../BasicDataTypes|bool]] ''_bQueued'' = false, const [[../BasicDataTypes|bool]] ''_bSameSpeed'' = false, const [[../BasicDataTypes|bool]] ''_bWalk'' = false) |
|- | |- | ||
| | | | ||
Line 90: | Line 126: | ||
|- | |- | ||
| 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]] | ||
− | | style='color: black; width: 90%; line-height: 0.8;' | '''Move''' (const [[../Position|Position]]&in ''_Target'', const [[../BasicDataTypes|bool]] ''_bQueued'' = false) | + | | style='color: black; width: 90%; line-height: 0.8;' | '''Move''' (const [[../Position|Position]]&in ''_Target'', const [[../BasicDataTypes|bool]] ''_bQueued'' = false, const [[../BasicDataTypes|bool]] ''_bSameSpeed'' = false, const [[../BasicDataTypes|bool]] ''_bWalk'' = false) |
|- | |- | ||
| | | | ||
Line 114: | Line 150: | ||
|- | |- | ||
| 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]] | ||
− | | style='color: black; width: 90%; line-height: 0.8;' | '''AttackPosition''' (const [[../Entity|Entity]]&in ''_Target'', const [[../BasicDataTypes|bool]] ''_bQueued'' = false) | + | | style='color: black; width: 90%; line-height: 0.8;' | '''AttackPosition''' (const [[../Entity|Entity]]&in ''_Target'', const [[../BasicDataTypes|bool]] ''_bQueued'' = false, const [[../BasicDataTypes|bool]] ''_bWalk'' = false) |
|- | |- | ||
| | | | ||
Line 120: | Line 156: | ||
|- | |- | ||
| 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]] | ||
− | | style='color: black; width: 90%; line-height: 0.8;' | '''AttackPosition''' (const [[../Position|Position]]&in ''_Target'', const [[../BasicDataTypes|bool]] ''_bQueued'' = false) | + | | style='color: black; width: 90%; line-height: 0.8;' | '''AttackPosition''' (const [[../Position|Position]]&in ''_Target'', const [[../BasicDataTypes|bool]] ''_bQueued'' = false, const [[../BasicDataTypes|bool]] ''_bWalk'' = false) |
|- | |- | ||
| | | | ||
Line 130: | Line 166: | ||
| | | | ||
| style = 'color: #505050; line-height: 0.5;' |''attack the given entity'' | | style = 'color: #505050; line-height: 0.5;' |''attack the given entity'' | ||
+ | |- | ||
+ | | style='color: blue; width: 10%; text-align:right;line-height: 0.8;' | [[../BasicDataTypes|void]] | ||
+ | | style='color: black; width: 90%; line-height: 1.0;' | '''Cast''' (const [[../BasicDataTypes|string]]&in ''_sSpellName'', const [[../Entity|Entity]]&in ''_Target'', const [[../BasicDataTypes|bool]] ''_bQueued'' = false) | ||
+ | |- | ||
+ | | | ||
+ | | style = 'color: #505050; line-height: 0.5;' |''cast a spell at the given target (_Target may be Entity()/invalid if the spell is self-cast)'' | ||
|- | |- | ||
| 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]] |
Latest revision as of 14:01, 27 July 2017
class CreatureGroup
Interface to give coordinated commands to a selected group of creatures.
Class Methods
[constructor] | CreatureGroup (LevelReference&in _Level) |
create an empty creature group. | |
[constructor] | CreatureGroup (LevelReference&in _Level, const Creature[]&in _Creatures) |
create a creature group using the given creatures. | |
[constructor] | CreatureGroup (const CreatureGroup&in _Other) |
copy data from the given creature group. | |
[constructor] | CreatureGroup () |
default constructor. NEVER USE THIS! this constructor only exists because AngelScript requires it. | |
uint8 | GetFaction () const |
get the faction of the creatures in the group. may return kMaxFactions if the group is empty. | |
void | SetFaction (const uint8 _Faction) |
set the faction of all creatures in this group | |
Creature[]@ | GetCreatures () const |
get a list of creatures currently in the group | |
bool | IsMember (const Creature&in _Creature) const |
check if the given creature is a member of this group | |
void | Add (const Creature&in _Creature) |
add a creature to the selection | |
void | Set (const Creature[]&in _Creatures) |
assign a new set of creatures to the selection, replacing any previous ones. | |
void | Remove (const Creature&in _Creature) |
remove the given creature from the selection | |
void | Clear () |
remove all creatures from the selection | |
void | SetControllable (const bool _bControllable) |
make creatures in this group controllable by the player (or not) | |
void | FollowPath (const string&in _sPathName, const bool _bForward, const bool _bQueued = false, const bool _bWalk = false) |
make the creatures walk along the given path (will first go to the closest point on the path and then follow from there) | |
void | FollowPathFromBeginning (const string&in _sPathName, const bool _bForward, const bool _bQueued = false, const bool _bWalk = false) |
make the creature walk along the given path (will go to the first point of the path and then follow from there) | |
void | FollowPathWait (const string&in _sPathName, const bool _bForward, const bool _bFromBeginning, const uint8 _WaitForHeroesFaction, const EFollowPathWaitMode _WaitMode, const bool _bQueued = false, const bool _bWalk = false) |
make the creature walk along the given path, but wait for heroes of the given party to be nearby before continuing to the next waypoint | |
void | FollowPathSmooth (const string&in _sPathName, const bool _bForward, const bool _bFromBeginning = true, const uint8 _WaitForHeroesFaction = kMaxFactions, const EFollowPathWaitMode _WaitMode = WaitForAnyHeroes, const bool _bQueued = false, const bool _bWalk = false) |
same as FollowPathWait, but creatures will not stop at every waypoint. may cause creatures to get spread over long distances. | |
void | Patrol (const string&in _sPathName, const bool _bPingPong, const bool _bForward, const bool _bSmooth, const bool _bQueued = false, const bool _bWalk = false) |
make the group continuously patrol along the given path. if _bPingPong is true, the group will alternate between walking the path forward and backward. otherwise, it will start over from the beginning after reaching the end. | |
void | FollowCreature (const Creature&in _Creature, const uint _uMaxDistance = 80, const uint _uMinDistance = 20, const bool _bQueued = false, const bool _bWalk = false) |
follow the given creature, trying to stay within the given distance from it | |
void | Move (const Entity&in _Target, const bool _bQueued = false, const bool _bSameSpeed = false, const bool _bWalk = false) |
move to the CURRENT position of the given entity | |
void | Move (const Position&in _Target, const bool _bQueued = false, const bool _bSameSpeed = false, const bool _bWalk = false) |
move to the CURRENT position of the given entity | |
void | Teleport (const Entity&in _Target, const bool _bQueued = false) |
teleport selection to the target position | |
void | Stop () |
stop whatever you are doing. for obvious reasons, this one can't be queued. | |
void | HoldPosition (const bool _bQueued = false) |
let the creatures stop and hold their position wherever they are at the moment | |
void | AttackPosition (const Entity&in _Target, const bool _bQueued = false, const bool _bWalk = false) |
attack the general area around the given entity | |
void | AttackPosition (const Position&in _Target, const bool _bQueued = false, const bool _bWalk = false) |
attack the general area around the given entity | |
void | AttackEntity (const Entity&in _Target, const bool _bQueued = false) |
attack the given entity | |
void | Cast (const string&in _sSpellName, const Entity&in _Target, const bool _bQueued = false) |
cast a spell at the given target (_Target may be Entity()/invalid if the spell is self-cast) | |
void | Die (const bool _bQueued = false) |
kill all creatures in the group | |
void | BuildSectorCenter (const uint16 _uSectorIndex, const bool _bQueued = false) |
build a sector center in the given sector. may fail if there is already a sector center present. requires at least one hero to be in the selection. | |
CreatureGroup& | operator= (const CreatureGroup&in _Other) |