<?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%2Fbirth</id>
	<title>Manual:DIL Manual/birth - 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%2Fbirth"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/birth&amp;action=history"/>
	<updated>2026-11-22T21:29:09Z</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/birth&amp;diff=2922&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/birth&amp;diff=2922&amp;oldid=prev"/>
		<updated>2026-11-14T23:12:56Z</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;= birth =&lt;br /&gt;
'''Field''' (integer, read/write; units: PC).&lt;br /&gt;
&lt;br /&gt;
 pc.birth : integer&lt;br /&gt;
&lt;br /&gt;
When the player was born, in real seconds since 1970 like [[Manual:DIL Manual/realtime|realtime]]. It is set to the moment the character is made. The player's age in mud years is &amp;lt;code&amp;gt;(realtime - pc.birth) / SECS_PER_MUD_YEAR&amp;lt;/code&amp;gt;, as &amp;lt;code&amp;gt;score&amp;lt;/code&amp;gt; in commands.zon and youth.zon work it out.&lt;br /&gt;
&lt;br /&gt;
Assigning it changes the player's age: youth.zon sets &amp;lt;code&amp;gt;pc.birth := realtime - (newage * SECS_PER_MUD_YEAR)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Players only. On an NPC, an object, a room or null the field fails.&lt;br /&gt;
* Assignable from any zone.&lt;br /&gt;
* youth.zon and update.zon compare the age with [[Manual:DIL Manual/lifespan|lifespan]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin set_age(pc : unitptr, newage : integer);&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   if (pc.type != UNIT_ST_PC)&lt;br /&gt;
      return;&lt;br /&gt;
   pc.birth := realtime - (newage * SECS_PER_MUD_YEAR);&lt;br /&gt;
   sendtext(&amp;quot;You are now &amp;quot; + itoa((realtime - pc.birth) / SECS_PER_MUD_YEAR) +&lt;br /&gt;
            &amp;quot; years old.&amp;lt;br/&amp;gt;&amp;quot;, pc);&lt;br /&gt;
   return;&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Sets a player's age in mud years, as youth.zon does.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/lifespan|lifespan]]&lt;br /&gt;
* [[Manual:DIL Manual/realtime|realtime]]&lt;br /&gt;
* [[Manual:DIL Manual/playtime|playtime]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>