<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://www.datoolset.net/mw/index.php?action=history&amp;feed=atom&amp;title=User%3ASunjammer%2FItems_with_codex_entries_tutorial_%28draft%29</id>
		<title>User:Sunjammer/Items with codex entries tutorial (draft) - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://www.datoolset.net/mw/index.php?action=history&amp;feed=atom&amp;title=User%3ASunjammer%2FItems_with_codex_entries_tutorial_%28draft%29"/>
		<link rel="alternate" type="text/html" href="https://www.datoolset.net/mw/index.php?title=User:Sunjammer/Items_with_codex_entries_tutorial_(draft)&amp;action=history"/>
		<updated>2026-10-11T08:08:09Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.25.6</generator>

	<entry>
		<id>https://www.datoolset.net/mw/index.php?title=User:Sunjammer/Items_with_codex_entries_tutorial_(draft)&amp;diff=19949&amp;oldid=prev</id>
		<title>Sunjammer: Editing</title>
		<link rel="alternate" type="text/html" href="https://www.datoolset.net/mw/index.php?title=User:Sunjammer/Items_with_codex_entries_tutorial_(draft)&amp;diff=19949&amp;oldid=prev"/>
				<updated>2020-04-27T16:37:09Z</updated>
		
		<summary type="html">&lt;p&gt;Editing&lt;/p&gt;
