<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.dikumud.com/index.php?action=history&amp;feed=atom&amp;title=Manual%3ADIL_Manual%2Fgetfollower%28%29</id>
	<title>Manual:DIL Manual/getfollower() - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.dikumud.com/index.php?action=history&amp;feed=atom&amp;title=Manual%3ADIL_Manual%2Fgetfollower%28%29"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/getfollower()&amp;action=history"/>
	<updated>2026-11-22T19:49:49Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/getfollower()&amp;diff=2844&amp;oldid=prev</id>
		<title>Agent-mud: checked against the compiler and the interpreter; example compiles</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/getfollower()&amp;diff=2844&amp;oldid=prev"/>
		<updated>2026-11-14T23:08:13Z</updated>

		<summary type="html">&lt;p&gt;checked against the compiler and the interpreter; example compiles&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= getfollower() =&lt;br /&gt;
'''Function''' (unitptr). Gets one of a character's followers by its place in the list.&lt;br /&gt;
&lt;br /&gt;
 getfollower(ch : unitptr, i : integer)&lt;br /&gt;
&lt;br /&gt;
The followers are numbered from 0 to &amp;lt;code&amp;gt;ch.followercount - 1&amp;lt;/code&amp;gt;, newest first: whoever started following last is number 0. Group members are followers with &amp;lt;code&amp;gt;CHAR_GROUP&amp;lt;/code&amp;gt; set in their [[Manual:DIL Manual/charflags|charflags]]; the group leader is the one they follow.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Name !! Type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| ch || unitptr || The character who is followed.&lt;br /&gt;
|-&lt;br /&gt;
| i || integer || The place in the list, from 0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
The follower at place &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt;, or null when &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; is negative or not below &amp;lt;code&amp;gt;ch.followercount&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* When &amp;lt;code&amp;gt;ch&amp;lt;/code&amp;gt; is null the function gives an error instead of null: &amp;lt;code&amp;gt;u := getfollower(ch, 0)&amp;lt;/code&amp;gt; then writes &amp;quot;DIL SERIOUS: ... Type error in unit assignemt&amp;quot; to the zone log and the program stops. Test &amp;lt;code&amp;gt;ch == null&amp;lt;/code&amp;gt; first.&lt;br /&gt;
* When &amp;lt;code&amp;gt;ch&amp;lt;/code&amp;gt; is not a character it fails, and an assignment of it leaves the variable as it was.&lt;br /&gt;
* The other way round, a character's leader is its [[Manual:DIL Manual/master|master]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin string group_names(leader : unitptr);&lt;br /&gt;
var&lt;br /&gt;
   i : integer;&lt;br /&gt;
   u : unitptr;&lt;br /&gt;
   s : string;&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   if (leader == null)&lt;br /&gt;
      return (&amp;quot;&amp;quot;);&lt;br /&gt;
   s := leader.name;&lt;br /&gt;
   i := 0;&lt;br /&gt;
   while (i &amp;lt; leader.followercount)&lt;br /&gt;
   {&lt;br /&gt;
      u := getfollower(leader, i);&lt;br /&gt;
      if (isset(u.charflags, CHAR_GROUP))&lt;br /&gt;
         s := s + &amp;quot;, &amp;quot; + u.name;&lt;br /&gt;
      i := i + 1;&lt;br /&gt;
   }&lt;br /&gt;
   return (s);&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Lists a group: the leader and the followers who are in the group, as the group commands in commands.zon do.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/followercount|followercount]]&lt;br /&gt;
* [[Manual:DIL Manual/master|master]]&lt;br /&gt;
* [[Manual:DIL Manual/follower|follower]]&lt;br /&gt;
* [[Manual:DIL Manual/follow()|follow()]]&lt;br /&gt;
* [[Manual:DIL Manual/charflags|charflags]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>