<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://avendar.net/index.php?action=history&amp;feed=atom&amp;title=Avendar%3AProg_Section_5</id>
	<title>Avendar:Prog Section 5 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://avendar.net/index.php?action=history&amp;feed=atom&amp;title=Avendar%3AProg_Section_5"/>
	<link rel="alternate" type="text/html" href="https://avendar.net/index.php?title=Avendar:Prog_Section_5&amp;action=history"/>
	<updated>2026-05-21T04:28:09Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.4</generator>
	<entry>
		<id>https://avendar.net/index.php?title=Avendar:Prog_Section_5&amp;diff=2672&amp;oldid=prev</id>
		<title>Elanthe: Created page with &quot;=Mobile Memory and PC Data Fields=   &lt;i&gt;&quot;We all have nightmares to remind ourselves who we really are.&quot;&lt;/i&gt;     -- Leonard Shelby, Memento  : One of the most prominently lacking features from the original prog specification was  : the ability for mobileâ€™s to have a notion of &quot;memory&quot;, or the total lack of any internal : state (other than â€˜fightingâ€™ or â€˜not fightingâ€™).  : For example, mobiles could do none of the following: :  - Remember w...&quot;</title>
		<link rel="alternate" type="text/html" href="https://avendar.net/index.php?title=Avendar:Prog_Section_5&amp;diff=2672&amp;oldid=prev"/>
		<updated>2025-01-19T03:08:23Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;=Mobile Memory and PC Data Fields=   &amp;lt;i&amp;gt;&amp;quot;We all have nightmares to remind ourselves who we really are.&amp;quot;&amp;lt;/i&amp;gt;     -- Leonard Shelby, Memento  : One of the most prominently lacking features from the original prog specification was  : the ability for mobileâ€™s to have a notion of &amp;quot;memory&amp;quot;, or the total lack of any internal : state (other than â€˜fightingâ€™ or â€˜not fightingâ€™).  : For example, mobiles could do none of the following: :  - Remember w...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Mobile Memory and PC Data Fields=&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;i&amp;gt;&amp;quot;We all have nightmares to remind ourselves who we really are.&amp;quot;&amp;lt;/i&amp;gt;&lt;br /&gt;
    -- Leonard Shelby, Memento&lt;br /&gt;
&lt;br /&gt;
: One of the most prominently lacking features from the original prog specification was &lt;br /&gt;
: the ability for mobileâ€™s to have a notion of &amp;quot;memory&amp;quot;, or the total lack of any internal&lt;br /&gt;
: state (other than â€˜fightingâ€™ or â€˜not fightingâ€™).&lt;br /&gt;
&lt;br /&gt;
: For example, mobiles could do none of the following:&lt;br /&gt;
:  - Remember which pcâ€™s had been tasked with a quest &lt;br /&gt;
:  - Remember pcâ€™s who have attacked them in the past &lt;br /&gt;
:  - Have a dialogue with a pc, where the mobile remembers what has been said &lt;br /&gt;
:  - Marking a pc to be attacked by all the mobs in a given town or location &lt;br /&gt;
:  - Marking a pc to get lower prices/preferred treatment from various mobs &lt;br /&gt;
&lt;br /&gt;
: Given the dearth of these features, we have implemented several different solutions for &lt;br /&gt;
: these problems. &lt;br /&gt;
&lt;br /&gt;
=MOBILE MEMORY=&lt;br /&gt;
&lt;br /&gt;
==Integer Memory==&lt;br /&gt;
:   Firstly, every instance of a mobile has ten integer values associated with it. These&lt;br /&gt;
:   values, or &amp;quot;slots&amp;quot; as they are referred to, are themselves number from 0 to 9. From &lt;br /&gt;
:   within a prog, these values can be set to specific values, incremented, decremented, &lt;br /&gt;
:   and then tested by the mobile to see if they are equal to, not equal to, greater than, &lt;br /&gt;
:   or less than a specific value.&lt;br /&gt;
   &lt;br /&gt;
