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

Can I reference a display value in dropdown fields?

1633614953
Paradigm
Pro
Sheet Author
Hello, My challenge here is that I need to calculate maximum ammunition based off of a selection from a dropdown field, however the value contained behind each option is the formula for the Attack Roll. Is there any way I am able to use a sheet worker or use some sort of If/case statement to be able to calculate this without the API and if so, what would be the direction I would need to take? Individual Sheetworkers to monitor the dropdown and then pull the display value to change the maximum ammunition? Example below: I want to return "Pistol" so I can use that as a way to leverage some sort of if or case statement. <option value="@{agility}[Agi]+@{agilitymod}[Agimod]+@{discipline}[Dis]+@{disciplinemod}[Dismod]"> Pistol </option> Thanks!
1633665629

Edited 1633665693
GiGs
Pro
Sheet Author
API Scripter
You cant use if or select statements in macros (without some clunky cleverness supplied by Oosh of rainbow Encoder, perhaps). If you wabt to use the Pistol's value in mactos though you can just use the standard method of grabbing a stats value, one of these: @{pistol} - for abilities directly on the charactersheet. @{selected|pistol} - for tokens linked to a character sheet, the token must be selected @{NAME-OF-CHARACTER|pistol} - can use this anywhere, just need to replace the all caps name with the characters actual name. (Also, rename pistol in the above examples, with the name of the select.) If it's being used in a calculation in the macro, you might need to wrap it in brackets, like (@{pistol}) A sheet worker will only work if you change the calculation in pistol's value to a sheet worker.