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

Cthulhutech Sheet (V2)

1510310836

Edited 1510310946
Hey Everybody, I am hoping someone could help. I am currently in a campaign for Ctech and we have recently switched to V2 and roll20! We are currently using pjbehr87 and coalpowerpuppets' sheet? (the default one on the system that works with the API ctech dice.) I am currently *trying* to edit the sheet so it works with the new rules (a.k.a the roll has a difficulty rating, and depending on the rating you would minus dice from the roll) Currently, through a bunch of fiddling, I have managed to get a drop down to appear which allows me to select the difficulty and that in turn removes the appropriate amount of dice. But I have trying to work out if there is a way to show what has been selected in the roll template?  So far, the roll template will show, the character name, The check and the results, I am wondering if there is a way I can show what difficulty was selected. This is what i currently have -                                 <tr>                                     <th><button type="roll" class="sheet-feat_button" name="attr_feat_Agility" value="!ct [[ [[ floor([[@{Agi}]] /2)- [[?{Choose Diffculty|Average/ Easy, 0|Challenging (- 1d10), 1|Hard (- 2d10), 2|Very Hard (- 3d10), 3| Legendary (- 4d10), 4}]] ]]d10 ]] [[@{agi}]] --|@{character_name} --Feat: Agility -- ">Agility</button></th>                                     <td><input type="number" class="sheet-attribute1" name="attr_rating_Agi_total" value="[[@{Agi}]]" disabled/></td>                                     <td><input type="number" class="sheet-attribute" name="attr_rating_Agi_base" value="0"/></td>                                     <td><input type="number" class="sheet-attribute" name="attr_rating_Agi_mod" value="0"/></td>                                     <td><input type="number" class="sheet-attribute" name="attr_rating_Agi_Feat" value="floor(@{Agi}/2)" disabled="true"/></td>                                 </tr> I am a bit of a novice when it comes to this so any help would be amazing!
1510314807

Edited 1510316500
Jakob
Sheet Author
API Scripter
So, there's two things you would have to do: 1) (harder part) Modify the API script to accept a difficulty option, i.e. --Difficulty X, and output that with the roll template (might need to modify the roll template as well, I haven't looked at how it works exactly).   2) (easy part) Append "--Difficulty|?{Choose Diffculty}" (typo by the way) to the value of your buttons so pressing the button sends the difficulty you have chosen to the script. This relies on the fact that repeating a query later in a macro will just send the same input as the first query. Actually, Step 1 may not be necessary. You can just try modding the button's value like below and it may actually work already, to some extent. However, you will only get the difficulty as a number (0, ..., 4) unless you modify the script, since your query just spits out a number. It would however not be a very hard modification, from a quick inspection, to hack the script such that it turns this number into the corresponding difficulty string.
I can't seem to get it to work :(
1510317274

Edited 1510317358
Jakob
Sheet Author
API Scripter
What part doesn't work? Sending a chat message like this doesn't show the difficulty (as a number)? !ct [[ [[ floor([[5]] /2)- [[?{Choose Difficulty|Average/ Easy, 0|Challenging (- 1d10), 1|Hard (- 2d10), 2|Very Hard (- 3d10), 3| Legendary (- 4d10), 4}]] ]]d10 ]] [[5]] --|Test name --Feat: Agility --Difficulty|?{Choose Difficulty} EDIT: Replaced @{agi} and @{character_name} with 5 and Test name so that it works outside character abilities.
1510317524

Edited 1510317538
This worked, I am not sure what I did wrong? Thank you for all your help :)
Sorry You had said the script could be hacked to show the difficulty rather than the number, is this very hard to do?  
1510325376
Jakob
Sheet Author
API Scripter
I assume you're using  this script? Then it should be as simple as inserting the following in line 88: optional.forEach(array => { if (array && array[0] === 'Difficulty' && array[1]) { array[1] = array[1] .replace('0', 'Average/Easy') .replace('1', 'Challenging') .replace('2', 'Hard') .replace('3', 'Very Hard') .replace('4', 'Legendary'); } });