<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
		<id>https://bolshevik.mrangel.info/index.php?action=history&amp;feed=atom&amp;title=AddToInventory</id>
		<title>AddToInventory - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://bolshevik.mrangel.info/index.php?action=history&amp;feed=atom&amp;title=AddToInventory"/>
		<link rel="alternate" type="text/html" href="https://bolshevik.mrangel.info/index.php?title=AddToInventory&amp;action=history"/>
		<updated>2026-05-07T12:33:41Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://bolshevik.mrangel.info/index.php?title=AddToInventory&amp;diff=35&amp;oldid=prev</id>
		<title>Angel: Created page with &quot;This is a piece of code I created in response to a query on the [http://textadventures.co.uk/forum/quest/topic/crtbw5odik6sayxpz5hcha/a-question-another-not-so-simple-question...&quot;</title>
		<link rel="alternate" type="text/html" href="https://bolshevik.mrangel.info/index.php?title=AddToInventory&amp;diff=35&amp;oldid=prev"/>
				<updated>2019-12-10T13:24:32Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;This is a piece of code I created in response to a query on the [http://textadventures.co.uk/forum/quest/topic/crtbw5odik6sayxpz5hcha/a-question-another-not-so-simple-question...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This is a piece of code I created in response to a query on the [http://textadventures.co.uk/forum/quest/topic/crtbw5odik6sayxpz5hcha/a-question-another-not-so-simple-question-and-a-weird-problem-with-the-map Quest forum], but for some unknown reason the forum's adult-content filter wouldn't allow me to post it. So here it is!&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;function name=&amp;quot;AddToInventory&amp;quot; parameters=&amp;quot;object&amp;quot; type=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;
    message = null&lt;br /&gt;
    foreach (bag, FilterByType (ScopeInventory (), &amp;quot;inventorybag&amp;quot;)) {&lt;br /&gt;
      message = &amp;quot;&amp;quot;&lt;br /&gt;
      if (object.parent = bag) {&lt;br /&gt;
        return (&amp;quot;It is already in your &amp;quot;+GetDisplayName (bag)+&amp;quot;.&amp;quot;)&lt;br /&gt;
      }&lt;br /&gt;
      if (HasInt (bag, &amp;quot;maxvolume&amp;quot;)) {&lt;br /&gt;
        if (GetVolume(object, true) + GetVolume(bag, false) &amp;gt; bag.maxvolume) {&lt;br /&gt;
          if (HasString(bag, &amp;quot;containerfullmessage&amp;quot;)) {&lt;br /&gt;
            message = bag.containerfullmessage&lt;br /&gt;
          }&lt;br /&gt;
          else {&lt;br /&gt;
            message = DynamicTemplate(&amp;quot;ContainerFull&amp;quot;, bag)&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
  &lt;br /&gt;
      if (HasInt (bag, &amp;quot;maxobjects&amp;quot;)) {&lt;br /&gt;
        if (ListCount (GetDirectChildren (bag)) &amp;gt;= bag.maxobjects and bag.maxobjects &amp;gt; 0) {&lt;br /&gt;
         if (HasString(bag, &amp;quot;containermaxobjects&amp;quot;)) {&lt;br /&gt;
            message = bag.containermaxobjects&lt;br /&gt;
          }&lt;br /&gt;
          else {&lt;br /&gt;
            message = DynamicTemplate(&amp;quot;MaxObjectsInContainer&amp;quot;, bag)&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
      if (message = &amp;quot;&amp;quot;) {&lt;br /&gt;
        object.parent = bag&lt;br /&gt;
        return (&amp;quot;You put &amp;quot; + object.article + &amp;quot; in your &amp;quot; + GetDisplayName(bag) + &amp;quot;.&amp;quot;)&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    if (message = null) {&lt;br /&gt;
      // This is what will happen if the player isn't carrying a bag/satchel.&lt;br /&gt;
      // Depending on your game setup, this might never happen;&lt;br /&gt;
      // or you might allow the player to carry 2 objects in their hands.&lt;br /&gt;
      object.parent = game.pov&lt;br /&gt;
      return (&amp;quot;You pick it up.&amp;quot;)&lt;br /&gt;
    }&lt;br /&gt;
    else {&lt;br /&gt;
      return (message)&lt;br /&gt;
    }&lt;br /&gt;
  &amp;lt;/function&amp;gt;&lt;/div&gt;</summary>
		<author><name>Angel</name></author>	</entry>

	</feed>