<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.heroesofhammerwatch.com/index.php?action=history&amp;feed=atom&amp;title=Custom_shop</id>
	<title>Custom shop - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.heroesofhammerwatch.com/index.php?action=history&amp;feed=atom&amp;title=Custom_shop"/>
	<link rel="alternate" type="text/html" href="https://wiki.heroesofhammerwatch.com/index.php?title=Custom_shop&amp;action=history"/>
	<updated>2026-08-09T18:25:27Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://wiki.heroesofhammerwatch.com/index.php?title=Custom_shop&amp;diff=1741&amp;oldid=prev</id>
		<title>Miss at 16:50, 28 March 2019</title>
		<link rel="alternate" type="text/html" href="https://wiki.heroesofhammerwatch.com/index.php?title=Custom_shop&amp;diff=1741&amp;oldid=prev"/>
		<updated>2019-03-28T16:50:24Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:50, 28 March 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;Mods are able to create custom shops with custom upgrades. &lt;/del&gt;You can make &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;a shop &lt;/del&gt;using the &amp;lt;code&amp;gt;ShopArea&amp;lt;/code&amp;gt; worldscript. Using that worldscript, you can select the level of the shop. Depending on the situation however, it might be more appropriate to use an &amp;lt;code&amp;gt;OpenInterface&amp;lt;/code&amp;gt; worldscript instead, in the case you need both a custom GUI and you have no desire to have a shop level associated with it.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;You can make &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;custom shops &lt;/ins&gt;using the &amp;lt;code&amp;gt;ShopArea&amp;lt;/code&amp;gt; worldscript. Using that worldscript, you can select the level of the shop. Depending on the situation however, it might be more appropriate to use an &amp;lt;code&amp;gt;OpenInterface&amp;lt;/code&amp;gt; worldscript instead, in the case you need both a custom GUI and you have no desire to have a shop level associated with it.&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;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; 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;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There are 2 types of custom shops you can make using the &amp;lt;code&amp;gt;ShopArea&amp;lt;/code&amp;gt; worldscript:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There are 2 types of custom shops you can make using the &amp;lt;code&amp;gt;ShopArea&amp;lt;/code&amp;gt; worldscript:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key hohmediawiki?h35303030a2ab-hiwrfuej_:diff::1.12:old-1740:rev-1741 --&gt;
&lt;/table&gt;</summary>
		<author><name>Miss</name></author>
	</entry>
	<entry>
		<id>https://wiki.heroesofhammerwatch.com/index.php?title=Custom_shop&amp;diff=1740&amp;oldid=prev</id>
		<title>Miss: Created page with &quot;Mods are able to create custom shops with custom upgrades. You can make a shop using the &lt;code&gt;ShopArea&lt;/code&gt; worldscript. Using that worldscript, you can select the level of...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.heroesofhammerwatch.com/index.php?title=Custom_shop&amp;diff=1740&amp;oldid=prev"/>
		<updated>2019-03-28T16:45:38Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Mods are able to create custom shops with custom upgrades. You can make a shop using the &amp;lt;code&amp;gt;ShopArea&amp;lt;/code&amp;gt; worldscript. Using that worldscript, you can select the level of...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Mods are able to create custom shops with custom upgrades. You can make a shop using the &amp;lt;code&amp;gt;ShopArea&amp;lt;/code&amp;gt; worldscript. Using that worldscript, you can select the level of the shop. Depending on the situation however, it might be more appropriate to use an &amp;lt;code&amp;gt;OpenInterface&amp;lt;/code&amp;gt; worldscript instead, in the case you need both a custom GUI and you have no desire to have a shop level associated with it.&lt;br /&gt;
