¿ªÔÆÌåÓý

How to... #parameter


 

I am trying to figure out how to use parameter and variable.?

Basically I want to have them pick a number from a list and then use that number to roll results.

Example
Parameters are 0,1,2,3

They pick 3.?
?the table has 13 possibilities
so the can only get 13 if they picked 3, they can only get 1 if they picked 0.?




 

It's a little tricky because of the way list parameters work.

E.g. you can't pick "blue" directly from a list "red, blue, green." Instead, when you pick a list parameter, you get a number: 1 if you pick red, 2 if you pick blue, or 3 if you pick green.

You can then use the number on a table to get back the parameter, or you can modify the number if what you want is just a number - or a shifted number, e.g. 0 to 2 instead of 1 to 3.

So a sample table:

#create "mod" as a variable
%mod%,1

#set "mod" as a parameter
@mod,1,pick a modifier,plus 0,plus 1,plus 2,plus 3
# note that the value of mod is the index number of the list
# 1="plus 0", 2="plus 1", etc.

:Start
1,|mod-1|[result={dice~1d10+%mod%}]
# subtract 1 from mod to get a result 0 to 3 instead of 1 to 4.
# then use mod to modify a 1d10 roll on the table "result"

:result
1,First
2,Second
3,Third
4,Fourth
5,Fifth
6,Sixth
7,Seventh
8,Eighth
9,Ninth
10,Tenth
11,Eleventh
12,Twelfth
13,Thirteenth

Erol K. Bayburt
ErolB1@...

On 2/20/2020 6:18 PM, wishlady via Groups.Io wrote:
I am trying to figure out how to use parameter and variable.
Basically I want to have them pick a number from a list and then use that number to roll results.
Example
Parameters are 0,1,2,3
They pick 3.
?the table has 13 possibilities
so the can only get 13 if they picked 3, they can only get 1 if they picked 0.


 

Thank you, that helps a ton. That actually explained what I was doing wrong.