Manual:DIL Manual/followercount
Jump to navigation
Jump to search
Contents
followercount
Field (integer, read-only; units: characters).
ch.followercount : integer
How many characters follow this one directly: not their own followers. 0 when none. getfollower(ch, i) gives each of them, i from 0 to followercount - 1; a follower's master is this character.
Notes
- Read-only: vmc refuses an assignment ("Illegal lvalue").
- Followers are not all in the group: test
CHAR_GROUPin their charflags. - On an object, a room or null it fails.
Example
dilbegin group_hp(ch : unitptr);
var
i : integer;
u : unitptr;
code
{
i := 0;
while (i < ch.followercount)
{
u := getfollower(ch, i);
if (isset(u.charflags, CHAR_GROUP))
sendtext(u.name + ": " + itoa(u.hp) + "/" + itoa(u.max_hp) + " hit points<br/>", ch);
i := i + 1;
}
return;
}
dilend
Shows a leader the hit points of each group member, as the group command in commands.zon.