&lt;br /&gt;
There are 2 types of custom shops you can make using the &amp;lt;code&amp;gt;ShopArea&amp;lt;/code&amp;gt; worldscript:&lt;br /&gt;
&lt;br /&gt;
1. A regular upgrade shop. This is what most upgrade shops in the town are using, such as the blacksmith.&lt;br /&gt;
2. A custom shop with a custom GUI frame.&lt;br /&gt;
&lt;br /&gt;
== Upgrade shop ==&lt;br /&gt;
The basic upgrade shops use a &amp;lt;code&amp;gt;ShopArea&amp;lt;/code&amp;gt; worldscript with the type set to &amp;lt;code&amp;gt;UpgradeShop&amp;lt;/code&amp;gt;. These shops use sval files to load &amp;quot;upgrades&amp;quot;, which in turn load &amp;quot;upgrade steps&amp;quot;, which can be owned, or be a one-off purchase. For example, let's take a look at how the blacksmith works in &amp;lt;code&amp;gt;tweak/shops/blacksmith.sval&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;loader&amp;gt;Upgrades::LoadShop&amp;lt;/loader&amp;gt;&lt;br /&gt;
 &amp;lt;dict&amp;gt;&lt;br /&gt;
 	&amp;lt;string name=&amp;quot;class&amp;quot;&amp;gt;Upgrades::UpgradeShop&amp;lt;/string&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 	&amp;lt;string name=&amp;quot;id&amp;quot;&amp;gt;blacksmith&amp;lt;/string&amp;gt;&lt;br /&gt;
 	&amp;lt;string name=&amp;quot;name&amp;quot;&amp;gt;.shop.blacksmith&amp;lt;/string&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 	&amp;lt;array name=&amp;quot;upgrades&amp;quot;&amp;gt;&lt;br /&gt;
 		...&lt;br /&gt;
 	&amp;lt;/array&amp;gt;&lt;br /&gt;
 &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that the sval file is using a loader function &amp;lt;code&amp;gt;Upgrades::LoadShop&amp;lt;/code&amp;gt;. This will load the shop definition so that it can be used as a category in the &amp;lt;code&amp;gt;ShopArea&amp;lt;/code&amp;gt; worldscript. The class is the basic &amp;lt;code&amp;gt;UpgradeShop&amp;lt;/code&amp;gt; class, which simply provides a list of upgrades. The ID is set to &amp;lt;code&amp;gt;blacksmith&amp;lt;/code&amp;gt;, which is what the &amp;quot;category&amp;quot; property must be set to in the &amp;lt;code&amp;gt;ShopArea&amp;lt;/code&amp;gt; worldscript. The name is what is shown at the top of the UI.&lt;br /&gt;
