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
This post has been closed. You can still view previous posts, but you can't post any new replies.

(5e OGL) Use Boolean value for text.

I am able to get a boolean value to change macros by naming the macro a number and using a button. You will need to first set up an attribute as a boolean value, 0 or 1. Then make two macros, one named 0 for failure, and one named 123 for the desired result. [Name](~<keyword>|[[123*@{<keyword>|boolean}]])
No because the attribute is pulled first in the order of operations. 
1462639672
The Aaron
Pro
API Scripter
Ed S. said: No because the attribute is pulled first in the order of operations.  Actually, I think it should work fine as what he's generating is a button, not actually accessing the ability.
Good point, experimentation is the best way to find out. 
It works for me.
Is there any way to add a digit to the end, so if we put a 1 at the end it would be 01 for negative, and 1231 for positive. This does not work, but I was hoping it would.  If we could add a digit then we could have unique negative results. Right now I plan to have macro #0 be "You are not high enough level." so that it is a universal statement.  [Name](~<keyword>|[[123*@{<keyword>|boolean}1]])
1462645027
Silvyre
Forum Champion
Okieone Shinobi said: I am able to get a boolean value to change macros by naming the macro a number and using a button. Is there any way to add a digit to the end, so if we put a 1 at the end it would be 01 for negative, and 1231 for positive. This does not work, but I was hoping it would. What exactly are you attempting to accomplish through doing this?
One example would be, if I set up some conversation, or event, then I can have it dependent on what level a character is. Perhaps an NPC that only gives information to female characters. Perhaps some bonus is only given to members of the Harpers. As it is, I can change the macro with the formula I originally wrote. I can only have one negative value for all the macros I write this way. I am setting up an interactive type of city. With the extra number I can set up all sorts of adventures. I need to be able to insert an extra number to make the macro I made fully functional. As is the only possible negative value is zero. I want to make it so that when the boolean is zero, it triggers the macro #01.
I could set up different characters with different macro #0, and I think that should work.
If there is not way to insert a number at the end, could I set up an API script to do it?
1462648413

Edited 1462648920
Silvyre
Forum Champion
Might I recommend using PowerCards for this? It would open up a much broader range of conditional evaluation within a macro, without the need to edit Attributes. e.g. !power {{ --name|Conditionals --?? @{selected|level} <= 12 ?? Not ready:|You require more experience. --?? @{selected|character_id} == -KCs1CWESlXNBZgiv_Ge ?? Undesireable:|Guards! It's the thief! }} [[01]] will always parse to 1; you might try something like [Name](~selected|Result-[[ [[0]] ]]). The second pair of inline roll brackets is in case you want to use a roll to determine the name of the Ability called, e.g. [Name](~selected|Result-[[ [[1d2 - 1]] ]])
I have never tried them before. Thanks. I will check it out.
This works fine. Macro #123 is false, and Macro #124 is true in this particular case. [Name](~selected|[[@{selected|boolean}+123}]]) Then I can use the ammo script to adjust the boolean. I think it will take me a while to learn the Powercards and am trying to stick with the one click scripts so I don't have to worry about fixing conflicts. I will definitely check them out. This also seems like an easy way to make event dependent macros, or make an NPC that says something different every time the PCs talk to them.  
To have a minimum value, this is the form I have. [Name](~selected|[[[[ ( 1 - ( floor( ( <minimum value> - 1 - <attribute>) / ( abs( <minimum value> - 1 - <attribute> ) + 0.001 ) ) + 1 ) ) ]] +123}]])
1462694146

Edited 1462694163
Silvyre
Forum Champion
Okieone Shinobi said: To have a minimum value, this is the form I have. [Name](~selected|[[[[ ( 1 - ( floor( ( <minimum value> - 1 - <attribute>) / ( abs( <minimum value> - 1 - <attribute> ) + 0.001 ) ) + 1 ) ) ]] +123}]]) That's quite cool. Roll20 actually does have formal syntax for this in the form of the Keep / Drop function . e.g. [[ {X, Y}kl1 ]]
Thanks Silvyre. I did not have those formulas yet.