123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267 |
- <!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <html><head><title>Python: obj</title>
- </head><body bgcolor="#f0f0f8">
- <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
- <tr bgcolor="#7799ee">
- <td valign=bottom> <br>
- <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>obj</strong></big></big></font></td
- ><td align=right valign=bottom
- ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br>(built-in)</font></td></tr></table>
- <p><tt>Contains the Python wrapper for game objects. Also contains utilities<br>
- for listing, storing, and generating objects from prototypes.</tt></p>
- <p>
- <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
- <tr bgcolor="#ee77aa">
- <td colspan=3 valign=bottom> <br>
- <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
-
- <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
- <td width="100%"><dl>
- <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
- </font></dt><dd>
- <dl>
- <dt><font face="helvetica, arial"><a href="obj.html#Obj">Obj</a>
- </font></dt></dl>
- </dd>
- </dl>
- <p>
- <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
- <tr bgcolor="#ffc8d8">
- <td colspan=3 valign=bottom> <br>
- <font color="#000000" face="helvetica, arial"><a name="Obj">class <strong>Obj</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
-
- <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
- <td colspan=2><tt><a href="#Obj">Obj</a>/<a href="#Obj">Obj</a> objects<br> </tt></td></tr>
- <tr><td> </td>
- <td width="100%">Methods defined here:<br>
- <dl><dt><a name="Obj-__cmp__"><strong>__cmp__</strong></a>(...)</dt><dd><tt>x.<a href="#Obj-__cmp__">__cmp__</a>(y) <==> cmp(x,y)</tt></dd></dl>
- <dl><dt><a name="Obj-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#Obj-__init__">__init__</a>(...) initializes x; see x.__class__.__doc__ for signature</tt></dd></dl>
- <dl><dt><a name="Obj-attach"><strong>attach</strong></a>(...)</dt><dd><tt><a href="#Obj-attach">attach</a>(trigger)<br>
- <br>
- Attach a trigger to the <a href="__builtin__.html#object">object</a> by key name.</tt></dd></dl>
- <dl><dt><a name="Obj-aux"><strong>aux</strong></a>(...)</dt><dd><tt>Alias for obj.<a href="#Obj">Obj</a>.<a href="#Obj-getAuxiliary">getAuxiliary</a>(name)</tt></dd></dl>
- <dl><dt><a name="Obj-copy"><strong>copy</strong></a>(...)</dt><dd><tt><a href="#Obj-copy">copy</a>()<br>
- <br>
- Returns a copy of the <a href="__builtin__.html#object">object</a>.</tt></dd></dl>
- <dl><dt><a name="Obj-deletevar"><strong>deletevar</strong></a>(...)</dt><dd><tt><a href="#Obj-deletevar">deletevar</a>(name)<br>
- <br>
- Deletes a special variable from an <a href="__builtin__.html#object">object</a> if they have one by the<br>
- given name.</tt></dd></dl>
- <dl><dt><a name="Obj-delvar"><strong>delvar</strong></a>(...)</dt><dd><tt>Alias for obj.<a href="#Obj">Obj</a>.<a href="#Obj-deletevar">deletevar</a>(name)</tt></dd></dl>
- <dl><dt><a name="Obj-detach"><strong>detach</strong></a>(...)</dt><dd><tt><a href="#Obj-detach">detach</a>(trigger)<br>
- <br>
- Detach a trigger from the <a href="__builtin__.html#object">object</a> by key name.</tt></dd></dl>
- <dl><dt><a name="Obj-do_trigs"><strong>do_trigs</strong></a>(...)</dt><dd><tt><a href="#Obj-do_trigs">do_trigs</a>(type, ch=None, obj=None, room=None, exit=None, cmd=None,<br>
- arg=None, opts=None)<br>
- <br>
- Run triggers of the specified type on the <a href="__builtin__.html#object">object</a>. By default, the<br>
- trigger owner is 'me'. Other variables can be specified. The opts<br>
- variable can be a dictionary that maps optional variable names to their<br>
- values.</tt></dd></dl>
- <dl><dt><a name="Obj-edesc"><strong>edesc</strong></a>(...)</dt><dd><tt><a href="#Obj-edesc">edesc</a>(keywords, desc)<br>
- <br>
- Create an extra description for the <a href="__builtin__.html#object">object</a>, accessible via a comma-<br>
- separated list of keywords.</tt></dd></dl>
- <dl><dt><a name="Obj-fromall"><strong>fromall</strong></a>(...)</dt><dd><tt><a href="#Obj-fromall">fromall</a>()<br>
- <br>
- Remove <a href="__builtin__.html#object">object</a> from whichever room, character, or container it is in.</tt></dd></dl>
- <dl><dt><a name="Obj-getAuxiliary"><strong>getAuxiliary</strong></a>(...)</dt><dd><tt><a href="#Obj-getAuxiliary">getAuxiliary</a>(name)<br>
- <br>
- Returns <a href="__builtin__.html#object">object</a>'s auxiliary data of the specified name.</tt></dd></dl>
- <dl><dt><a name="Obj-get_type_data"><strong>get_type_data</strong></a>(...)</dt><dd><tt><a href="#Obj-get_type_data">get_type_data</a>(item_type)<br>
- <br>
- Returns Python item type data if it exists, or None.</tt></dd></dl>
- <dl><dt><a name="Obj-get_types"><strong>get_types</strong></a>(...)</dt><dd><tt><a href="#Obj-get_types">get_types</a>()<br>
- <br>
- Returns a comma-separated list of item types this <a href="__builtin__.html#object">object</a> has.</tt></dd></dl>
- <dl><dt><a name="Obj-getvar"><strong>getvar</strong></a>(...)</dt><dd><tt><a href="#Obj-getvar">getvar</a>(name)<br>
- <br>
- Return value of a special variable. Return 0 if no value has been set.</tt></dd></dl>
- <dl><dt><a name="Obj-hasvar"><strong>hasvar</strong></a>(...)</dt><dd><tt><a href="#Obj-hasvar">hasvar</a>(name)<br>
- <br>
- Return True if <a href="__builtin__.html#object">object</a> has the given special variable. False otherwise.</tt></dd></dl>
- <dl><dt><a name="Obj-isinstance"><strong>isinstance</strong></a>(...)</dt><dd><tt><a href="#Obj-isinstance">isinstance</a>(prototype)<br>
- <br>
- returns whether the <a href="__builtin__.html#object">object</a> inherits from a specified obj prototype.</tt></dd></dl>
- <dl><dt><a name="Obj-istype"><strong>istype</strong></a>(...)</dt><dd><tt><a href="#Obj-istype">istype</a>(item_type)<br>
- <br>
- Returns True or False if the <a href="__builtin__.html#object">object</a> is of the specified item type.</tt></dd></dl>
- <dl><dt><a name="Obj-settype"><strong>settype</strong></a>(...)</dt><dd><tt><a href="#Obj-settype">settype</a>(item_type)<br>
- <br>
- Make an <a href="__builtin__.html#object">object</a> be the specified item type.</tt></dd></dl>
- <dl><dt><a name="Obj-setvar"><strong>setvar</strong></a>(...)</dt><dd><tt><a href="#Obj-setvar">setvar</a>(name, val)<br>
- <br>
- Set value of a special variable for the <a href="__builtin__.html#object">object</a>. Values must be strings<br>
- or numbers. This function is intended to allow scripts and triggers toopen-endedly add variables to objects.</tt></dd></dl>
- <dl><dt><a name="Obj-store"><strong>store</strong></a>(...)</dt><dd><tt><a href="#Obj-store">store</a>()<br>
- <br>
- Return a storage set representing the <a href="__builtin__.html#object">object</a>.</tt></dd></dl>
- <hr>
- Data descriptors defined here:<br>
- <dl><dt><strong>age</strong></dt>
- <dd><tt>Value is the difference between the object's creation time and the<br>
- current system time. Immutable.</tt></dd>
- </dl>
- <dl><dt><strong>birth</strong></dt>
- <dd><tt>Value is the object's creation time (system time). Immutable.</tt></dd>
- </dl>
- <dl><dt><strong>bits</strong></dt>
- <dd><tt>A comma-separated list of bits currently toggled for this object.</tt></dd>
- </dl>
- <dl><dt><strong>carrier</strong></dt>
- <dd><tt>The character whose inventory this object is currently in, or None.</tt></dd>
- </dl>
- <dl><dt><strong>chars</strong></dt>
- <dd><tt>A list of characters currently sitting/riding this object. Immutable.<br>
- See char.Char.furniture for changing a character's furniture.</tt></dd>
- </dl>
- <dl><dt><strong>container</strong></dt>
- <dd><tt>The container this object is currently in, or None.</tt></dd>
- </dl>
- <dl><dt><strong>container_capacity</strong></dt>
- <dd><tt>The maximum amount of weight c container can hold.</tt></dd>
- </dl>
- <dl><dt><strong>container_is_closable</strong></dt>
- <dd><tt>True or False if the container can be closed.</tt></dd>
- </dl>
- <dl><dt><strong>container_is_closed</strong></dt>
- <dd><tt>True or False if the container is closed.</tt></dd>
- </dl>
- <dl><dt><strong>container_is_locked</strong></dt>
- <dd><tt>True or False if the container is locked.</tt></dd>
- </dl>
- <dl><dt><strong>container_key</strong></dt>
- <dd><tt>An object prototype that acts as a key for this container.</tt></dd>
- </dl>
- <dl><dt><strong>container_pick_diff</strong></dt>
- <dd><tt>An integer representing how difficult a container's lock is to pick.</tt></dd>
- </dl>
- <dl><dt><strong>contents</strong></dt>
- <dd><tt>A list of other objects contained within this one. Immutable.<br>
- See obj.Obj.container for changing an object's container.</tt></dd>
- </dl>
- <dl><dt><strong>desc</strong></dt>
- <dd><tt>An object's verbose description e.g., for when it is looked at.</tt></dd>
- </dl>
- <dl><dt><strong>furniture_capacity</strong></dt>
- <dd><tt>The number of characters a furniture object can accomodate.</tt></dd>
- </dl>
- <dl><dt><strong>furniture_type</strong></dt>
- <dd><tt>The type of furniture this is: 'at' or 'on' like e.g., tables vs. couches.</tt></dd>
- </dl>
- <dl><dt><strong>hidden</strong></dt>
- <dd><tt>Integer value representing how hard this object is to see.</tt></dd>
- </dl>
- <dl><dt><strong>keywords</strong></dt>
- <dd><tt>A comma-separated list of keywords for referencing the object.</tt></dd>
- </dl>
- <dl><dt><strong>mdesc</strong></dt>
- <dd><tt>the equivalent of mname, for room descriptions.</tt></dd>
- </dl>
- <dl><dt><strong>mname</strong></dt>
- <dd><tt>The object's name for describing packs, e.g.,<br>
- a stack of 12 linen towels. The number should be replaced by %d, or<br>
- not included.</tt></dd>
- </dl>
- <dl><dt><strong>name</strong></dt>
- <dd><tt>The object's name e.g., a longsword</tt></dd>
- </dl>
- <dl><dt><strong>objs</strong></dt>
- <dd><tt>Alias for obj.Obj.contents</tt></dd>
- </dl>
- <dl><dt><strong>portal_dest</strong></dt>
- <dd><tt>A string key specifying the destination of the portal. Can be set by<br>
- a string or the actual room.</tt></dd>
- </dl>
- <dl><dt><strong>portal_enter_mssg</strong></dt>
- <dd><tt>The message shown to the desination room when a character enters portal.</tt></dd>
- </dl>
- <dl><dt><strong>portal_leave_mssg</strong></dt>
- <dd><tt>The message shown to a room after a character leaves it via a portal.</tt></dd>
- </dl>
- <dl><dt><strong>prototypes</strong></dt>
- <dd><tt>A comma-separated list of prototypes this object inherits from. Immutable</tt></dd>
- </dl>
- <dl><dt><strong>rdesc</strong></dt>
- <dd><tt>The object's description when seen in a room, e.g.,<br>
- a longsword is here, gleaming in the sun.</tt></dd>
- </dl>
- <dl><dt><strong>room</strong></dt>
- <dd><tt>The room this object is current in, or None.</tt></dd>
- </dl>
- <dl><dt><strong>uid</strong></dt>
- <dd><tt>The object's unique identification number. Immutable.</tt></dd>
- </dl>
- <dl><dt><strong>wearer</strong></dt>
- <dd><tt>The character who is currently wearing this object, or None.</tt></dd>
- </dl>
- <dl><dt><strong>weight</strong></dt>
- <dd><tt>The object's weight (plus contents). When setting a new value, <br>
- sets raw weight (minus contents).</tt></dd>
- </dl>
- <dl><dt><strong>weight_raw</strong></dt>
- <dd><tt>The object's weight (minus contents)</tt></dd>
- </dl>
- <dl><dt><strong>worn_locs</strong></dt>
- <dd><tt>The position names this worn type must be equipped to. Immutable.</tt></dd>
- </dl>
- <dl><dt><strong>worn_type</strong></dt>
- <dd><tt>The type of worn item this is.</tt></dd>
- </dl>
- <hr>
- Data and other attributes defined here:<br>
- <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object at 0x6f500><dd><tt>T.<a href="#Obj-__new__">__new__</a>(S, ...) -> a new <a href="__builtin__.html#object">object</a> with type S, a subtype of T</tt></dl>
- </td></tr></table></td></tr></table><p>
- <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
- <tr bgcolor="#eeaa77">
- <td colspan=3 valign=bottom> <br>
- <font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
-
- <tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
- <td width="100%"><dl><dt><a name="-count_objs"><strong>count_objs</strong></a>(...)</dt><dd><tt><a href="#-count_objs">count_objs</a>(keyword, loc = None)<br>
- <br>
- count how many occurences of an <a href="__builtin__.html#object">object</a> with the specified keyword, uid,<br>
- or prototype exist at a location. If loc is None, search the entire mud.<br>
- Loc can be a room, character, or container <a href="__builtin__.html#object">object</a>.</tt></dd></dl>
- <dl><dt><a name="-find_obj"><strong>find_obj</strong></a>(...)</dt><dd><tt>function has been deprecated. Entrypoint for generic_find().<br>
- Use mud.parse_args instead.</tt></dd></dl>
- <dl><dt><a name="-find_obj_key"><strong>find_obj_key</strong></a>(...)</dt><dd><tt>function has been deprecated. Entrypoint for generic_find().<br>
- Use mud.parse_args instead.</tt></dd></dl>
- <dl><dt><a name="-load_obj"><strong>load_obj</strong></a>(...)</dt><dd><tt><a href="#-load_obj">load_obj</a>(prototype, where=None, equip_to='')<br>
- <br>
- Generate a new <a href="__builtin__.html#object">object</a> from the specified prototype. Add it to where.<br>
- Where can be a room, character, or container. If where is a character,<br>
- add the <a href="__builtin__.html#object">object</a> to the character's inventory unless a comma-separated<br>
- list of bodypart name of positions is specified. Return the created <a href="__builtin__.html#object">object</a>.</tt></dd></dl>
- <dl><dt><a name="-obj_list"><strong>obj_list</strong></a>(...)</dt><dd><tt><a href="#-obj_list">obj_list</a>()<br>
- <br>
- Return a list containing every <a href="__builtin__.html#object">object</a> in the game.</tt></dd></dl>
- <dl><dt><a name="-read"><strong>read</strong></a>(...)</dt><dd><tt><a href="#-read">read</a>(storage_set)<br>
- <br>
- Read and return an <a href="__builtin__.html#object">object</a> from a storage set.</tt></dd></dl>
- </td></tr></table>
- </body></html>
|