Difference between revisions of "Script/CreatureGroup"
From SF3
(→Class Methods) |
|||
Line 78: | Line 78: | ||
|- | |- | ||
| 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: 1.0;' | '''FollowPath''' (const [[../BasicDataTypes|string]]&in ''_sPathName'', const [[../BasicDataTypes|bool]] ''_bForward'', const [[../BasicDataTypes|bool]] ''_bQueued'' = false) | + | | 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) |
|- | |- | ||
| | | | ||
Line 84: | 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: 1.0;' | '''FollowPathFromBeginning''' (const [[../BasicDataTypes|string]]&in ''_sPathName'', const [[../BasicDataTypes|bool]] ''_bForward'', const [[../BasicDataTypes|bool]] ''_bQueued'' = false) | + | | 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) |
|- | |- | ||
| | | | ||
Line 90: | Line 90: | ||
|- | |- | ||
| 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: 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) | + | | 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) |
|- | |- | ||
| | | | ||
Line 96: | Line 96: | ||
|- | |- | ||
| 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: 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) | + | | 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) |
|- | |- | ||
| | | | ||
Line 102: | Line 102: | ||
|- | |- | ||
| 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: 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) | + | | 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) |
|- | |- | ||
| | | | ||
Line 114: | Line 114: | ||
|- | |- | ||
| 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 120: | Line 120: | ||
|- | |- | ||
| 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 144: | Line 144: | ||
|- | |- | ||
| 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 150: | 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 [[../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) |
|- | |- | ||
| | | |
Revision as of 14:05, 16 February 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. | |
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) |
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 | 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) |