&lt;a href=&quot;https://www.datoolset.net/mw/index.php?title=User:Sunjammer/Items_with_codex_entries_tutorial_(draft)&amp;amp;diff=19949&amp;amp;oldid=19946&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Sunjammer</name></author>	</entry>

	<entry>
		<id>https://www.datoolset.net/mw/index.php?title=User:Sunjammer/Items_with_codex_entries_tutorial_(draft)&amp;diff=19946&amp;oldid=prev</id>
		<title>Sunjammer at 00:19, 27 April 2020</title>
		<link rel="alternate" type="text/html" href="https://www.datoolset.net/mw/index.php?title=User:Sunjammer/Items_with_codex_entries_tutorial_(draft)&amp;diff=19946&amp;oldid=prev"/>
				<updated>2020-04-27T00:19:59Z</updated>
		
		<summary type="html">&lt;p&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 00:19, 27 April 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L192&quot; &gt;Line 192:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 192:&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;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; object oItem = GetEventObject(ev, 0);&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;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; object oItem = GetEventObject(ev, 0);&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;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; string sItem = GetTag(oItem);&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;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; string sItem = GetTag(oItem);&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;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; // Debug.&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;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; PrintToLog(&amp;quot;------&amp;gt; MODULE CAMPAIGN ITEM ACQUIRED: &amp;quot; + sItem);&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;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; // Does the item have a codex flag? We can ignore any items with default value (-1) as&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;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; // Does the item have a codex flag? We can ignore any items with default value (-1) as&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sunjammer</name></author>	</entry>

	<entry>
		<id>https://www.datoolset.net/mw/index.php?title=User:Sunjammer/Items_with_codex_entries_tutorial_(draft)&amp;diff=19945&amp;oldid=prev</id>
		<title>Sunjammer: Added Categories</title>
		<link rel="alternate" type="text/html" href="https://www.datoolset.net/mw/index.php?title=User:Sunjammer/Items_with_codex_entries_tutorial_(draft)&amp;diff=19945&amp;oldid=prev"/>
				<updated>2020-04-27T00:17:33Z</updated>
		
		<summary type="html">&lt;p&gt;Added Categories&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 00:17, 27 April 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L230&quot; &gt;Line 230:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 230:&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;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; }&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;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; }&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;&amp;lt;/dascript&amp;gt;&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;&amp;lt;/dascript&amp;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;== See also ==&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;* TODO&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;[[Category:Items]]&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;[[Category:Tutorials]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sunjammer</name></author>	</entry>

	<entry>
		<id>https://www.datoolset.net/mw/index.php?title=User:Sunjammer/Items_with_codex_entries_tutorial_(draft)&amp;diff=19944&amp;oldid=prev</id>
		<title>Sunjammer: Created</title>
		<link rel="alternate" type="text/html" href="https://www.datoolset.net/mw/index.php?title=User:Sunjammer/Items_with_codex_entries_tutorial_(draft)&amp;diff=19944&amp;oldid=prev"/>
				<updated>2020-04-27T00:13:35Z</updated>
		
		<summary type="html">&lt;p&gt;Created&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This tutorial illustrates how to create [[items with codex entries tutorial|items with codex entries]] for both a new standalone module or an extension to the [[Single Player Campaign]]. Additionally it will show you how to destroy, or avoid destroying, the item once the codex entry has been created.&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes, you are familiar with creating a standalone module or an extension to the Single Player Campaign and is only focused on the steps and explaining the considerations surrounding creating items with codex entries.&lt;br /&gt;
&lt;br /&gt;
This process shares some similarities with, but is more complex than, creating placeables with codex entries.&lt;br /&gt;
&lt;br /&gt;
* Create '''new''' a plot resource (because [[Bug:_Duplicating_a_plot_duplicates_the_uneditable_GUID|duplicating a plot duplicates the uneditable GUID]])&lt;br /&gt;
** Set the plot type to one with a &amp;quot;Codex - &amp;quot; prefix&lt;br /&gt;
** Add a single Main Flag: remember the number (usually 0 as it is the only flag)&lt;br /&gt;
* Create a placeable and place it in an area&lt;br /&gt;
* Open the [[Placeable#Variables|placeable's variables]]&lt;br /&gt;
* Set PLC_CODEX_PLOT to the name of the plot resource&lt;br /&gt;
* Set PLC_CODEX_FLAG to the number of the plot flag&lt;br /&gt;
&lt;br /&gt;
When the Player clicks on the placeable the following script runs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dascript&amp;gt;&lt;br /&gt;
void Placeable_ShowCodexEntry(object oPlc)&lt;br /&gt;
{&lt;br /&gt;
    string sCodexPlot = GetLocalString(oPlc, PLC_CODEX_PLOT);&lt;br /&gt;
    int nCodexFlag    = GetLocalInt(oPlc, PLC_CODEX_FLAG);&lt;br /&gt;
&lt;br /&gt;
    if (sCodexPlot != &amp;quot;&amp;quot; &amp;amp;&amp;amp; nCodexFlag &amp;gt;= 0)&lt;br /&gt;
    {&lt;br /&gt;
        string sSummary = GetPlotSummary(sCodexPlot, nCodexFlag);&lt;br /&gt;
&lt;br /&gt;
        // :&lt;br /&gt;
&lt;br /&gt;
        if (!WR_GetPlotFlag(sCodexPlot, nCodexFlag))&lt;br /&gt;
        {&lt;br /&gt;
            WR_SetPlotFlag(sCodexPlot, nCodexFlag, TRUE, TRUE);&lt;br /&gt;
            RewardXPParty(XP_CODEX, XP_TYPE_CODEX, OBJECT_INVALID, GetHero());&lt;br /&gt;
        }&lt;br /&gt;
        UI_DisplayCodexMessage(oPlc, sSummary);&lt;br /&gt;
        SetObjectInteractive(oPlc, FALSE);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/dascript&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
&lt;br /&gt;
The goal of this tutorial is to create two items that with codex entries. The first, a book, will be automatically removed from the Player's inventory and destroyed. The second, a longsword, will remain in the Player's inventory so they can use it.&lt;br /&gt;
&lt;br /&gt;
== Set up ==&lt;br /&gt;
&lt;br /&gt;
The the initial steps are the same regardless of whether you are creating a standalone module or an extension to the Single Player Campaign.&lt;br /&gt;
&lt;br /&gt;
* Create the book item and set it's tag to something unique, e.g. xx_codex_itm_book&lt;br /&gt;
* Create a plot&lt;br /&gt;
* Create the longsword item and set it's tag to something unique, e.g. xx_codex_itm_book&lt;br /&gt;
*[[Item#Variables|item's variables]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Standalone module ==&lt;br /&gt;
&lt;br /&gt;
=== Considerations ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dascript&amp;gt;&lt;br /&gt;
    if(!nEventHandled)&lt;br /&gt;
    {&lt;br /&gt;
        HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/dascript&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- why we can't fall through &lt;br /&gt;
&lt;br /&gt;
module_core:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dascript&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:&lt;br /&gt;
        {&lt;br /&gt;
&lt;br /&gt;
            :&lt;br /&gt;
&lt;br /&gt;
            int nCodexItem = GetLocalInt(oItem, ITEM_CODEX_FLAG);&lt;br /&gt;
            if (nCodexItem &amp;gt; -1 &amp;amp;&amp;amp; IsFollower(oAcquirer))&lt;br /&gt;
            {&lt;br /&gt;
&lt;br /&gt;
                WR_SetPlotFlag(PLT_TUT_CODEX_ITEM, TUT_CODEX_ITEM, TRUE);&lt;br /&gt;
                Log_Trace(LOG_CHANNEL_SYSTEMS, GetCurrentScriptName(), &amp;quot;Got a codex item: &amp;quot; + GetTag(oItem));&lt;br /&gt;
                WR_SetPlotFlag(GetTag(oItem), nCodexItem, TRUE, TRUE);&lt;br /&gt;
                WR_DestroyObject(oItem);&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            :&lt;br /&gt;
&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/dascript&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dascript&amp;gt;&lt;br /&gt;
        case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:&lt;br /&gt;
        {&lt;br /&gt;
            // Decompose event.&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;
            // Does the item have a codex flag? We can ignore any items with default value (-1) as&lt;br /&gt;
            // plot flags have values of 0 and above.&lt;br /&gt;
            int nFlag = GetLocalInt(oItem, ITEM_CODEX_FLAG);&lt;br /&gt;
            if(nFlag &amp;gt; -1)&lt;br /&gt;
            {&lt;br /&gt;
                // Was the item acquired by a party member? We ignore any items acquired by someone&lt;br /&gt;
                // other than a party member.&lt;br /&gt;
                if(IsFollower(oAcquirer))&lt;br /&gt;
                {&lt;br /&gt;
                    // Is the item one of ours? Other items can satify the first two conditions but&lt;br /&gt;
                    // will be handled by their author's code therefore we must ensure it is ours.&lt;br /&gt;
                    if(sItem == &amp;quot;xx_codex_itm_longsword&amp;quot;)&lt;br /&gt;
                    {&lt;br /&gt;
                        // Trigger the standard codex tutorial (it only shows once).&lt;br /&gt;
                        // NOTE: requires #include &amp;quot;plt_tut_codex_item&amp;quot; directive.&lt;br /&gt;
                        WR_SetPlotFlag(PLT_TUT_CODEX_ITEM, TUT_CODEX_ITEM, TRUE);&lt;br /&gt;
&lt;br /&gt;
                        // Trigger the codex entry.&lt;br /&gt;
                        // NOTE: unlike Placeables there is no equivalent of the PLC_CODEX_PLOT&lt;br /&gt;
                        // variable therefore we name the plot resource using the item's tag.&lt;br /&gt;
                        WR_SetPlotFlag(sItem, nFlag, TRUE, TRUE);&lt;br /&gt;
&lt;br /&gt;
                        // Raise the &amp;quot;event handled&amp;quot; flag to prevent the default script running for&lt;br /&gt;
                        // this item and event.&lt;br /&gt;
                        nEventHandled = TRUE;&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/dascript&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Single Player Campaign ==&lt;br /&gt;
&lt;br /&gt;
Normally for a module extending the Single Player Campaign we don't need&lt;br /&gt;
&lt;br /&gt;
=== Considerations ===&lt;br /&gt;
&lt;br /&gt;
sp_module:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dascript&amp;gt;&lt;br /&gt;
        case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:&lt;br /&gt;
        {&lt;br /&gt;
            HandleEvent(ev, RESOURCE_SCRIPT_MODULE_ITEM_ACQUIRED);&lt;br /&gt;
            bEventHandled = TRUE;&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/dascript&amp;gt;&lt;br /&gt;
&lt;br /&gt;
sp_module_item_acq:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dascript&amp;gt;&lt;br /&gt;
        case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:&lt;br /&gt;
        {&lt;br /&gt;
            :&lt;br /&gt;
&lt;br /&gt;
            else if(sItemTag == &amp;quot;gen_im_acc_rng_bld&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                WR_SetPlotFlag(PLT_COD_ITM_BLOOD_RING, COD_ITM_BLOOD_RING, TRUE, TRUE);&lt;br /&gt;
            }&lt;br /&gt;
            else if(sItemTag == &amp;quot;gen_im_wep_rng_lbw_sun&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                WR_SetPlotFlag(PLT_COD_ITM_BOW_GOLDEN_SUN, COD_ITM_BOW_GOLDEN_SUN, TRUE, TRUE);&lt;br /&gt;
            }&lt;br /&gt;
            else if(sItemTag == &amp;quot;gen_im_acc_amu_am6&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                WR_SetPlotFlag(PLT_COD_ITM_LIFE_DRINKER, COD_ITM_LIFE_DRINKER, TRUE, TRUE);&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            :&lt;br /&gt;
 &lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/dascript&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There's no catch all. There's no fall through. So if we're extending the Single Player Campaign we're on our own!&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dascript&amp;gt;&lt;br /&gt;
        case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:&lt;br /&gt;
        {&lt;br /&gt;
            // Decompose event.&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;
            // Debug.&lt;br /&gt;
            PrintToLog(&amp;quot;------&amp;gt; MODULE CAMPAIGN ITEM ACQUIRED: &amp;quot; + sItem);&lt;br /&gt;
&lt;br /&gt;
            // Does the item have a codex flag? We can ignore any items with default value (-1) as&lt;br /&gt;
            // plot flags have values of 0 and above.&lt;br /&gt;
            int nFlag = GetLocalInt(oItem, ITEM_CODEX_FLAG);&lt;br /&gt;
            if(nFlag &amp;gt; -1)&lt;br /&gt;
            {&lt;br /&gt;
                // Was the item acquired by a party member? We ignore any items acquired by someone&lt;br /&gt;
                // other than a party member.&lt;br /&gt;
                if(IsFollower(oAcquirer))&lt;br /&gt;
                {&lt;br /&gt;
                    // Is the item one of ours? Other items can satify the first two conditions but&lt;br /&gt;
                    // will be handled by their author's code therefore we must ensure it is ours.&lt;br /&gt;
                    if(sItem == &amp;quot;xx_codex_itm_book&amp;quot; || sItem == &amp;quot;xx_codex_itm_longsword&amp;quot;)&lt;br /&gt;
                    {&lt;br /&gt;
                        // Trigger the standard codex tutorial (it only shows once).&lt;br /&gt;
                        // NOTE: requires #include &amp;quot;plt_tut_codex_item&amp;quot; directive.&lt;br /&gt;
                        WR_SetPlotFlag(PLT_TUT_CODEX_ITEM, TUT_CODEX_ITEM, TRUE);&lt;br /&gt;
&lt;br /&gt;
                        // Trigger the codex entry.&lt;br /&gt;
                        // NOTE: unlike Placeables there is no equivalent of the PLC_CODEX_PLOT&lt;br /&gt;
                        // variable therefore we name the plot resource using the item's tag.&lt;br /&gt;
                        WR_SetPlotFlag(sItem, nFlag, TRUE, TRUE);&lt;br /&gt;
                        &lt;br /&gt;
                        // Do we want the item to persist? If not then we can delete it here.&lt;br /&gt;
                        if(sItem == &amp;quot;xx_codex_itm_book&amp;quot;) &lt;br /&gt;
                        {&lt;br /&gt;
                            WR_DestroyObject(oItem);&lt;br /&gt;
                        }&lt;br /&gt;
&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/dascript&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sunjammer</name></author>	</entry>

	</feed>