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

Create a macro with a minimum value

Hi, I want to know a simple way to set a minimum number given on a macro that isn't a roll.  A good exemple would be half the level (min 1), or equal to your intelligence mod (min 1) How can I achieve this ? Also, take note that I am very beginner with Macro.
1604121878
GiGs
Pro
Sheet Author
API Scripter
roll20 dice macros have a keep highest or drop highest function, and you can use them with pure numbers or calculations, it doesnt need to be a roll. {your number,1}kh1 The above compares the number inside the { } brackets, amd kh1 says keep the highest one. This ensures the number cannot be below 1. I dont know how you are wanting to use this, so cant give the full syntax of how it will appear in your roll. But if you need to calculate it in place, you can put it inside inline roll brackets like [[{your number,1}kh1]]
So, if I want to add lets say my Wisdom modifier @{WIS-mod} but with a minimum of 1. What would it looks like ? 
1604159318
GiGs
Pro
Sheet Author
API Scripter
Is that number being used as part of another calculation, like an attack or saving throw? What is the roll for that?
More like a number of time per day equal to your Wisdom modifier (minimum 1) There is no roll
1604207196
GiGs
Pro
Sheet Author
API Scripter
If there's no roll, you can just use [[{ @{WIS-mod},1}kh1]] That'll only work if it's an Ability on a character sheet. To use it in a universal macro (in the collections sidebar), you need to give roll20 a way to know who's wis mod you want to use, and the easiest way is [[{ @{selected|WIS-mod},1}kh1]] This requires you have a token linked to a character, and it will use the value from the character whose token you have selected.
So if I would want to have a macro saying equal to level, min 2. It would look like something like this  [[{ @{selected|level},2}kh2]] Did I understand that correctly?  
Olivier T. said: So if I would want to have a macro saying equal to level, min 2. It would look like something like this&nbsp; [[{ @{selected|level},2}kh2]] Did I understand that correctly?&nbsp;&nbsp; What you want is: [[{ @{selected|level},2}kh1]] "kh1" is short for "keep the highest single die roll".&nbsp; "kh2" would keep the highest two &nbsp;die rolls, which is not what you're looking for. The number 2 after the selected level is what makes sure that it is at least level 2. You can read more on the dice reference page at&nbsp; <a href="https://wiki.roll20.net/Dice_Reference#Keep_.2F_Drop_Dice_.28B.2CF.29_khN.2FklN.2FdhN.2FdlN" rel="nofollow">https://wiki.roll20.net/Dice_Reference#Keep_.2F_Drop_Dice_.28B.2CF.29_khN.2FklN.2FdhN.2FdlN</a> .
Come posso creare un macro che a seconda del risultato del dado mi dia una risposta specifica? Esempio: se tiro 1d20 ed esce un numero tra 1 e 5 deve uscire la scritta Successo! Gazie in anticipo&nbsp;
1604690703
The Aaron
Roll20 Production Team
API Scripter
È meglio iniziare un nuovo thread per questo. Se vuoi solo il successo: /r 1d20&gt;5 Altrimenti, puoi creare una tabella arrotolabile con i pesi desiderati e l'output che desideri per ciascuno.
The Aaron said: È meglio iniziare un nuovo thread per questo. Se vuoi solo il successo: /r 1d20&gt;5 Altrimenti, puoi creare una tabella arrotolabile con i pesi desiderati e l'output che desideri per ciascuno. ti spiego meglio, vorrei creare la macro per lo scacciare non morti dei chierici della 3.5, quindi a seconda del risultato del d20 devo avere come risposta una parola specifica per ogni numero
Its funny how my question became a topic in Spanish, no offense ;D