<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://datoolset.net/mw/index.php?action=history&amp;feed=atom&amp;title=Usable_campaign_items_tutorial</id>
		<title>Usable campaign items tutorial - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://datoolset.net/mw/index.php?action=history&amp;feed=atom&amp;title=Usable_campaign_items_tutorial"/>
		<link rel="alternate" type="text/html" href="https://datoolset.net/mw/index.php?title=Usable_campaign_items_tutorial&amp;action=history"/>
		<updated>2026-08-12T23:27:11Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.25.6</generator>

	<entry>
		<id>https://datoolset.net/mw/index.php?title=Usable_campaign_items_tutorial&amp;diff=18299&amp;oldid=prev</id>
		<title>Sunjammer: moved Tutorial: Usable campaign items to Usable campaign items tutorial</title>
		<link rel="alternate" type="text/html" href="https://datoolset.net/mw/index.php?title=Usable_campaign_items_tutorial&amp;diff=18299&amp;oldid=prev"/>
				<updated>2012-02-23T13:09:10Z</updated>
		
		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/mw/index.php?title=Tutorial:_Usable_campaign_items&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Tutorial: Usable campaign items (page does not exist)&quot;&gt;Tutorial: Usable campaign items&lt;/a&gt; to &lt;a href=&quot;/wiki/Usable_campaign_items_tutorial&quot; title=&quot;Usable campaign items tutorial&quot;&gt;Usable campaign items tutorial&lt;/a&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 13:09, 23 February 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan='2' style='text-align: center;'&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Sunjammer</name></author>	</entry>

	<entry>
		<id>https://datoolset.net/mw/index.php?title=Usable_campaign_items_tutorial&amp;diff=15843&amp;oldid=prev</id>
		<title>Proleric1: /* Merchants */</title>
		<link rel="alternate" type="text/html" href="https://datoolset.net/mw/index.php?title=Usable_campaign_items_tutorial&amp;diff=15843&amp;oldid=prev"/>
				<updated>2011-02-19T10:13:37Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Merchants&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 10:13, 19 February 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L33&quot; &gt;Line 33:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 33:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We probably don't want to allow the player to sell campaign items.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We probably don't want to allow the player to sell campaign items.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Here's one solution&lt;/del&gt;: a custom version of the &amp;quot;open store&amp;quot; plot script &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;which stores &lt;/del&gt;the campaign items in a temporary placeable.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;NOTE&lt;/ins&gt;: &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;The solution adopted here assumes that event handling is not possible while a merchant is open. It has recently been reported that ToggleGamePause(FALSE) enables event handling, so there might be an easier way.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Here, &lt;/ins&gt;a custom version of the &amp;quot;open store&amp;quot; plot script &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;is used to store &lt;/ins&gt;the campaign items in a temporary placeable.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Returning the items to the player is delayed until the next AI update, which happens after the store closes (there's no explicit event for this).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Returning the items to the player is delayed until the next AI update, which happens after the store closes (there's no explicit event for this).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Proleric1</name></author>	</entry>

	<entry>
		<id>https://datoolset.net/mw/index.php?title=Usable_campaign_items_tutorial&amp;diff=15197&amp;oldid=prev</id>
		<title>Proleric1: /* Lost Items */</title>
		<link rel="alternate" type="text/html" href="https://datoolset.net/mw/index.php?title=Usable_campaign_items_tutorial&amp;diff=15197&amp;oldid=prev"/>
				<updated>2010-12-09T06:39:21Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Lost Items&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 06:39, 9 December 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L127&quot; &gt;Line 127:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 127:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If your campaign allows items to be lost by other means (such as a camp storage chest), you may want to set the ITEM_SEND_LOST_EVENT variable on the item. This can be intercepted in the EVENT_TYPE_CAMPAIGN_ITEM_LOST module event to control what happens.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If your campaign allows items to be lost by other means (such as a camp storage chest), you may want to set the ITEM_SEND_LOST_EVENT variable on the item. This can be intercepted in the EVENT_TYPE_CAMPAIGN_ITEM_LOST module event to control what happens.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== Dismissed Followers ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;If your campaign allows the player to dismiss followers without being able to get them back easily, you might want to check if the follower being fired has a campaign item equipped. Either notify the player, or move it to the shared inventory space automatically.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Proleric1</name></author>	</entry>

	<entry>
		<id>https://datoolset.net/mw/index.php?title=Usable_campaign_items_tutorial&amp;diff=15190&amp;oldid=prev</id>
		<title>Proleric1: /* Merchants */</title>
		<link rel="alternate" type="text/html" href="https://datoolset.net/mw/index.php?title=Usable_campaign_items_tutorial&amp;diff=15190&amp;oldid=prev"/>
				<updated>2010-12-08T17:15:57Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Merchants&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 17:15, 8 December 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L97&quot; &gt;Line 97:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 97:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#include &amp;quot;wrappers_h&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#include &amp;quot;wrappers_h&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#include &amp;quot;plot_h&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#include &amp;quot;plot_h&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;#include &amp;quot;coc_h&amp;quot;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;void main()&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;void main()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Proleric1</name></author>	</entry>

	<entry>
		<id>https://datoolset.net/mw/index.php?title=Usable_campaign_items_tutorial&amp;diff=15187&amp;oldid=prev</id>
		<title>Proleric1: Created page with 'This is how to make a usable item (such as a sword or a helmet) that is also vital to the plot.  The problem with regular Plot items is that they're really just tokens that can't...'</title>
		<link rel="alternate" type="text/html" href="https://datoolset.net/mw/index.php?title=Usable_campaign_items_tutorial&amp;diff=15187&amp;oldid=prev"/>
				<updated>2010-12-08T17:12:20Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#039;This is how to make a usable item (such as a sword or a helmet) that is also vital to the plot.  The problem with regular Plot items is that they&amp;#039;re really just tokens that can&amp;#039;t...&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This is how to make a usable item (such as a sword or a helmet) that is also vital to the plot.&lt;br /&gt;
&lt;br /&gt;
The problem with regular Plot items is that they're really just tokens that can't be used for anything.&lt;br /&gt;
&lt;br /&gt;
== Item Template ==&lt;br /&gt;
&lt;br /&gt;
Set the item variable ITEM_SEND_ACQUIRED_EVENT to 1.&lt;br /&gt;
&lt;br /&gt;
== Module Script ==&lt;br /&gt;
&lt;br /&gt;
The item variable we just set will trigger a module event when the player acquires the item.&lt;br /&gt;
&lt;br /&gt;
At minimum, we probably want to stop the player destroying the item, so the module event script will include &lt;br /&gt;
&amp;lt;dascript&amp;gt;&lt;br /&gt;
         case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:&lt;br /&gt;
         {&lt;br /&gt;
            object oAcquirer     = GetEventCreator(ev);&lt;br /&gt;
            object oItem         = GetEventObject(ev, 0);&lt;br /&gt;
            string sItem         = GetTag(oItem);&lt;br /&gt;
&lt;br /&gt;
            // Make item indestructible&lt;br /&gt;
&lt;br /&gt;
            SetItemIndestructible(oItem, TRUE);&lt;br /&gt;
&lt;br /&gt;
            // Set plot flags if required (sItem tells us which item has been acquired)&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
         }&lt;br /&gt;
&amp;lt;/dascript&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Merchants ==&lt;br /&gt;
&lt;br /&gt;
We probably don't want to allow the player to sell campaign items.&lt;br /&gt;
&lt;br /&gt;
Here's one solution: a custom version of the &amp;quot;open store&amp;quot; plot script which stores the campaign items in a temporary placeable.&lt;br /&gt;
&lt;br /&gt;
Returning the items to the player is delayed until the next AI update, which happens after the store closes (there's no explicit event for this).&lt;br /&gt;
&amp;lt;dascript&amp;gt;&lt;br /&gt;
          case COC_GENERAL_OPEN_STORE:&lt;br /&gt;
            {&lt;br /&gt;
              object    oPlayer = GetHero();&lt;br /&gt;
              object    oStore  = GetObjectByTag(&amp;quot;store_&amp;quot; + GetTag(oConversationOwner));&lt;br /&gt;
              object    oBin;&lt;br /&gt;
              object [] oItemTable;&lt;br /&gt;
              object    oItem;&lt;br /&gt;
              int       nItemCount;&lt;br /&gt;
              int       nGetItemsOption = GET_ITEMS_OPTION_BACKPACK;&lt;br /&gt;
              int       i               = -1;&lt;br /&gt;
&lt;br /&gt;
              if (!IsObjectValid(oStore))&lt;br /&gt;
                {&lt;br /&gt;
                  Log_Trace(LOG_CHANNEL_SYSTEMS, GetCurrentScriptName(), &amp;quot;INVALID STORE OBJECT&amp;quot;);&lt;br /&gt;
                  break;&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
              // Hide campaign items (so they can't be sold).&lt;br /&gt;
&lt;br /&gt;
              oBin = CreateObject(OBJECT_TYPE_PLACEABLE, R&amp;quot;cocip_bin.utp&amp;quot;, GetLocation(GetHero()));  // Almost any placeable template will do&lt;br /&gt;
              SetTag(oBin, &amp;quot;cocip_campaign_items&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
              oItemTable = GetItemsInInventory(oPlayer, nGetItemsOption);&lt;br /&gt;
              nItemCount = GetArraySize(oItemTable);&lt;br /&gt;
&lt;br /&gt;
              while (++i &amp;lt; nItemCount)&lt;br /&gt;
                {&lt;br /&gt;
                  oItem = oItemTable[i];&lt;br /&gt;
&lt;br /&gt;
                  if (GetLocalInt(oItem, ITEM_SEND_ACQUIRED_EVENT))                        &lt;br /&gt;
                    MoveItem(oPlayer, oBin, oItem);&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
              // Schedule an event to return campaign items to the player at the next AI update&lt;br /&gt;
&lt;br /&gt;
              DelayEvent(0.0, oPlayer, Event(EVENT_TYPE_INVALID), &amp;quot;coc_restore_campaign_items&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
              // Open store&lt;br /&gt;
&lt;br /&gt;
              ScaleStoreItems(oStore);&lt;br /&gt;
              OpenStore(oStore);&lt;br /&gt;
              break;&lt;br /&gt;
            }&lt;br /&gt;
&amp;lt;/dascript&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The delayed script coc_restore_campaign_items looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dascript&amp;gt;&lt;br /&gt;
// Restore campaign items to the player&lt;br /&gt;
//&lt;br /&gt;
// Campaign items were removed from inventory while the player was trading with a merchant.&lt;br /&gt;
// Now they are returned.&lt;br /&gt;
//&lt;br /&gt;
// Proleric 08-Dec-2010&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;log_h&amp;quot;&lt;br /&gt;
#include &amp;quot;utility_h&amp;quot;&lt;br /&gt;
#include &amp;quot;wrappers_h&amp;quot;&lt;br /&gt;
#include &amp;quot;plot_h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;coc_h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
  object    oPlayer = GetHero();&lt;br /&gt;
  object    oBin    = GetObjectByTag(&amp;quot;cocip_campaign_items&amp;quot;);&lt;br /&gt;
  object [] oItemTable;&lt;br /&gt;
  object    oItem;&lt;br /&gt;
  int       nItemCount;&lt;br /&gt;
  int       nGetItemsOption = GET_ITEMS_OPTION_BACKPACK;&lt;br /&gt;
  int       i               = -1;&lt;br /&gt;
&lt;br /&gt;
  if (IsObjectValid(oBin))&lt;br /&gt;
    {&lt;br /&gt;
      oItemTable = GetItemsInInventory(oBin, nGetItemsOption);&lt;br /&gt;
      nItemCount = GetArraySize(oItemTable);&lt;br /&gt;
&lt;br /&gt;
      while (++i &amp;lt; nItemCount)&lt;br /&gt;
        {&lt;br /&gt;
          oItem = oItemTable[i];&lt;br /&gt;
          MoveItem(oBin, oPlayer, oItem);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
      WR_DestroyObject(oBin);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/dascript&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Lost Items ==&lt;br /&gt;
&lt;br /&gt;
If your campaign allows items to be lost by other means (such as a camp storage chest), you may want to set the ITEM_SEND_LOST_EVENT variable on the item. This can be intercepted in the EVENT_TYPE_CAMPAIGN_ITEM_LOST module event to control what happens.&lt;/div&gt;</summary>
		<author><name>Proleric1</name></author>	</entry>

	</feed>