<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="http://wiki.lostsouls.org/w/skins/common/feed.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>Man object creation - Revision history</title>
		<link>http://wiki.lostsouls.org/w/index.php?title=Man_object_creation&amp;action=history</link>
		<description>Revision history for this page on the wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.8.2</generator>
		<lastBuildDate>Sun, 03 May 2026 11:33:26 GMT</lastBuildDate>
		<item>
			<title>Laine at 22:13, 11 June 2007</title>
			<link>http://wiki.lostsouls.org/w/index.php?title=Man_object_creation&amp;diff=3997&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Files==&lt;br /&gt;
&lt;br /&gt;
 /obj/master/kernel.c&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
&lt;br /&gt;
The current Ain Soph calls a sequence of several functions in every&lt;br /&gt;
object when it is created, as defined by the driver hook settings for&lt;br /&gt;
H_CREATE_OB and H_CREATE_CLONE that kernel.c sets up.  This document is&lt;br /&gt;
to describe these functions, their purpose, the way they are intended to&lt;br /&gt;
work together, and the circumstances under which you might want to use&lt;br /&gt;
each.&lt;br /&gt;
&lt;br /&gt;
At this writing, these functions, other than create(), have only just&lt;br /&gt;
been defined, and it remains a matter of some work to fully implement the&lt;br /&gt;
manner in which they are meant to operate.  This document, therefore,&lt;br /&gt;
presently also serves as a guide for those who may wish to work on the lib&lt;br /&gt;
to more fully support these concepts.  Hopefully in the future, we may&lt;br /&gt;
remove this paragraph.&lt;br /&gt;
&lt;br /&gt;
The first function called is preinit().  This function is not intended&lt;br /&gt;
for use by content developers; its purpose is to initialize data structures&lt;br /&gt;
and so on.  This function is useful for setting up mappings and arrays that&lt;br /&gt;
need to be initialized, for example.  It is particularly important to call&lt;br /&gt;
::preinit() when you overload it, though it's always best practice to call&lt;br /&gt;
parent functions in the other create-time functions as well.&lt;br /&gt;
&lt;br /&gt;
The second function called is configure().  Ideally, almost all of the&lt;br /&gt;
code which has previously occured in the create() functions of characters,&lt;br /&gt;
armour, weapons, and so on should wind up moving to this function.  After&lt;br /&gt;
configure() is called, the object should have defined all of the values&lt;br /&gt;
necessary to define what it is, but should not have &amp;quot;done&amp;quot; anything; i.e.,&lt;br /&gt;
we should be able to set up a character's configuration in this function&lt;br /&gt;
but not set up their limbs and so forth until create().  Among other things,&lt;br /&gt;
this should reduce (though probably not eliminate) the need for certain&lt;br /&gt;
configuration functions to be called in a particular order.&lt;br /&gt;
&lt;br /&gt;
The third function called is create(), which we should all be familiar&lt;br /&gt;
with.  The concept here is, at this stage we should begin implementing the&lt;br /&gt;
configuration which was done in configure().  As an entirely new opportunity,&lt;br /&gt;
we can also now *validate* that configuration -- complain that critical&lt;br /&gt;
values were not set, or the like.  In create() we might set up elements of&lt;br /&gt;
a character's state that are implied but not specified by the values from&lt;br /&gt;
configure(), begin cloning and moving objects, set up call outs, and so on.&lt;br /&gt;
&lt;br /&gt;
The fourth function, only called in the case of cloned objects, is&lt;br /&gt;
clone().  This can conveniently be used to take actions that should only&lt;br /&gt;
be done for cloned instances of a base class, such as maintenance call outs.&lt;br /&gt;
It is not recommended that extensive configuration be done here; doing full&lt;br /&gt;
configuration in the base class allows outside code to predict the likely&lt;br /&gt;
characteristics of clones by examining the base class.&lt;/div&gt;</description>
			<pubDate>Mon, 11 Jun 2007 22:13:51 GMT</pubDate>			<dc:creator>Laine</dc:creator>			<comments>http://wiki.lostsouls.org/Talk:Man_object_creation</comments>		</item>
	</channel>
</rss>