&lt;br /&gt;
== Upgrades ==&lt;br /&gt;
Then we have a list of upgrades. Upgrades, by definition, are upgrades you can buy that can be owned by a player. But this doesn't necessarily mean they have to be owned, as key or item purchases for example are not actually owned upgrades, they're one-off upgrades that perform some temporary action on the player, such as giving a key, or giving an item. Keys and items are not permanent, they disappear after you die in a dungeon, so they're not remembered as being &amp;quot;owned&amp;quot; in your character.&lt;br /&gt;
&lt;br /&gt;
Upgrades have upgrade &amp;quot;steps&amp;quot;, which are basically the &amp;quot;levels&amp;quot; of the upgrades. If you buy an upgrade level 1, you own the first step in the upgrade, if you buy an upgrade level 2, you own the second step (but not the first), etc.&lt;br /&gt;
&lt;br /&gt;
There's a number of upgrade classes built-in to the game:&lt;br /&gt;
&lt;br /&gt;
* ModifierUpgrade&lt;br /&gt;
** ChapelUpgrade&lt;br /&gt;
* BuildingUpgrade&lt;br /&gt;
* KeyUpgrade&lt;br /&gt;
* OreTraderUpgrade&lt;br /&gt;
* RecordUpgrade&lt;br /&gt;
* SingleStepUpgrade&lt;br /&gt;
** DesertMapUpgrade&lt;br /&gt;
** ItemUpgrade&lt;br /&gt;
&lt;br /&gt;
For now, we're only going to take a look at &amp;lt;code&amp;gt;ModifierUpgrade&amp;lt;/code&amp;gt; as its the most straight forward one.&lt;br /&gt;
&lt;br /&gt;
=== Defining the upgrade ===&lt;br /&gt;
Let's take another look at the Blacksmith shop. You can see that the first upgrade in the list is the armor upgrade for tier 1:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;dict&amp;gt;&lt;br /&gt;
 	&amp;lt;string name=&amp;quot;class&amp;quot;&amp;gt;Upgrades::ModifierUpgrade&amp;lt;/string&amp;gt;&lt;br /&gt;
 	&amp;lt;string name=&amp;quot;id&amp;quot;&amp;gt;armor&amp;lt;/string&amp;gt;&lt;br /&gt;
 	&amp;lt;array name=&amp;quot;icon&amp;quot;&amp;gt;&lt;br /&gt;
 		&amp;lt;string&amp;gt;gui/icons_others.png&amp;lt;/string&amp;gt;&amp;lt;int&amp;gt;100&amp;lt;/int&amp;gt;&amp;lt;vec4&amp;gt;24 48 24 24&amp;lt;/vec4&amp;gt;&lt;br /&gt;
 	&amp;lt;/array&amp;gt;&lt;br /&gt;
 	&amp;lt;array name=&amp;quot;steps&amp;quot;&amp;gt;&lt;br /&gt;
 		&amp;lt;!-- Tier I --&amp;gt;&lt;br /&gt;
 		&amp;lt;!-- Level 1 --&amp;gt;&lt;br /&gt;
 		&amp;lt;dict&amp;gt;&lt;br /&gt;
 			&amp;lt;int name=&amp;quot;cost-gold&amp;quot;&amp;gt;250&amp;lt;/int&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 			&amp;lt;string name=&amp;quot;name&amp;quot;&amp;gt;.shop.blacksmith.armor-1.name&amp;lt;/string&amp;gt;&lt;br /&gt;
 			&amp;lt;string name=&amp;quot;desc&amp;quot;&amp;gt;.shop.blacksmith.armor-1.desc&amp;lt;/string&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 			&amp;lt;dict name=&amp;quot;modifier&amp;quot;&amp;gt;&lt;br /&gt;
 				&amp;lt;string name=&amp;quot;class&amp;quot;&amp;gt;Modifiers::Armor&amp;lt;/string&amp;gt;&lt;br /&gt;
 				&amp;lt;int name=&amp;quot;armor&amp;quot;&amp;gt;5&amp;lt;/int&amp;gt;&lt;br /&gt;
 			&amp;lt;/dict&amp;gt;&lt;br /&gt;
 		&amp;lt;/dict&amp;gt;&lt;br /&gt;
 		...&lt;br /&gt;
 	&amp;lt;/array&amp;gt;&lt;br /&gt;
 &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, the class is defined as &amp;lt;code&amp;gt;Upgrades::ModifierUpgrade&amp;lt;/code&amp;gt;, which lets you create an owned upgrade with a modifier that's applied on the player at all times. The tier is not shown in the example above, but for upgrade steps that requires a certain tier, you can add this line to the step dictionary:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;int name=&amp;quot;restrict-shop-level-min&amp;quot;&amp;gt;2&amp;lt;/int&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Custom shop ==&lt;br /&gt;
To make a completely custom shop, you have to use the &amp;quot;Custom&amp;quot; shop type in the &amp;lt;code&amp;gt;ShopArea&amp;lt;/code&amp;gt; worldscript. With that shop type, the &amp;quot;Category&amp;quot; property acts as the name of a class to instantiate that will be the frame of the shop menu. This class needs to inherit from &amp;lt;code&amp;gt;ShopMenuContent&amp;lt;/code&amp;gt;, and then override &amp;lt;code&amp;gt;string GetGuiFilename()&amp;lt;/code&amp;gt; to specify the gui file to use as the shop frame.&lt;br /&gt;
&lt;br /&gt;
So, for example, to make a shop with a custom UI, you define your class like this:&lt;br /&gt;
&lt;br /&gt;
 class MyShopMenu : ShopMenuContent&lt;br /&gt;
 {&lt;br /&gt;
 	MyShopMenu(UnitPtr unit, SValue&amp;amp; params)&lt;br /&gt;
 	{&lt;br /&gt;
 		super();&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
 	string GetGuiFilename() override&lt;br /&gt;
 	{&lt;br /&gt;
 		return &amp;quot;gui/shop/myshop.gui&amp;quot;;&lt;br /&gt;
 	}&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Miss</name></author>
	</entry>
</feed>