Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Attack Macro Help

Hi guys, I need a teeny bit of help! At the moment, my macro is functioning absolutely fine. However there are two problems I'm faced with: Problem 1) As it stands, for example melee: It rolls 1d20, adds the players STR stat and deducts the targets DEF stat. The problem here is that the roll result might be in the minus, and I'd rather not have that. Is there a way to make any minus result an automatic 0? Problem 2) More of an appearance gripe, with the way it works right now. The roll result is displayed like this in chat:  Is there any way to make it look more like this:    Just so I can add more fields and images etc to 'jazz' it up more? My macro is the following: &{template:default} ?{Choose an Attack|    Melee, **@{selected|token_name}** attacks **@{target|token_name}** with a **melee** attack! **Damage**: [[1d20 + @{selected|STR} - @{target|DEF}]]|    Ranged, **@{selected|token_name}** attacks **@{target|token_name}** with a **ranged** attack! **Damage**: [[1d20 + @{selected|DEX} - @{target|DEX}]]|    Magic, **@{selected|token_name}** attacks **@{target|token_name}** with a **magic** attack! **Damage**: [[1d20 + @{selected|INT} - @{target|MAG DEF}]]|}
1574822485

Edited 1574822899
vÍnce
Pro
Sheet Author
You have to substitute for special characters inside the query ... Try this  &{template:default}?{Choose an Attack|Melee, {{name=**@{selected|token_name}** attacks **@{target|token_name}** with a **melee** attack!}} {{**Damage**= [[1d20 + {(@{selected|STR} - @{target|DEF}),0}kh1 ]]}}|Ranged, {{name=**@{selected|token_name}** attacks **@{target|token_name}** with a **ranged** attack!}} {{**Damage**= [[1d20 + {(@{selected|DEX} - @{target|DEX}),0}kh1 ]]}}|Magic,{{name=**@{selected|token_name}** attacks **@{target|token_name}** with a **magic** attack!}} {{**Damage**= [[1d20 + {(@{selected|INT} - @{target|MAG DEF}),0}kh1 ]] }}|} Use roll grouping to do a comparison and keep the high value so you never have less than "0".
You're a gent for this, thank you! I've just run the code you provided. Bit of an odd one, it no longer adds the conditions ( add Stat of the selected and the subtract target stat together), it essentially gives a flat roll. 
1574881487
vÍnce
Pro
Sheet Author
I'll have a look tonight when I get home and update.
I've come across another issue as well. I'm trying to use:&nbsp; <a href="https://app.roll20.net/forum/post/1216260/script-alter-bar-on-token" rel="nofollow">https://app.roll20.net/forum/post/1216260/script-alter-bar-on-token</a> With the attack result subtracting from the targets bar 1, whilst also rolling a 1d20 and adding the result of that to bar 2 (I'm having a 'Limit Break' bar of sorts, so I need it to slowly fill up at random after every attack).&nbsp; I know the commands,&nbsp; but I'm not entirely sure where to add them in the macro you helped me with, or what I need to input to tell the game "Hey, I want to do subtract x."&nbsp; I hope you don't mind giving us a hand, you've been extremely helpful and I cant thank you enough!
1574901699