:   To see why this might be useful, consider a hen, which can be &amp;quot;fed&amp;quot; grain. Every time &lt;br /&gt;
:   the hen is fed, it would increment its &amp;quot;0&amp;quot; slot. If the &amp;quot;0&amp;quot; slot is greater than 10 (it&lt;br /&gt;
:   has been fed ten times), it refuses to eat, being too full. Then, over time (via a rand_prog,&lt;br /&gt;
:   say), the hen gradually becomes less full, until itâ€™s ready to eat again. &lt;br /&gt;
&lt;br /&gt;
:   The following are the mpcommands and if checks associated with mobile integer memory:&lt;br /&gt;
:     mpvalueup&lt;br /&gt;
:     mpvaluedown&lt;br /&gt;
:     mpvalueset&lt;br /&gt;
:     mpvaluerand&lt;br /&gt;
:     if mobvalue(&amp;lt;slot #&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
:   In addition to these, the value of a slot can be referenced by a variable, given by $0, $1, ... $9,&lt;br /&gt;
:   where the number corresponds to the given slot number. &lt;br /&gt;
   &lt;br /&gt;
:   Thus, if $0 had a value of &amp;quot;3&amp;quot;, and $0 appeared in a prog, $0 would be interpreted as &amp;quot;3&amp;quot; wherever&lt;br /&gt;
:   it occurred. [Note: For technical reasons, the $# variables can never appear on the left hand &lt;br /&gt;
:   side of any if check (i.e., before the operator)]. &lt;br /&gt;
&lt;br /&gt;
==String Memory==&lt;br /&gt;
(new info should go here...)&lt;br /&gt;
&lt;br /&gt;
==Character Memory==&lt;br /&gt;
:   After implementing integer memory for mobiles, we discovered that while useful, it was not yet&lt;br /&gt;
:   complete enough to allow for things we had planned. So, mobiles were given character memory,   &lt;br /&gt;
:   in the form of focus fields. &lt;br /&gt;
&lt;br /&gt;
:   Essentially, the focus fields allow the mobile to store PC information. Mobiles have two focus &lt;br /&gt;
:   fields, though they may have more in the future. Mobiles store their focus in the $f variable. &lt;br /&gt;
&lt;br /&gt;
:     $f0 references the first focus slot.&lt;br /&gt;
:     $f1 references the second focus slot.&lt;br /&gt;
&lt;br /&gt;
:   The following mpcommands govern the focus system:&lt;br /&gt;
:     mpfocus: Focuses on target player currently in the game, with specified focus slot&lt;br /&gt;
:     mpunfocus: Unfocuses the specified slot.&lt;br /&gt;
&lt;br /&gt;
==Memory==&lt;br /&gt;
:   In addition to the ability to focus on individual pcâ€™s, a mobile can also &amp;quot;remember&amp;quot; &lt;br /&gt;
:   a pc. Essentially, this is a binary toggle that every mobile has. Given a specific pc, &lt;br /&gt;
:   a mobile either does, or does not &amp;quot;remember&amp;quot; that pc. This memory persists until the mobile&lt;br /&gt;
:   &amp;quot;forgets&amp;quot; the player, or until the mobile perishes.&lt;br /&gt;
&lt;br /&gt;
:   The following mpcommands govern the remembrance system:&lt;br /&gt;
:     mpremember: Remembers target player &lt;br /&gt;
:     mpunremember: Forget target player if remembers: True if mobile remembers target player &lt;br /&gt;
&lt;br /&gt;
==Personal PC Value Fields==&lt;br /&gt;
:   If a mobile has &amp;quot;remember&amp;quot;-ed a pc, they gain a single integer field which they associate&lt;br /&gt;
:   with a pc. This operates exactly as the mobile integer memory fields, except that a different &lt;br /&gt;
:   set of commands reference this value, it is associated only with a specific remembered PC,&lt;br /&gt;
:   and (most importantly), it is relative to that particular mob. This means, for example, that&lt;br /&gt;
:   a hen could remember a pc, and set their personal value to 3, while an ethron could remember&lt;br /&gt;
:   them, set their personal value to 5, and both of them would &amp;quot;see&amp;quot; the PC as having their own,&lt;br /&gt;
:   personal value. &lt;br /&gt;
&lt;br /&gt;
:   The following mpcommands govern the personal pc value fields:&lt;br /&gt;
:     mpmemvset: Sets a value on target player &lt;br /&gt;
:     mpmemvup: Increase a playerâ€™s value by one &lt;br /&gt;
:     mpmemvdown: Decrease a playerâ€™s value by two &lt;br /&gt;
:     if mobvcheck: Checks a playerâ€™s personal value field &lt;br /&gt;
    &lt;br /&gt;
  &lt;br /&gt;
       &lt;br /&gt;
=PC DATA=&lt;br /&gt;
&lt;br /&gt;
:  Every player has 65,535 binary values associated with their player file. These values can be&lt;br /&gt;
:  toggled or checked by progs, and are permanent, until altered by a mobile or an affect. &lt;br /&gt;
&lt;br /&gt;
:  By no coincidence, there is a one to one correspondence between vnums and these binary bits. &lt;br /&gt;
:  In general, a builder should only be altering bits which correspond to vnums in his or her area.&lt;br /&gt;
&lt;br /&gt;
:  The following are commands which can set bits:&lt;br /&gt;
:    mpbitset: Sets a bit to 0 or 1&lt;br /&gt;
:    mpaddaff (using toggleoffaff or toggleonaff to toggle the bit after a specified duration)&lt;br /&gt;
:    if isbitset: True if the specified bit is set to 1&lt;/div&gt;</summary>
		<author><name>Elanthe</name></author>
	</entry>
</feed>