<?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%2Fcharflags</id>
	<title>Manual:DIL Manual/charflags - 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%2Fcharflags"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/charflags&amp;action=history"/>
	<updated>2026-11-22T19:54:44Z</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/charflags&amp;diff=2914&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/charflags&amp;diff=2914&amp;oldid=prev"/>
		<updated>2026-11-14T23:12:32Z</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;= charflags =&lt;br /&gt;
'''Field''' (integer, read/write; units: characters).&lt;br /&gt;
&lt;br /&gt;
 ch.charflags : integer&lt;br /&gt;
&lt;br /&gt;
The character flags: a bit field of &amp;lt;code&amp;gt;CHAR_*&amp;lt;/code&amp;gt; values, defined in vme.h. Among them &amp;lt;code&amp;gt;CHAR_PROTECTED&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CHAR_LEGAL_TARGET&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CHAR_OUTLAW&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CHAR_BLIND&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CHAR_HIDE&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CHAR_MUTE&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CHAR_SNEAK&amp;lt;/code&amp;gt;, the &amp;lt;code&amp;gt;CHAR_DETECT_*&amp;lt;/code&amp;gt; flags, &amp;lt;code&amp;gt;CHAR_WIMPY&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CHAR_PEACEFUL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CHAR_KILL_SELF&amp;lt;/code&amp;gt;. A zone file gives a mobile its flags with &amp;lt;code&amp;gt;romflags {...}&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Test a flag with [[Manual:DIL Manual/isset()|isset()]], and change it with [[Manual:DIL Manual/set()|set()]] and [[Manual:DIL Manual/unset()|unset()]].&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Players and NPCs. On an object, a room or null the field fails.&lt;br /&gt;
* Many of these flags come from affects (&amp;lt;code&amp;gt;APF_MOD_CHAR_FLAGS&amp;lt;/code&amp;gt;, e.g. sneak, hide, the detect spells). When such an affect ends it removes its flag, even if a program had set the same flag; then every remaining affect of that kind sets its flag again. A flag set by DIL therefore doesn't last if an affect for the same flag comes and goes.&lt;br /&gt;
* Assigning the whole field replaces every flag.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin string law_status(u : unitptr);&lt;br /&gt;
var&lt;br /&gt;
   s : string;&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   s := &amp;quot;&amp;quot;;&lt;br /&gt;
   if (isset(u.charflags, CHAR_PROTECTED))&lt;br /&gt;
      s := &amp;quot;protected&amp;quot;;&lt;br /&gt;
   if (isset(u.charflags, CHAR_OUTLAW))&lt;br /&gt;
      s := s + &amp;quot; outlaw&amp;quot;;&lt;br /&gt;
   if (isset(u.charflags, CHAR_LEGAL_TARGET))&lt;br /&gt;
      s := s + &amp;quot; legal target&amp;quot;;&lt;br /&gt;
   return (s);&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Describes a character's standing with the law, as &amp;lt;code&amp;gt;look&amp;lt;/code&amp;gt; does in baselook.zon.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/isset()|isset()]]&lt;br /&gt;
* [[Manual:DIL Manual/set()|set()]]&lt;br /&gt;
* [[Manual:DIL Manual/unset()|unset()]]&lt;br /&gt;
* [[Manual:DIL Manual/flags|flags]]&lt;br /&gt;
* [[Manual:DIL Manual/pcflags|pcflags]]&lt;br /&gt;
* [[Manual:DIL Manual/addaff()|addaff()]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>