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

Macros - depending on the result. Start another macro or display MISS.

I think i put this in wrong place so nobody can see it. I just want to calculate if shoot hit target, its easy. But if "yes" so result is bigger then 0 its start macro to calculate damage. If result is 0 or below then it shows MISS. More info in link below   I find this part in wiki... Conditional Statements Using the multiplicative properties of 0(absorption) and 1(identity) you can write conditional statements for integer values(and to some extent floating point values too) An example of this is the formula "if x greater than or equal to A, then T; else F," where T and F are some values. This can be written as a macro with [[-1*floor((A-x-0.1)/(abs(A-x-0.1)+0.001))*T - floor((x+0.1-A)/(abs(x+0.1-A)+0.001))*F]]Similarly, "x greater than A, then T; else F" is written [[-1*floor((A-x+0.1)/(abs(A-x+0.1)+0.001))*T - floor((x-0.1-A)/(abs(x-0.1-A)+0.001))*F]] "x equals A" is simpler, and works when x is a dice roll, but not when F is a dice roll [[F + round((T-F)/(10*(x-A+.1)))]] Now for some identities: "x less than A" is the inverse of "x greater than or equal to A," so the conditional can be written as "x greater than or equal to A, then F; else T" using the formulas above. Similarly with "x less than or equal to A" and "x greater than A," as well as with "x not equal to A" and "x equal to A." I guess its exactly what i need by for goblin sick i cant apply that... Now its looks like: &{template:default} {{name=Nakine, Gun, 12,5m -}} {{Hit on 0+=[[ 1d10 + @{Nakine Maui|Ref_Base} +@{Nakine Maui|Handgun_Skill} -15+?{Modifier|0}]]}} Result need to by higher then this 15 on the end so everything bigger then 0 is HIT everything lower is MISS And i want to make it so that if its "HIT" then its starting next macro like /r 2k6+1 for example So on the end after you click macro it show MISS or HIT and amount of dmg too. Best Regards Maciej
1473096691
Pat S.
Forum Champion
Sheet Author
moved to specific use forum.
1473097585

Edited 1473097618
Try this: &{template:default} {{name=Nakine, Gun, 12,5m -}} {{Damage=[[ {1d10 + @{Nakine Maui|Ref_Base} + @{Nakine Maui|Handgun_Skill} - 15 + ?{Modifier|0}}>1 * (2d6cs0cf0 + 1) ]]}}
Its not reacting like that, i was trying to make one macro for hitting one macro for placing with rolling tables and one macro for dmg and then list them all in one macro so it together after one click.  Your proposition make macro no responding. Simple nothing is showing up. That's my macros, can you take a look how to make that working.  Long story short, when result of hiting macro is smaller then 0 then shows MISS. But when is bigger then start other macros like Hit Placing macro and DMG macro...    Thx for your time! 
1473111430

Edited 1489897324
This should work: &{template:default} {{name=Nakine, Gun, 12,5m -}} {{Damage=[[ {1d10 + @{Nakine Maui|Ref_Base} + @{Nakine Maui|Handgun_Skill} - 15 + ?{Modifier|0}}>1 * [[ 2d6cs0cf0 + 1 ]] ]]}} Maciej s. said: But when is bigger then start other macros like Hit Placing macro and DMG macro... Unfortunately, this is not possible without the assistance of an API Script . (API access requires a Game's Creator to have an active Pro subscription.) Alternatively, a customized Roll Template could accomplish something similar. Access to the Roll20 API is available in games in which the Game's Creator currently has an active Pro subscription. API Scripts (which are written in JavaScript) are able to react to a /roll and perform certain actions. Roll Templates can be written to include Helper Functions (e.g. rollWasCrit() ), which allow for information to be conditonally displayed in certain circumstances. Some Character Sheets on the dropdown (available to all users) include Roll Templates with Helper Functions, which can be taken advantage of within macros. Otherwise, Pro users can write and implement their own Roll Templates within games that they create. Some other (non-API) solutions for conditional evaluation do exist, e.g. " budget conditional statements ", or working out a mathematical function.