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

Nested macro (i need only a fix)

Hello very good afternoon. I've set up a macro with a skill, but I have a problem finishing it.  Here is the code.  /em damage with its khopesh! &{template:simple} {{rname=Damage}} {{r1=[[1t[Khopesh-brutal] + 5 + ?{Blood Vegeance?|No, 0|Yes, 1d8} + ?{Blood Vegeance Bloodied?|No, 0|Yes, 1d10}]]}} {{normal=1}} {{charname=Slashing}} [``Critical hit``](!
#d10-slashing) Ok the problem comes as follows. The character has a feature (called Blood Vegeance) "once per turn", that adds 1d8 to damage or 1d10 when at 1/2 hp (bloodied). What I need is that when the question is asked if you can use Blood Vegeance, in a NO, you add 0 (and no other ask is required), and in a YES you ask another question about whether you are Bloodied or not, (No, 1d8IYes, 1d10).  The way I have configured it appears as 2 separate questions. And what I wish is that in the first question, in a NO option no more question will be ask, and in a YES another question of YES or NO will be ask to require a bloodied or not to sum 1d8 or 1d10. Thx!
1605026824
Ziechael
Forum Champion
Sheet Author
API Scripter
As a basic solution, as asked, you'd be looking at: em damage with its khopesh! &{template:simple} {{rname=Damage}} {{r1=[[1t[Khopesh-brutal] + 5 + ?{Blood Vegeance?|No, 0|Yes,?{Bloodied|No,1d8|Yes,1d10}} ]]}} {{normal=1}} {{charname=Slashing}} [``Critical hit``](!
#d10-slashing) But there is a way to do it with only 1 query to answer which I'll explore once I'm out of this meeting lol.
thx..... Ziechael I had also thought of asking a question with 3 options (No, Yes, Bloodied) that would resolve the issue in some way.  /em damage with its khopesh! &{template:simple} {{rname=Damage}} {{r1=[[1t[Khopesh-brutal] + 5 + ?{Blood Vegeance?|No, 0|Yes, 1d8|Bloodied, 1d10}]]}} {{normal=1}} {{charname=Slashing}} [``Critical hit``](!
#d10-slashing)
Ziechael your code works PERFECT...... hahaha, you are a god my bro...
1605027341

Edited 1605027397
Ziechael
Forum Champion
Sheet Author
API Scripter
Ha yes, that would do it without the unnecessary complexity I'm likely to introduce by autocalcing the bloodied condition... all depends on whether you are happy with a 3 answer query, two queries or want to shoot for a single 2 answer query lol [edit] You are welcome, it's definitely not in its simplest or most elegant form but a happy user is good enough for me :D
I think your solution is the best hahaha, but yes, it depends on how you want it, all options are valid.  Thx.. bro
how would you make it simpler or more elegant as you say? to check the difference.
1605028232
Ziechael
Forum Champion
Sheet Author
API Scripter
The simpler version would simply ask whether or not you wanted to use Blood Vengeance or not, No would result in 0, Yes would result in a check to see if the player was bloodied and output a d8 or d10 as needed... haven't had chance to work through the math yet however since I'm at work and it's just got REALLY busy lol, will definitely get back to you with an example unless one of the forum gurus gets there before me... the general gist is: em damage with its khopesh! &{template:simple} {{rname=Damage}} {{r1=[[1t[Khopesh-brutal] + 5 + ?{Blood Vegeance?|No, 0|Yes, <insert math to check for bloodied and use that to result in a d8 or d10 accordingly> } ]]}} {{normal=1}} {{charname=Slashing}} [``Critical hit``](!
#d10-slashing)
In the case of the character, it has 31 hp (blodied is at 15 "rounded down")..... @{hp}...... what you propose is simply GREAT. Bloodied would be when @{hp}<15 So when @{hp}<15 it applies 1d10 or 1d8 when @{hp}>15. But I don't know how I could put that code in the macro :S
How could I insert that condition into that macro? when @{hp}<15 roll 1d10 or 1d8 when @{hp}>15.
Zichael bro, can you finish the code??? I don't know how can i put inside  <insert math to check for bloodied and use that to result in a d8 or d10 accordingly> em damage with its khopesh! &{template:simple} {{rname=Damage}} {{r1=[[1t[Khopesh-brutal] + 5 + ?{Blood Vegeance?|No, 0|Yes, <insert math to check for bloodied and use that to result in a d8 or d10 accordingly> } ]]}} {{normal=1}} {{charname=Slashing}} [``Critical hit``](!
#d10-slashing) the condition is if @{hp}<15 roll 1d10 or 1d8 when @{hp}>15. If you have time bro.... 
I'm trying this for a nested macro... /w gm &{template:simple} {{rname=Powers Lotto}} {{?{Choose One|Major Power, #MajorPowers|Minor Power, #MinorPowers} }} &{template:default} {{name=Major Powers Roll}} {{ ?{Powers |Major Def, [[1t[MajDef]]]|Major Off, [[1t[MajOff]]]|} }} &{template:default} {{name=Minor Powers Roll}} {{ ?{Powers |Minor Def, [[1t[MinDef]]]|Minor Off, [[1t[MinOff]]]|} }}
1605035186
Ziechael
Forum Champion
Sheet Author
API Scripter
Sorry to leave you hanging, RL has to come first though :P Here you go: em damage with its khopesh! &{template:simple} {{rname=Damage}} {{r1=[[1t[Khopesh-brutal] + 5 + ?{Blood Vegeance?|No, 0|Yes, [[ 1d[[ 8 + ([[ {@{test|hp},999}<[[floor(@{test|hp|max}/2)]] ]]*2) ]] ]] } ]]}} {{normal=1}} {{charname=Slashing}} [``Critical hit``](!
#d10-slashing) That should resolve to 1d10 for anything equal to half health (rounding down) or lower and 1d8 for anything above that... it's dirty but it works ;)
1605035951
GiGs
Pro
Sheet Author
API Scripter
Wont you need a html entity in there on the group }, since its inside a query? Also just for clarification: Ziechael is using test as the character name, you'll need to supply a name or selected , because the hp|max attribute needs a character name.
Zichael, for any reason it doesn't work..... the chat says " No character was found for 'test'" i change test for Jürgen (the name of the character), but it doesn't work at all......
1605036744
GiGs
Pro
Sheet Author
API Scripter
Make sure the name Jürgen is spelt exactly as it is in the Journal (if the character has a surname, you'll need to use that too), and change this 999} to  999}
still not working  :P em damage with its khopesh! &{template:simple} {{rname=Damage}} {{r1=[[1t[Khopesh-brutal] + 5 + ?{Blood Vegeance?|No, 0|Yes, [[ 1d[[ 8 + ([[ {@{test|hp},999} }<[[floor(@{Jürgen|hp|max}/2)]] ]]*2) ]] ]] } ]]}} {{normal=1}} {{charname=Slashing}} [``Critical hit``](!
#d10-slashing)
/em damage with its khopesh! &{template:simple} {{rname=Damage}} {{r1=[[1t[Khopesh-brutal] + 5 + ?{Blood Vegeance?|No, 0|Yes,[[ 1d[[ 8 + ([[ {@{Jürgen|hp},999}<[[floor(@{Jürgen|hp|max}/2)]] ]]*2) ]] ]]} ]]}} {{normal=1}} {{charname=Slashing}} [``Critical hit``](!
#d10-slashing) that code rolls in a NO option..... but when i put yes.... doesn't roll
1605042805

Edited 1605043018
Ziechael
Forum Champion
Sheet Author
API Scripter
Good call on the } GiGs... serves me right for rushing... you need to html some extra stuff cause of the query too... my math working was done outside of a query for ease lol: em damage with its khopesh! &{template:simple} {{rname=Damage}} {{r1=[[1t[Khopesh-brutal] + 5 + ?{Blood Vegeance?|No, 0|Yes, 1d[[ 8 + ([[ {@{ Jürgen |hp} , 999} <[[floor(@{Jürgen|hp|max}/2)]] ]]*2) ]] } ]]}} {{normal=1}} {{charname=Slashing}} [``Critical hit``](!
#d10-slashing)
Finally it works PERFECTLY...... hahaha bro you are a MASTER :P