Edited 1574901841
vÍnce
Pro
Sheet Author
Ryuichi S. said: You're a gent for this, thank you! I've just run the code you provided. Bit of an odd one, it no longer adds the conditions ( add Stat of the selected and the subtract target stat together), it essentially gives a flat roll.&nbsp; My bad. You don't want to see a negative total and I was just keeping the modifier from going below zero. Here's a macro that will keep the total from being less than zero.&nbsp; I also simplified it somewhat by moving the repetitive portion "so and so attacks so and so..." outside of the query. &amp;{template:default} {{name=**@{selected|token_name}** attacks **@{target|token_name}** with a ?{Choose an Attack|Melee, **melee** attack!&amp;#125;&amp;#125; {{**Damage**= [[ {[[1d20]] + @{selected|STR} - @{target|DEF}&amp;#44;0&amp;#125;kh1 ]]&amp;#125;&amp;#125;|Ranged,**ranged** attack!&amp;#125;&amp;#125; {{**Damage**= [[ {[[1d20]] + @{selected|DEX} - @{target|DEX}&amp;#44;0&amp;#125;kh1 ]]&amp;#125;&amp;#125;|Magic,**magic** attack!&amp;#125;&amp;#125; {{**Damage**= [[ {[[1d20]] + @{selected|INT} - @{target|MAG DEF}&amp;#44;0&amp;#125;kh1 ]] &amp;#125;&amp;#125;}
1574905622

Edited 1574908953
vÍnce
Pro
Sheet Author
Ryuichi S. said: I've come across another issue as well. I'm trying to use:&nbsp; <a href="https://app.roll20.net/forum/post/1216260/script-alter-bar-on-token" rel="nofollow">https://app.roll20.net/forum/post/1216260/script-alter-bar-on-token</a> With the attack result subtracting from the targets bar 1, whilst also rolling a 1d20 and adding the result of that to bar 2 (I'm having a 'Limit Break' bar of sorts, so I need it to slowly fill up at random after every attack).&nbsp; I know the commands,&nbsp; but I'm not entirely sure where to add them in the macro you helped me with, or what I need to input to tell the game "Hey, I want to do subtract x."&nbsp; I hope you don't mind giving us a hand, you've been extremely helpful and I cant thank you enough! To clarify; you want to subtract the damage(1d20+mod-defense) from the target's bar1 and also use the 1d20 roll to add to the target's bar2?&nbsp; Or is it separate 1d20 roll? I'm not familiar with the alterbar script... I did find a newer version&nbsp; AlterBars 2.0 - New and improved! &nbsp;w/code: here I'll play around with it and post back, but I don't believe you can use API commands inside a roll template.&nbsp; You might have to forego using the roll template and just use alterbars. Someone more familiar with the AlterBars script might jump in.
Thanks for this! Though the code breaks the dropdown box when I use it. As for the alter bars, no problem!&nbsp;
You're right, I probably should use the !alterbars function since it has the damage macro within it. So I tried the following code !alter --target|@{target|token_id} --bar|1 --?{Choose an Attack|Melee, [[1d20 + @{selected|STR} - @{target|DEF},0}kh0 ]]{Damage Dealt|0}}} Using: !alter --target|@{target|token_id} --bar|1 --amount|-?{Damage Dealt|0} But doesn't seem to work D:
1574959138
vÍnce
Pro
Sheet Author
Ryuichi S. said: Thanks for this! Though the code breaks the dropdown box when I use it. As for the alter bars, no problem!&nbsp; Make sure that the special characters are in tact.&nbsp; One of the downsides of queries is that you have to substitute certain characters within the query otherwise the query breaks.&nbsp; Also, just opening the macro after saving it can cause the special characters to convert which also breaks the query in chat.&nbsp; You should save such macros in a text document in case you ever need to re-save the macro with the proper substitutions. &nbsp; The general consensus on the forums is to try not to use nested queries which require characters substitution and instead create a chat menu of choices.
1574961883

Edited 1574966039
vÍnce
Pro
Sheet Author
You almost had the alterbar command correct... try this &amp;{template:default} {{name=@{selected|token_name} makes a melee attack!}} !alter --target|@{target|token_id} --bar|1 --amount|-1d20 + @{selected|STR} - @{target|DEF} also, I edited the alterbar script a little to help show the target's token_name and added a little border around the token's thumbnail image. // VERSION INFO var AlterBars_Author = "SkyCaptainXIII"; var AlterBars_Version = "2.0.5"; var AlterBars_LastUpdated = 1494507176; // FUNCTION DECLARATION var AlterScript = AlterScript || {}; on("chat:message", function (msg) { if (msg.type != "api") return; if (msg.content.split(" ", 1)[0] === "!alter") { msg.who = msg.who.replace(" (GM)", ""); msg.content = msg.content.replace(/&lt;br\/&gt;\n/g, ' ').replace(/({{(.*?)}})/g, " $2 "); if (msg.content.indexOf("--target") == -1) { sendChat("ERROR", "/w " + msg.who + " Your macro does not have a target specified."); return; } AlterScript.Process(msg); } }); on("ready", function () { log("-=&gt; AlterBars v" + AlterBars_Version + " &lt;=- [" + (new Date(AlterBars_LastUpdated * 1000)) + "]"); //log (Date.now().toString().substr(0, 10)); }); // FUNCTIONS AlterScript.Process = function (msg) { // BAR CONFIGURATION - These are used to identify which bar to adjust. You can // also use any lowercase letters as well such as 'h' or 'hp' for hit points/health. var Bar1Key = "1"; var Bar2Key = "2"; var Bar3Key = "3"; var BarGain = ["gains", "point", "points"]; var BarLoss = ["loses", "point", "points"]; // OUTPUT FORMAT - The following variables are used to define how AlterBar // sends the output to chat. The first item is the verb, the second is the // singular name of the 'bar' and the third item is the plural version. // Example: Paladin heals 1 hit point. // Example: Paladin heals 8 hit points. // Example: Mage spends 3 mana. var Bar1Gain = ["heals", "hit point", "hit points"]; var Bar1Loss = ["takes", "damage", "damage"]; var Bar2Gain = ["recovers", "mana", "mana"] var Bar2Loss = ["spends", "mana", "mana"] var Bar3Gain = ["heals", "hit point", "hit points"]; var Bar3Loss = ["takes", "damage", "damage"]; // ALTCOLORS - This uses a dark green or dark red emote for gain / loss instead // of the default orange for both. var ALT_COLORS = true; // PREVENT OVERMAX - Set this variable to true to prevent the current value of // the bar from being greater than its max value. If there is no max value set, // it will not stop the current bar value from increasing. var PREVENT_OVERMAX = true; // STOP AT ZERO - Prevents the current value of the bar from dropping below zero. var STOP_AT_ZERO = true; // ANNOUNCE CHANGE IN CHAT - Set to true to send a message to the chat window // showing which token gained or lost points and how much. var ANNOUNCE_CHANGE = true; // SEND TO GM - Set to true to send the results to the GM. This will also trigger // if a hidden change is sent. var ALERT_GM = false; // Variables stuff... var n = msg.content.split(/\s+--/); var who = msg.who; var Target = ""; var Bar = 0; var AlterValue = 0; // Pull variables from n... n.shift(); _.each(n, function (a) { Tag = a.substring(0, a.indexOf("|")).trim(); Content = a.substring(a.indexOf("|") + 1).trim(); if (Tag.toLowerCase() == "target") Target = getObj("graphic", Content); if (Tag.toLowerCase() == "bar") Bar = Content; if (Tag.toLowerCase() == "amount") AlterValue = Content; if (Tag.toLowerCase() == "show" &amp;&amp; Content.toLowerCase() == "gm") { ANNOUNCE_CHANGE = false; ALERT_GM = true; } if (Tag.toLowerCase() == "show" &amp;&amp; Content.toLowerCase() == "none") { ANNOUNCE_CHANGE = false; ALERT_GM = false; } }); if(!Target) { sendChat("ERROR", `/w "${who}" Not a valid target id.`); return; } if (Bar == 1 || Bar == Bar1Key) { BarGain = Bar1Gain; BarLoss = Bar1Loss; } else if (Bar == 2 || Bar == Bar2Key) { BarGain = Bar2Gain; BarLoss = Bar2Loss; } else if (Bar == 3 || Bar == Bar3Key) { BarGain = Bar3Gain; BarLoss = Bar3Loss; } else { sendChat("ERROR", "/w " + who + " That is not a valid bar."); return; } // Get current and max values from the token... var CurrentValue = parseInt(Target.get("bar" + Bar + "_value")); var MaxValue = parseInt(Target.get("bar" + Bar + "_max")); // Set current values as previous values for transit to Tint/Aura HealthColors... var Previous = JSON.parse(JSON.stringify(Target)); // Check for a + or - sign... var Operand1 = AlterValue.charAt(0); var Operand2 = AlterValue.charAt(1); if (Operand2 === "+" || Operand2 === "-") AlterValue = AlterValue.substring(2); else if (Operand1 === "+" || Operand1 === "-") AlterValue = AlterValue.substring(1); // Save the value for the tooltip... var Expression = AlterValue; // Define CSS... var AlertGainStyle = "max-height: 20px; width: 100%; padding: 3px 40px 6px 0px; border: 1px solid #000; border-radius: 4px; background-color: " + + "; background-image: linear-gradient(rgba(255, 255, 255, .3), rgba(255, 255, 255, 0)); font-family: Candal; font-style: normal; font-size: 1.05em; line-height: 1em; color: #FFF; font-weight: normal; text-align: left; text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;"; var AlertLossStyle = "max-height: 20px; width: 100%; padding: 3px 0px 6px 0px; border: 1px solid #000; border-radius: 4px; background-color: " + ((!ALT_COLORS) ? "#BF5700" : "#440000") + "; background-image: linear-gradient(rgba(255, 255, 255, .3), rgba(255, 255, 255, 0)); font-family: Candal; font-style: normal; font-size: 1.05em; line-height: 1em; color: #FFF; font-weight: normal; text-align: left; text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;"; var AlertOuterStyle = "max-height: 40px; width: 100%; margin: 10px 0px 5px -7px; line-height: 40px;"; var AlertImageStyle = "height: 40px; width: 40px; float: right; margin: -11px 5px 0px 0px;"; // Main process... sendChat("", "/r " + AlterValue, function (outs) { AlterValue = parseInt(JSON.parse(outs[0].content).total); var Tooltip = "Rolling " + Expression + " = " + AlterValue + "' class='a inlinerollresult showtip tipsy-n'"; var TargetName = (Target.get("name") == "" || Target.get("@{token_name}") == false &amp;&amp; !ALERT_GM) ? "NPC" : Target.get("name"); if (Operand1 != "-") { // Add to bar... if (PREVENT_OVERMAX) AlterValue = (AlterValue + CurrentValue &gt; MaxValue) ? MaxValue - CurrentValue : AlterValue; var AlertGain = "" + "&lt;div style='display: block; margin-left: -7px; margin-right: 2px; padding: 2px 0px;'&gt;" + "&lt;div style='position: relative; border: 1px solid #000; border-radius: 5px; background-color: " + ((!ALT_COLORS) ? "#BF5700" : "#004400") + "; background-image: linear-gradient(rgba(255, 255, 255, .3), rgba(255, 255, 255, 0)); margin-right: -2px; padding: 2px 5px 5px 50px;'&gt;" + "&lt;div style='position: absolute; top: -10px; left: 5px; height: 40px; width: 40px;'&gt;" + "&lt;img src='" + Target.get("imgsrc") + "' style='height: 40px;width: 40px;border: 1px solid black;border-radius: 10px;box-sizing: border-box;'&gt;&lt;/img&gt;" + "&lt;/div&gt;" + "&lt;div style='font-family: Candal; font-size: 13px; line-height: 15px; color: #FFF; font-weight: normal; text-align: center; text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;'&gt;" + TargetName + " " + BarGain[0] + " " + AlterValue + " " + ((AlterValue == 1) ? BarGain[1] : BarGain[2]) + "." + "&lt;/div&gt;" + "&lt;/div&gt;" + "&lt;/div&gt;"; if (ANNOUNCE_CHANGE) sendChat("", "/desc " + AlertGain); if (ALERT_GM) sendChat(who, "/w GM " + AlertGain); Target.set("bar" + Bar + "_value", CurrentValue += AlterValue); } else { // Subtract from bar... var AlertLoss = "" + "&lt;div style='display: block; margin-left: -7px; margin-right: 2px; padding: 2px 0px;'&gt;" + "&lt;div style='position: relative; border: 1px solid #000; border-radius: 5px; background-color: " + ((!ALT_COLORS) ? "#BF5700" : "#440000") + "; background-image: linear-gradient(rgba(255, 255, 255, .3), rgba(255, 255, 255, 0)); margin-right: -2px; padding: 2px 5px 5px 50px;'&gt;" + "&lt;div style='position: absolute; top: -10px; left: 5px; height: 40px; width: 40px;'&gt;" + "&lt;img src='" + Target.get("imgsrc") + "' style='height: 40px;width: 40px;border: 1px solid black;border-radius: 10px;box-sizing: border-box;'&gt;&lt;/img&gt;" + "&lt;/div&gt;" + "&lt;div style='font-family: Candal; font-size: 13px; line-height: 15px; color: #FFF; font-weight: normal; text-align: center; text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;'&gt;" + TargetName + " " + BarLoss[0] + " " + AlterValue + " " + ((AlterValue == 1) ? BarLoss[1] : BarLoss[2]) + "." + "&lt;/div&gt;" + "&lt;/div&gt;" + "&lt;/div&gt;"; if (ANNOUNCE_CHANGE) sendChat("", "/desc " + AlertLoss); if (ALERT_GM) sendChat(who, "/w GM " + AlertLoss); if (STOP_AT_ZERO &amp;&amp; (CurrentValue - AlterValue &lt; 0)) AlterValue = CurrentValue; Target.set("bar" + Bar + "_value", CurrentValue -= AlterValue); } if ('undefined' !== typeof HealthColors &amp;&amp; HealthColors.Update) HealthColors.Update(Target, Previous); }); }; You can play around with most scripts to find what works for you.
1574963238

Edited 1574966019
vÍnce
Pro
Sheet Author
If you want an attack menu of attacks; You'll need to create 4 global macros (attack-melee, attack-ranged, attack-magic, and attack-menu) note: there are other methods like creating a "macro-mule" character to carry all your macros. A "macro-mule" character is nice since you can easily move your macros between games(character vault/transmogrifier) I use a couple macro-mule characters, one for gm-only macros and another for players.&nbsp; More details here: <a href="https://app.roll20.net/forum/permalink/5924364/" rel="nofollow">https://app.roll20.net/forum/permalink/5924364/</a> #attack-melee &amp;{template:default} {{name=@{selected|token_name} makes a Melee attack!}} !alter --target|@{target|token_id} --bar|1 --amount|-1d20 + @{selected|STR} - @{target|DEF} #attack-ranged &amp;{template:default} {{name=@{selected|token_name} makes a Ranged attack!}} !alter --target|@{target|token_id} --bar|1 --amount|-1d20 + @{selected|DEX} - @{target|DEX}} #attack-magic &amp;{template:default} {{name=@{selected|token_name} makes a Melee attack!}} !alter --target|@{target|token_id} --bar|1 --amount|-1d20 + @{selected|INT} - @{target|MAG DEF} #attack-menu &amp;{template:default} {{name=Attack Menu}} {{[Melee](!&amp;#13;#attack-melee) [Ranged](!&amp;#13;#attack-ranged) [Magic](!&amp;#13;#attack-magic)}} When you call the #attack-menu you can pick an attack. ;-)
Gotcha!! I've implemented all this, and tried to (based on what you taught me) try to fix these together...but... The code I'm using is: &amp;{template:default} {{name=**@{selected|token_name}** attacks **@{target|token_name}** with a ?{Choose an Attack|Melee, **melee** attack!&amp;#125;&amp;#125; !alter --target|@{target|token_id} --bar|1 --amount|-1d20 +&nbsp;@{selected|STR} - @{target|DEF}&amp;#44;0&amp;#125;kh1 |Ranged,**ranged** attack!&amp;#125;&amp;#125; !alter --target|@{target|token_id} --bar|1 --amount|-1d20 + @{selected|DEX} - @{target|DEX}&amp;#44;0&amp;#125;kh1 |Magic,**magic** attack!&amp;#125;&amp;#125; !alter --target|@{target|token_id} --bar|1 --amount|-1d20 + @{selected|INT} - @{target|MAG DEF}&amp;#44;0&amp;#125;kh1 } This was combining all your code (keeping results of the rolls and additions above 1, the latest one you gave for the token API, and the Query) but now it doesn't display the result just the Name bit. Sorry if I'm bugging you, I do really appreciate your help!
1574963779

Edited 1574963890
vÍnce
Pro
Sheet Author
I'm not sure that alterbars can handle kh1...&nbsp; You actually don't need that now since alterbars has the&nbsp;STOP_AT_ZERO option.&nbsp;&nbsp; One downside of alterbars is that you can't hover over your result to see the breakdown...
Oh sweet sorry I didn't see your reply, I'mma implement it and see what happens! Also quick question is the Attack menu in the chat the only way of making it work? Does Query's break it?&nbsp;
1574964144
vÍnce
Pro
Sheet Author
Ryuichi S. said: Oh sweet sorry I didn't see your reply, I'mma implement it and see what happens! Also quick question is the Attack menu in the chat the only way of making it work? Does Query's break it?&nbsp; A single query is probably fine, but a nested query is a real pain to work with (character substitution, editing converts the macro)&nbsp; I'm not sure the script will handle a nested query and you definitely cannot use a roll template within the script's command.&nbsp;&nbsp; BTW: you can also whisper the attack-menu macro if you don't want the menu to be seen by everyone (chat spam)
Oh! You can? I wasn't sure about that one! That'd much be preferable!!
1574964479

Edited 1574965994
vÍnce
Pro
Sheet Author
Ryuichi S. said: Oh! You can? I wasn't sure about that one! That'd much be preferable!! You can add "/w gm " to any macro/chat command so that only the gm sees the chat output. /w gm &amp;{template:default} {{name=Attack Menu}} {{[Melee](! #attack-melee) [Ranged](! #attack-ranged) [Magic](! #attack-magic)}}
And how would it work for the player so only they see the chat message menu? Or is that just specifically for GMs only?
1574964653
vÍnce
Pro
Sheet Author
Ryuichi S. said: And how would it work for the player so only they see the chat message menu? Or is that just specifically for GMs only? <a href="https://wiki.roll20.net/Text_Chat#Whispers" rel="nofollow">https://wiki.roll20.net/Text_Chat#Whispers</a>
Gotcha, and one final last question and I promise I'll stop hounding you. (I cannot express how thankful I am) How hard would it be to add on at the end of each attack macro (attack-melee,attack-ranged,attack-magic) to get it to increase bar 3 on the selected token.&nbsp; I tried: &amp;{template:default} {{name=@{selected|token_name} makes a Melee attack!}} !alter --target|@{target|token_id} --bar|1 --amount|-1d20 + @{selected|STR} - @{target|DEF}&nbsp; !alter --selected|@{selected|token_name} --bar|3 --amount|+1d20&nbsp; But it just gives me&nbsp; (From ERROR): &nbsp;S. Your macro does not have a target specified.
1574965399
vÍnce
Pro
Sheet Author
&amp;{template:default} {{name=@{selected|token_name} makes a Melee attack!}} !alter --target|@{target|token_id} --bar|1 --amount|-1d20 + @{selected|STR} - @{target|DEF}&nbsp; !alter --target|@{target|token_id} --bar|3 --amount|+1d20
Sorry, I meant that it's supposed to increase the person who attacked's bar 3. (It's like a limit break, to increase slowly/randomly everytime the player makes an attack)
1574965701

Edited 1574965976
vÍnce
Pro
Sheet Author
Just swap "target|" with "selected|"&nbsp; :-) &amp;{template:default} {{name=@{selected|token_name} makes a Melee attack!}} !alter --target|@{target|token_id} --bar|1 --amount|-1d20 + @{selected|STR} - @{target|DEF}&nbsp; !alter --target|@{selected|token_id} --bar|3 --amount|+1d20 Also, you can edit the text displayed for alterbars if needed.&nbsp; In case you want to change "hit points" to health or similar. this is the section in the script // OUTPUT FORMAT - The following variables are used to define how AlterBar // sends the output to chat. The first item is the verb, the second is the // singular name of the 'bar' and the third item is the plural version. // Example: Paladin heals 1 hit point. // Example: Paladin heals 8 hit points. // Example: Mage spends 3 mana. var Bar1Gain = ["heals", "hit point", "hit points"]; var Bar1Loss = ["takes", "damage", "damage"]; var Bar2Gain = ["recovers", "mana", "mana"] var Bar2Loss = ["spends", "mana", "mana"] var Bar3Gain = ["heals", "hit point", "hit points"]; var Bar3Loss = ["takes", "damage", "damage"];
You are a badass!!! Thank you so so so much man! It's working perfectly!&nbsp;
1574968649
vÍnce
Pro
Sheet Author
Cool beans.&nbsp; Have fun.
I've been usnig a simple thing&nbsp; like this for a while now:&nbsp;&amp;{template:default} {{name=Loli Pop ChainSaw}} {{Melee Attack=[[1d20+7]]}} {{Melee parry=[[1d20+9]]}} {{Damage Chainsaw (physical) =[[9d6]]}}&nbsp; Stuff can be as diffacult or complex as you want it.
1574973353
vÍnce
Pro
Sheet Author
Kane Solamon said: I've been usnig a simple thing&nbsp; like this for a while now:&nbsp;&amp;{template:default} {{name=Loli Pop ChainSaw}} {{Melee Attack=[[1d20+7]]}} {{Melee parry=[[1d20+9]]}} {{Damage Chainsaw (physical) =[[9d6]]}}&nbsp; Stuff can be as diffacult or complex as you want it. Absolutely.&nbsp;&nbsp; "Loli Pop ChainSaw" LOL
Quick question on the above (you probably hate me now lmao) With the current macros and alter bar API in place, is there a way to stop players from casting a magic attack or limit breaking or healing if bar 2 (mana) is at 0? I'm not sure if you can use "if" clauses in macros
1574991846

Edited 1574992079
vÍnce
Pro
Sheet Author
There isn't a way to handle IF/ELSE logic in the standard macro system.&nbsp; I believe an API script like powrecards might have a system to handle this type of logic. I'll give it some thought and see if I can think of a way to incorporate bar 2's value as a stop gate... Maybe divide bar2 value by itself and use the result to multiply against the damage.&nbsp; If mana is 0, no damage, otherwise multiply damage by 1 to apply the damage.
1575044561
vÍnce
Pro
Sheet Author
Not sure if this will work for you exactly since I don't know your exact system... The attack-magic macro below(changes from above are in bold) uses the bar2 value to create a boolean switch (true/false) to apply the attack results.&nbsp; If bar2 is "0" the roll is made, but no token values of the attacker or defender will be applied, otherwise the attack works as before. #attack-magic &amp;{template:default} {{name=@{selected|token_name} makes a Melee attack!}} !alter --target|@{target|token_id} --bar|1 --amount|- ( 1d20 + @{selected|INT} - @{target|MAG DEF} )*(@{selected|bar2}/@{selected|bar2}) !alter --target|@{selected|token_id} --bar|3 --amount|+ ( 1d20 )*(@{selected|bar2}/@{selected|bar2})