Thank you! I can't believe I missed that!
I made some progress (don't mind the syntax, it's probably horrid again), and now I'm trying to setup an input dialog to see whether I've hit or missed. My master doesn't really use tokens with properties, so it needs to be a "manual check". I'd like the input dialog to show me the Attack Roll and then proceed with the macro if I hit yes or stop if I hit no.
I managed to create the input dialog, but I can't have it to parse the [AttackRoll]. I mean, I actually see "[AttackRoll]" in the dialog and not the rolled number. Is there any way to fix it?
thanks again. In the meantime I'll try and see if I can figure out how to tell the macro to stop or continue depending on the input.
Code: Select all
[h:d20roll=1d20]
[h:AttackRoll=d20roll+2]
[h:ConfirmCritical=d20]
[if(d20roll != 20), code:
{ [h:input("HitCheck|Yes, No|[AttackRoll]Did I hit?| RADIO | orient=h, select=0")]}]
[h,if(d20roll == 20), code:
{
[Critical = "CritThreat!"]
[ShowCrit = ConfirmCritical]
};
{
[Critical = ""]
[ShowCrit = ""]
}]
[h,if(ConfirmCritical == 20 && d20roll == 20), code:
{
[ShowConfirm = "Critical!"]
[DamageRoll = 4d6*2]
};
{
[ShowConfirm = ""]
[DamageRoll = 4d6]
}]
You rolled [AttackRoll] [Critical] [ShowCrit] [ShowConfirm] Dealing [DamageRoll] Damage
edit: I managed the second part with the abort function, even if it's not as fancy as I'd hoped (I have to hit cancel instead of no to get it to abort), but it's working.
Now I'd really need that bit about making the [AttackRoll] show up in the input window...
edit2: nevermind, I found a way. I had to use "+AttackRoll+" to have it show properly. Not sure where that came from since I didn't find it in the tutorials, but searching on the forum worked.
This is the final result:
Code: Select all
[h:d20roll=1d20]
[h:AttackRoll=d20roll+2]
[h:ConfermaCritico=d20] <vari valori da mettere all'inizio>
[h:eval("AttackRoll")]
[if(d20roll != 20), code:
{ [h: abort(input("Hit|Si, No|"+AttackRoll+" L'ho Colpito?| CHECK | "))]}]
[h,if(d20roll == 20), code:
{
[Critico = "Minaccia Critico!"]
[ShowCrit = ConfermaCritico]
};
{
[Critico = ""]
[ShowCrit = ""]
}]<Minaccia critico>
[h,if(ConfermaCritico == 20 && d20roll == 20), code:
{
[ShowConfirm = "Critico!"]
[DamageRoll = 4d6*2]
};
{
[ShowConfirm = ""]
[DamageRoll = 4d6]
}]<Conferma critico>
Hai tirato [AttackRoll] [Critico] [ShowCrit] [ShowConfirm] Facendo [DamageRoll] Danni
I'm basically set for what I wanted to do, I'll see if I can add an auto fail if I roll 1. And perhaps making a copy of the macro with any circumstance bonuses input.
Still, a little "bug" I have is that I changed the input window to a CHECK, but whether the check is checked or not if I hit "ok" it goes on with the macro. If you could point me in the right direction to fix it I'd appreciate it. Better yet if you could explain me how to have the window create "buttons" to push, like "yes" or "no".