<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>macros &#8211; Foundry Hub</title>
	<atom:link href="https://www.foundryvtt-hub.com/tag/macros/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.foundryvtt-hub.com</link>
	<description></description>
	<lastBuildDate>Sun, 27 Oct 2024 22:30:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.4</generator>

<image>
	<url>https://www.foundryvtt-hub.com/wp-content/uploads/2021/02/cropped-fhub_logo3-32x32.webp</url>
	<title>macros &#8211; Foundry Hub</title>
	<link>https://www.foundryvtt-hub.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Under the Hood &#8211; Enhancing the Exhaustion Condition</title>
		<link>https://www.foundryvtt-hub.com/guide/under-the-hood-enhancing-exhaustion-condition/</link>
					<comments>https://www.foundryvtt-hub.com/guide/under-the-hood-enhancing-exhaustion-condition/#comments</comments>
		
		<dc:creator><![CDATA[Malakan]]></dc:creator>
		<pubDate>Wed, 17 Mar 2021 00:36:15 +0000</pubDate>
				<category><![CDATA[Guide]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[dnd5e]]></category>
		<category><![CDATA[macros]]></category>
		<guid isPermaLink="false">https://www.foundryvtt-hub.com/?p=100003640</guid>

					<description><![CDATA[Under the Hood is a new series that focuses on technical aspects in Foundry VTT and its modules to teach and show a new trick or two. The first article of this series is from Malakan and explains how you can use automate the Exhaustion Condition in the Dungeon and Dragons 5e system using Combat Utility Belt (CUB) in conjunction with a few more modules (see Required Modules).]]></description>
										<content:encoded><![CDATA[
<div class="wp-block-uagb-inline-notice uagb-inline_notice__outer-wrap uagb-inline_notice__align-left uagb-block-abbf028e"><h4 class="uagb-notice-title">Compatibility warning</h4><div class="uagb-notice-text"><p>This article was published for an older version of Foundry VTT and does not work for Foundry versions greater than 0.8.x.</p></div></div>



<section class="wp-block-uagb-columns uagb-columns__wrap uagb-columns__background-undefined uagb-columns__stack-mobile uagb-columns__valign-undefined uagb-columns__gap-10 alignundefined uagb-block-c5490a83"><div class="uagb-columns__overlay"></div><div class="uagb-columns__inner-wrap uagb-columns__columns-1">
<div class="wp-block-uagb-column uagb-column__wrap uagb-column__background-undefined uagb-block-ca520348"><div class="uagb-column__overlay"></div><div class="uagb-column__inner-wrap">
<p><strong>Under the Hood</strong> is a new series that focuses on technical aspects in <em>Foundry VTT</em> and its modules to teach and show a new trick or two. The first article of this series is from <em>Malakan</em> and explains how you can use automate the <code>Exhaustion Condition</code> in the <em>Dungeon and Dragons 5e</em> system using <em>Combat Utility Belt</em> (CUB) in conjunction with a few more modules (see Required Modules).</p>



<div style="height:48px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-uagb-inline-notice uagb-inline_notice__outer-wrap uagb-dismissable uagb-inline_notice__align-left uagb-block-e0cb5532"><span class="uagb-notice-dismiss"><svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 512 512"><path d="M464 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-83.6 290.5c4.8 4.8 4.8 12.6 0 17.4l-40.5 40.5c-4.8 4.8-12.6 4.8-17.4 0L256 313.3l-66.5 67.1c-4.8 4.8-12.6 4.8-17.4 0l-40.5-40.5c-4.8-4.8-4.8-12.6 0-17.4l67.1-66.5-67.1-66.5c-4.8-4.8-4.8-12.6 0-17.4l40.5-40.5c4.8-4.8 12.6-4.8 17.4 0l66.5 67.1 66.5-67.1c4.8-4.8 12.6-4.8 17.4 0l40.5 40.5c4.8 4.8 4.8 12.6 0 17.4L313.3 256l67.1 66.5z"></path></svg></span><h3 class="uagb-notice-title">Required Modules</h3><div class="uagb-notice-text"><p><a href="https://www.foundryvtt-hub.com/package/combat-utility-belt/" class="rank-math-link">Combat Utility Belt<br></a><a href="https://www.foundryvtt-hub.com/package/dae/" class="rank-math-link">Dynamic Active Effects</a><br><a href="https://www.foundryvtt-hub.com/package/lib-wrapper/" class="rank-math-link">libWrapper</a> (optional but recommended)<br><a href="https://www.foundryvtt-hub.com/package/midi-qol/" class="rank-math-link">Midi Quality of Life Improvements<br></a><a href="https://www.foundryvtt-hub.com/package/furnace/" class="rank-math-link">The Furnace</a></p></div></div>
</div></div>
</div></section>



<section class="wp-block-uagb-columns uagb-columns__wrap uagb-columns__background-undefined uagb-columns__stack-mobile uagb-columns__valign-top uagb-columns__gap-10 alignundefined uagb-block-02a0d823"><div class="uagb-columns__overlay"></div><div class="uagb-columns__inner-wrap uagb-columns__columns-2">
<div class="wp-block-uagb-column uagb-column__wrap uagb-column__background-undefined uagb-block-e2a4e7f6"><div class="uagb-column__overlay"></div><div class="uagb-column__inner-wrap">
<p>Provided with <em>CUB</em> is a prebuilt conditions mapping for <em>DND5e</em> that uses status icons for Exhaustion levels 1-5. As seen in the image, the token can easily become cluttered with exhaustion icons. Each unique exhaustion level can be conveyed by the color of the icon, rendering multiple icons unnecessary.</p>
</div></div>



<div class="wp-block-uagb-column uagb-column__wrap uagb-column__background-undefined uagb-block-9e1df24a"><div class="uagb-column__overlay"></div><div class="uagb-column__inner-wrap">
<figure class="wp-block-gallery columns-1 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex"><ul class="blocks-gallery-grid"><li class="blocks-gallery-item"><figure><a href="https://www.foundryvtt-hub.com/wp-content/uploads/2021/02/image-1-e1615736472553.png" data-lightbox="gallery" ><img decoding="async" width="196" height="187" src="https://www.foundryvtt-hub.com/wp-content/uploads/2021/02/image-1-e1615736472553.png" alt="" data-id="100003644" data-full-url="https://www.foundryvtt-hub.com/wp-content/uploads/2021/02/image-1-e1615736472553.png" data-link="https://www.foundryvtt-hub.com/?attachment_id=100003644" class="wp-image-100003644"/></a><figcaption class="blocks-gallery-item__caption">Multiple exhaustion icons clutter the token</figcaption></figure></li></ul></figure>
</div></div>
</div></section>



<hr class="wp-block-separator has-text-color has-background has-vivid-cyan-blue-background-color has-vivid-cyan-blue-color is-style-wide"/>



<section class="wp-block-uagb-columns uagb-columns__wrap uagb-columns__background-undefined uagb-columns__stack-mobile uagb-columns__valign-undefined uagb-columns__gap-10 alignundefined uagb-block-ab57004b"><div class="uagb-columns__overlay"></div><div class="uagb-columns__inner-wrap uagb-columns__columns-1">
<div class="wp-block-uagb-column uagb-column__wrap uagb-column__background-undefined uagb-block-4cb22775"><div class="uagb-column__overlay"></div><div class="uagb-column__inner-wrap">
<figure class="wp-block-gallery columns-1 is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex"><ul class="blocks-gallery-grid"><li class="blocks-gallery-item"><figure><a href="https://www.foundryvtt-hub.com/wp-content/uploads/2021/02/cub-exhausted.gif" data-lightbox="gallery" ><img fetchpriority="high" decoding="async" width="1052" height="393" src="https://www.foundryvtt-hub.com/wp-content/uploads/2021/02/cub-exhausted.gif" alt="" data-id="100003701" data-full-url="https://www.foundryvtt-hub.com/wp-content/uploads/2021/02/cub-exhausted.gif" data-link="https://www.foundryvtt-hub.com/?attachment_id=100003701" class="wp-image-100003701"/></a><figcaption class="blocks-gallery-item__caption">Macro in effect</figcaption></figure></li></ul></figure>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p>In the image above you can see the macro in full effect. Once you change the exhaustion level a macro will execute and remove the any other <code>Exhaustion Condition</code> present on the target, but that is not all it will apply effects to the token like giving disadvantage to ability checks and others depending on the level of exhaustion. So in order to achieve this you have to follow these five steps:</p>



<ol class="wp-block-list"><li>Within the <code>CUBPuter</code> settings of Combat Utility Belt you need to enable <strong><em>enhanced conditions</em></strong>.<br><br></li><li>Head over to the <code>Conditions Lab</code> and import the pre-build <code>dnd5e-extended.json</code>.<br>This file can be found within the CUB module under the folder <em>conditions-map</em>. This will overwrite the current mapping with a preset for the DND5e conditions. The default path looks like this:<br><br><code>~/FoundryVTT/foundrydata/Data/modules/combat-utility-belt/condition-maps</code><br><br>If you are not sure where to find this folder on your system, please go to the <a href="https://foundryvtt.com/article/configuration/" class="rank-math-link" target="_blank" rel="noopener">Application Configuration</a> article on the Foundry VTT main site.<br><br></li><li>After you have loaded the preset navigate to the different <code>Exhaustion Conditions</code>. Next to each of them you can find the <strong><em>Active Effect Config</em></strong> button. Click it and navigate to the <em>Effects</em> tab.<br><br><br></li><li>For each exhaustion level you need to add the effects listed in the table below. <strong>Remember</strong> each exhaustion level must include the previous levels&#8217; condition effects, e.g. <code>Exhaustion 2</code> must also include the disadvantage for ability checks from <code>Exhaustion 1</code>. As another example you can look at the image of <code>Exhaustion 5</code> at the end of the article where you can see that it includes all the attribute keys of the previous exhaustion levels.<br><br>Make sure to save the conditions mapping at the end of this step and in between the addition of each effect.<br><br><strong>Note:</strong> Later we will be making a macro called <code>CUB-Exhausted</code>, if you decide to use a different name for it, please make sure that the name matches the inputs in this step.<br><br></li><li>Lastly create a new <strong>script type</strong> macro and check that it is <strong><em>run as GM</em></strong>. Make sure the name you have used in the <code>Conditions Lab</code> matches the name of the macro (case sensitive), in this case <code>CUB-Exhausted</code>.</li></ol>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-table is-style-stripes"><table><thead><tr><th>Status Effect</th><th class="has-text-align-center" data-align="center">Attribute Key</th><th class="has-text-align-center" data-align="center">Change Mode</th><th class="has-text-align-center" data-align="center">Effect Value</th></tr></thead><tbody><tr><td><strong>Exhaustion 1</strong></td><td class="has-text-align-center" data-align="center">flags.midi-qol.disadvantage.ability.check.all</td><td class="has-text-align-center" data-align="center">Override</td><td class="has-text-align-center" data-align="center">1</td></tr><tr><td></td><td class="has-text-align-center" data-align="center">macro.execute</td><td class="has-text-align-center" data-align="center">Custom</td><td class="has-text-align-center" data-align="center">CUB-Exhausted</td></tr><tr><td><strong>Exhaustion 2</strong></td><td class="has-text-align-center" data-align="center">data.attributes.movement.walk</td><td class="has-text-align-center" data-align="center">Multiply</td><td class="has-text-align-center" data-align="center">0.5</td></tr><tr><td></td><td class="has-text-align-center" data-align="center">data.attributes.movement.swim</td><td class="has-text-align-center" data-align="center">Multiply</td><td class="has-text-align-center" data-align="center">0.5</td></tr><tr><td></td><td class="has-text-align-center" data-align="center">data.attributes.movement.burrow</td><td class="has-text-align-center" data-align="center">Multiply</td><td class="has-text-align-center" data-align="center">0.5</td></tr><tr><td></td><td class="has-text-align-center" data-align="center">data.attributes.movement.fly</td><td class="has-text-align-center" data-align="center">Multiply</td><td class="has-text-align-center" data-align="center">0.5</td></tr><tr><td><strong>Exhaustion 3</strong></td><td class="has-text-align-center" data-align="center">flags.midi-qol.disadvantage.attack.all</td><td class="has-text-align-center" data-align="center">Override</td><td class="has-text-align-center" data-align="center">1</td></tr><tr><td></td><td class="has-text-align-center" data-align="center">flags.midi-qol.disadvantage.ability.save.all</td><td class="has-text-align-center" data-align="center">Override</td><td class="has-text-align-center" data-align="center">1</td></tr><tr><td><strong>Exhaustion 4</strong></td><td class="has-text-align-center" data-align="center">data.attributes.hp.max</td><td class="has-text-align-center" data-align="center">Multiply</td><td class="has-text-align-center" data-align="center">0.5</td></tr><tr><td><strong>Exhaustion 5</strong></td><td class="has-text-align-center" data-align="center">data.attributes.movement.walk</td><td class="has-text-align-center" data-align="center">Override</td><td class="has-text-align-center" data-align="center">0</td></tr><tr><td></td><td class="has-text-align-center" data-align="center">data.attributes.movement.swim</td><td class="has-text-align-center" data-align="center">Override</td><td class="has-text-align-center" data-align="center">0</td></tr><tr><td></td><td class="has-text-align-center" data-align="center">data.attributes.movement.burrow</td><td class="has-text-align-center" data-align="center">Override</td><td class="has-text-align-center" data-align="center">0</td></tr><tr><td></td><td class="has-text-align-center" data-align="center">data.attributes.movement.fly</td><td class="has-text-align-center" data-align="center">Override</td><td class="has-text-align-center" data-align="center">0</td></tr></tbody></table><figcaption>Breakdown of the new effects bestowed upon each Exhaustion level</figcaption></figure>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p>With the macro in place, you can now click on your current exhaustion level and it will auto remove other exhaustion states so that only one exhaustion icon appears at a time with the associated effects. Although this modification will achieve only a small effect in your game, it helps show some of the customization possible in <em>Foundry VTT</em>.</p>



<div style="height:45px" aria-hidden="true" class="wp-block-spacer"></div>


<pre class="wp-block-code"><span><code class="hljs language-javascript shcb-wrap-lines"><span class="hljs-comment">// CUB-Exhausted macro</span>

<span class="hljs-keyword">if</span> (args&#91;<span class="hljs-number">0</span>] == <span class="hljs-string">"on"</span>) {
    <span class="hljs-keyword">var</span> exNew = args&#91;<span class="hljs-number">1</span>].efData.label
    <span class="hljs-keyword">const</span> levels = &#91;<span class="hljs-string">"Exhaustion 1"</span>,<span class="hljs-string">"Exhaustion 2"</span>,<span class="hljs-string">"Exhaustion 3"</span>,<span class="hljs-string">"Exhaustion 4"</span>,<span class="hljs-string">"Exhaustion 5"</span>]
    
    <span class="hljs-keyword">for</span>(<span class="hljs-keyword">const</span> ex <span class="hljs-keyword">of</span> levels){
        <span class="hljs-keyword">if</span> ((ex != exNew) &amp;&amp; (game.cub.hasCondition(ex))){
            <span class="hljs-keyword">await</span> game.cub.removeCondition(ex)
        }
    }
}</code></span></pre>


<div style="height:45px" aria-hidden="true" class="wp-block-spacer"></div>



<section class="wp-block-uagb-columns uagb-columns__wrap uagb-columns__background-undefined uagb-columns__stack-mobile uagb-columns__valign-undefined uagb-columns__gap-10 alignundefined uagb-block-3e251eae"><div class="uagb-columns__overlay"></div><div class="uagb-columns__inner-wrap uagb-columns__columns-3">
<div class="wp-block-uagb-column uagb-column__wrap uagb-column__background-undefined uagb-block-25b2188a"><div class="uagb-column__overlay"></div><div class="uagb-column__inner-wrap"></div></div>



<div class="wp-block-uagb-column uagb-column__wrap uagb-column__background-undefined uagb-block-0364f193"><div class="uagb-column__overlay"></div><div class="uagb-column__inner-wrap">
<figure class="wp-block-gallery aligncenter columns-2 is-cropped wp-block-gallery-3 is-layout-flex wp-block-gallery-is-layout-flex"><ul class="blocks-gallery-grid"><li class="blocks-gallery-item"><figure><a href="https://www.foundryvtt-hub.com/wp-content/uploads/2021/03/condition-lab.jpg" data-lightbox="gallery"><img decoding="async" width="1077" height="771" src="https://www.foundryvtt-hub.com/wp-content/uploads/2021/03/condition-lab.jpg" alt="" data-id="100004297" data-full-url="https://www.foundryvtt-hub.com/wp-content/uploads/2021/03/condition-lab.jpg" data-link="https://www.foundryvtt-hub.com/?attachment_id=100004297" class="wp-image-100004297" srcset="https://www.foundryvtt-hub.com/wp-content/uploads/2021/03/condition-lab.jpg 1077w, https://www.foundryvtt-hub.com/wp-content/uploads/2021/03/condition-lab-300x215.jpg 300w, https://www.foundryvtt-hub.com/wp-content/uploads/2021/03/condition-lab-1024x733.jpg 1024w, https://www.foundryvtt-hub.com/wp-content/uploads/2021/03/condition-lab-768x550.jpg 768w" sizes="(max-width: 1077px) 100vw, 1077px" /></a><figcaption class="blocks-gallery-item__caption">Inside Condition Lab showing where the Active Effect Config Button is</figcaption></figure></li><li class="blocks-gallery-item"><figure><a href="https://www.foundryvtt-hub.com/wp-content/uploads/2021/03/exhaustion-effects-1.jpg" data-lightbox="gallery"><img loading="lazy" decoding="async" width="590" height="550" src="https://www.foundryvtt-hub.com/wp-content/uploads/2021/03/exhaustion-effects-1.jpg" alt="" data-id="100004292" data-link="https://www.foundryvtt-hub.com/?attachment_id=100004292" class="wp-image-100004292" srcset="https://www.foundryvtt-hub.com/wp-content/uploads/2021/03/exhaustion-effects-1.jpg 590w, https://www.foundryvtt-hub.com/wp-content/uploads/2021/03/exhaustion-effects-1-300x280.jpg 300w" sizes="(max-width: 590px) 100vw, 590px" /></a><figcaption class="blocks-gallery-item__caption">Example of the Exhaustion 5 effects</figcaption></figure></li></ul></figure>
</div></div>



<div class="wp-block-uagb-column uagb-column__wrap uagb-column__background-undefined uagb-block-5c78f986"><div class="uagb-column__overlay"></div><div class="uagb-column__inner-wrap"></div></div>
</div></section>



<div style="height:45px" aria-hidden="true" class="wp-block-spacer"></div>



<p><strong>Special thanks</strong> to Kandashi and Crymic on the <em>Foundry VTT</em> discord for their help with the macro, and to Mr. Weaver for their <a href="https://www.youtube.com/watch?v=Z6wSePqjJeE&amp;ab_channel=Mr.Weaver" target="_blank" rel="noopener">YouTube guide</a> that provided the Active Effect configurations.</p>
</div></div>
</div></section>
]]></content:encoded>
					
					<wfw:commentRss>https://www.foundryvtt-hub.com/guide/under-the-hood-enhancing-exhaustion-condition/feed/</wfw:commentRss>
			<slash:comments>9</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Object Caching 76/770 objects using Memcached
Page Caching using Disk: Enhanced 
Minified using Disk
Database Caching 1/46 queries in 0.013 seconds using Memcached (Request-wide modification query)

Served from: www.foundryvtt-hub.com @ 2026-04-29 11:58:03 by W3 Total Cache
-->