Page 1 of 1

Is this even possible?

Posted: Mon Nov 27, 2017 1:50 pm
by TheIneffableCheese
I'm developing a more complicated Damage macro for Pathfinder. I'm planning to take into account various things that complicate the calculations (e.g., DR). As a specific example, I want to have a check box in my input that allows the GM to note if this attack ignores DR or not.

I can get that check box in, and I have no concerns about the coding to take DR out of the total damage dealt. I was wondering if there is any way to set up the Input call so it deactivates the "Does this ignore DR" check box when DR == 0. Basically, I'd like to have the option not available if the selected token doesn't have any DR to ignore.

All in all, this is not a big deal at all - nothing that I can think of would break my code if the options are set incorrectly. It is more my desire for a clean interface than any real practical considerations. I poked around in the macro functions, and I didn't see anything that seemed to be a likely path forward with this. However, before I gave up my search I figured I'd poll the wisdom of the crowd on this.

Re: Is this even possible?

Posted: Tue Nov 28, 2017 4:06 pm
by JamzTheMan
The current frameworks (including mine) do this without issue (mine even goes as far as prompting for fast healing/regeneration as well and let you turn regen off for a turn, etc).

All you need to do is look for your DR property on the token first. If there is no DR set your checkbox off or even hide it.

Although, what I do is simply instead display a input box and below it list all the DR's/ER's as you may have more than one like DR 5/good, DR 10/magic.

Re: Is this even possible?

Posted: Sat Dec 02, 2017 7:23 pm
by bubblobill
You could assemble your input string from parts that are conditional, setting them to nothing when not required.

Code: Select all

[inputDR=if(DR==0,'', '## checkbox input string thing for DR')]
[inputX =if(X==0, '', '## checkbox input string thing for X' )]
[inputY =if(Y==0, '', '## checkbox input string thing for Y' )]

[abort(input('someInputThatIsAlwaysPresent'+inputDR+inputX+inputY))]