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

Chronicles of Darkness Werewolf Defence Problem

I'm looking at running a Werewolf/Changing Brreeds game for a friend and I'm having a problem sorting out an attack macro due to having to subtract the target's defence from the number of dice rolled.  I'm using the official Roll20 Chronicles of Darkness Character Sheet and using the Werewolf the Forsaken 2nd edition option on it, unfortunately it seems that whoever designed the character sheet forgot that shapechangers, change shape, and therefore their Physical Attributes can change, which means the defence changes. I've sorted it for the attack part by adding in the modified attributes on the attributes and abilities part of the general sheet (not the actual character sheet as it were), but the targets defence is giving me a problem.  What I ideally want is [[(?{attacker form| Human, @{selected|strength}| Near Human, @{selected|near_human_strength}| Warform, @{selected|war_beast_strength}} + @{selected|brawl}-?{targets defence in current form| Human, @{target|human_defence}| Near Human, @{target|near_human_defence}| War Beast, @{target|War_Beast_defence}})d10>8!!]] Defence is worked out as the lowest of Dexterity or Wits + the Athletics skill. I found this macro after a search witch works fine as a basic one [[ [[ { @{selected|Dexterity}, @{selected|Wits} }Kl1]] + [[@{selected|athletics}]] ]] What I need now is to be able to change the Dexterity depending on form and still have it choose the lowest of the dexterity and the wits.  I have created Attributes that I could target Human_Defence [[ [[ { @{selected|Dexterity}, @{selected|Wits} }Kl1]] + [[@{selected|athletics}]] ]] Near_Human_Defence [[ [[ { @{selected|Near_Human_Dexterity}, @{selected|Wits} }Kl1]] + [[@{selected|athletics}]] ]] War_Beast_Defence [[ [[ { @{selected|Warbeast_Dexterity}, @{selected|Wits} }Kl1]] + [[@{selected|athletics}]] ]] And then doing a query to just pick out the correct defence figure ?{current form| Human, @{human_defence}| Near Human,@{Near_Human_defence}| Warbeast, @{War_Beast_defence}} Unfortunetely I just can't get it to work.  I've read the bit on nesting macros in queries using alternatives to } , or | but I just seem to end up getting syntax errors not regocnising them or just nothing happening. Hopefully that all makes sense, sorry I don't know how to put the macro sections to appear in their own boxes (as most people show them)
1601599481

Edited 1601599905
Oosh
Sheet Author
API Scripter
Ok, so I think this should work: &{template:default} {{name=Attack Roll}} [[[[?{attacker form| Human,{@{selected|strength}[HUMAN]| Near Human,@{selected|near_human_strength}[NEAR]| Warform,@{selected|war_beast_strength}[WAR]} + @{selected|brawl}[BRAWL]-?{targets defence in current form| Human,[[{@{target|t1|dexterity},@{target|t1|wits}}kl1 + @{target|t1|athletics}]][HUMAN]| Near Human,[[{@{target|t1|near_human_dexterity},@{target|t1|wits}}kl1 + @{target|t1|athletics}]][NEAR]| War Beast,[[{@{target|t1|warbeast_dexterity},@{target|t1|wits}}kl1 + @{target|t1|athletics}]][WAR]}]]d10>8]] {{D10's rolled=$[[1]]}} {{Successes=$[[2]]}} A couple of things - you'll want to use some kind of target label to stop the multiple target calls ( t1 in this case, but it can be anything). It can also be annoying using a macro with both selected and target calls, as your token is un-selected when you click the target. Once you're happy with the macro, consider removing the selected completely, and putting a copy in each character sheet for each player as an Ability macro - that way they can run it repeatedly without having to constantly re-select their token. I've also thrown it into a basic template, and shown the "number of d10's to roll" calculation in the first row - this gives you a mouse-over to check that the correct defence & attack were selected via the [TAGS] included in the Query. The final problem, you were already part way to figuring out - it's an HTML entity issue. Since you're calling those Defence Attributes inside a Query, we need to replace the , and } in the "keep lowest" math, but not the } in the Attribute calls (this is due to order of operations). Are you using these Defence Attributes for anything else? Because the versions you need to use inside a Query won't work outside a Query, I've just put the defence calculation in the macro - you'll still need those human/near human/war beast ones though. By the way, you've got the war beast versions as : @{war_beast_strength} @{warbeast_dexterity} Not sure if the Dex one is a typo - if it is, you'll need to correct what I've got on the second last line. I also didn't go as far as creating all of those Attributes, so I didn't test the final code. Hopefully there are no other typos. One final thing, it's not a pretty output if the number of dice rolled is negative. I'm not sure if this is possible in your game or not, or if it bothers you at all. I mean, it should be pretty obvious that you're not going to hit if you're "rolling" -3d10. Hopefully it works, and I understood what's it's supposed to be doing... good luck.
That works, thank you so much, and yes, that was just a typo on my part.  I can work from that and hopefully come up withsomething that doesn't include the template but still works.  I prefer not to use the template for rolls as I'm partially sighted and it takes up far too much of the chat box, a simple inline roll works far better for me, in addition my player is Blue/Purple colour blind so a purple box on a blue backgound plays havok with his eyesight as well. As you mentioned it doesn't work it the answer comes out negative or zero, in game terms this means the attack would revert to a single D10 chance roll only succeding if a 10 is rolled.  I would think this is too much to ask of the macro so, as long as I know the macro works, if nothing happens then I can always check the maths to see if it should be a chance roll.
1601635582

Edited 1601635989
Oosh
Sheet Author
API Scripter
Ah roger that. Is this better? It'll always roll at least 1d10, and has no template: {{ Attack Roll! Successes: [[[[{[[?{attacker form| Human,@{selected|strength}[HUMAN]| Near Human,@{selected|near_human_strength}[NEAR]| Warform,@{selected|war_beast_strength}[WAR]} + @{selected|brawl}[BRAWL]-?{targets defence in current form| Human,[[{@{target|t1|dexterity},@{target|t1|wits}}kl1 + @{target|t1|athletics}]][HUMAN]| Near Human,[[{@{target|t1|near_human_dexterity},@{target|t1|wits}}kl1 + @{target|t1|athletics}]][NEAR]| War Beast,[[{@{target|t1|war_beast_dexterity},@{target|t1|wits}}kl1 + @{target|t1|athletics}]][WAR]}]],1}k1]]d10>8]] (D10 calculation: $[[1]]) }} edit - even better, you can hide those curly braces. Basically they allow you to have line breaks, but still use the $[[1]] call to show the inner roll (I was surprised this worked... but it seems to): [{{](#" style="display:none)Attack Roll! Successes: [[[[{[[?{attacker form| Human,@{selected|strength}[HUMAN]| Near Human,@{selected|near_human_strength}[NEAR]| Warform,@{selected|war_beast_strength}[WAR]} + @{selected|brawl}[BRAWL]-?{targets defence in current form| Human,[[{@{target|t1|dexterity},@{target|t1|wits}}kl1 + @{target|t1|athletics}]][HUMAN]| Near Human,[[{@{target|t1|near_human_dexterity},@{target|t1|wits}}kl1 + @{target|t1|athletics}]][NEAR]| War Beast,[[{@{target|t1|war_beast_dexterity},@{target|t1|wits}}kl1 + @{target|t1|athletics}]][WAR]}]],1}k1]]d10>8]] (D10 calculation: $[[1]]) [}}](#" style="display:none)
The majority of that is working great, the very last line (D10 calculation: $[[1]]) Is bringing up a number, but I'm not quite sure what it is or where it is from I need to play around with a selection of test characters to see what I can find out.  The $ isn't a symbol I've come across yet so I'm not sure quite what it should be doing.  Anyway, what you have done for me means i can at least get the game to run easily enough, there will be a bit of extra work in the background for me to get characters, both good and bad, set up, but on the actual (virtual) table top in the game it should all look nice and smooth. Thanks again for all the help.
1601686506
Oosh
Sheet Author
API Scripter
No problem - the $[[0]] references are used to call the roll information from a set of inline brackets, more info in the Stupid Tricks thread. It's an undocumented method for recovering information from a roll. So in this roll: [[  [[3d10]]  + 4d6 + ?{Modifier|8} ]] If we mouse-over the result, we only get the detail from the outer set of [[ ]] inline roll braces. The information on what the 3d10 results were is lost. But if we do this instead: Total Roll: [[  [[3d10]]   + 4d6 + ?{Modifier|8} ]]   --- (the 3d10 results were $[[0]] ) The $[[0]] call will pull the first inline roll information out, so you can mouse-over the result and see what each individual die roll of the 3d10 was. It doesn't change the roll itself, it's just a way of recovering information inside a complex roll. In the case of your macro, I put that in there so you could mouse-over the "d10 calculation" result to double-check that you or a player had selected the correct Query options. Sometimes a roll doesn't look right, or you think you might have picked the wrong defence option, with the $[[1]] mouse-over information you can check why the macro rolled 5 dice, and potentially pick up any errors. Without that roll reference, the main roll will only show you it rolled 5d10, but not how it arrived at the 5. There's no way of seeing if Human form or War Beast form was selected, for example. It's not changing the roll - you can just get rid of it if you don't like it, or it's creating confusion for people.
1601698408

Edited 1601698598
Oosh
Sheet Author
API Scripter
Oh, I also meant to mention Stylus. If you or your players have issues with the default appearance of Roll20 and find it hard to read, I'd highly recommend using Stylus to customise it. Any CSS you apply with the extension will only be visible to you, so if you have 2 players with different vision requirements, they can both see exactly the same content in completely different ways - you can change the colour of templates, backgrounds, the red and green crit dice, increase font sizes, move bits of character sheets around... basically any element that isn't part of the canvas (which is much more complicated) can be fully customised, including completely hiding it. For example, you mentioned having issues with the default template - here it is with a few quick edits. The purple is gone, and the background it posts against is just grey instead of blue (thanks Keith, borrowed some of your default template code): The bottom roll had a max die roll in it, so has the green border. A red/green colourblind players would only need to add another few lines of CSS edits and they could have blue / yellow for crit and fumble, or whatever colour they like. Or a full colourblind player could have different fonts/font sizes to indicate crits. I've just noticed I missed the border - there's still a thin purple line around the template... Oh well, that was only a few minutes work as an example :) I'd highly recommend taking the time to set it up - there's enough content in the Stylening thread , and enough helpful people, that you don't really need to understand the CSS/HTML to take advantage of it, you can just pinch what you need, and it will make the Roll20 experience much more enjoyable. Again, this won't effect anything for your players, unless they also install Stylus (or similar extension) and you share the CSS code with them.
1601708906

Edited 1601708935
Hey guys, i am trying to create a roll20 sheet of a modified version of WOD. After checking the guide and GitHub and everything, the part I am stuck is the WOD template. Existing HTML either does not use the WOD template or tooooo complicated, such as the  Chronicles of Darkness by Roll20. Is there any advice on how to use the template? Thank you so much.
Oosh, thank you for explaining that, and it is certainly something I will be looking into, but at sometime in the future, I'm having to take things one step at a time and trying to learn not only what to do, but why it it is done.  Six months ago, i knew nothing about coding, and had no interest in learning, I could barely write a /s macro in World of Warcraft to advertise a guild.  Then Covid happened, and once it became obvious that my main group of players wouldn't be getting back around a table any time soon I decided to check out on line option, and ended up on Roll20 as it was free (I fairly quickly realised that a Plus account would be worthwhile.  As I keep trying things out and asking questions, i've heard HTML, CSS and Javascript all mentioned as the basis of really pushing the boundaries.  While there may be a lot of scripts etc. available, I'm the type that likes to understand what I'm using, and how to adapt it to do what i really want it to do.  So 3 weeks ago I finally bit the bullet and signed up with Codecademy on their HTML course.  If nothing else it is a good and productive way to spend my time while sat at home.  Maybe one day I will be asking questions about how to creat character sheets for my games and how to adapt API scripts, but that is a long way off. Youtong W, I would love to be able to help, but anything like that is way beyond me at the moment.
1601720059
Oosh
Sheet Author
API Scripter
Oenanthe said: ... So 3 weeks ago I finally bit the bullet and signed up with Codecademy on their HTML course.  If nothing else it is a good and productive way to spend my time while sat at home.  Yep, it's fun pulling stuff apart to see what happens. I've learned more about HTML, CSS and JS using Roll20 than ever before. Yutong W. said: Hey guys, i am trying to create a roll20 sheet of a modified version of WOD. After checking the guide and GitHub and everything, the part I am stuck is the WOD template. Existing HTML either does not use the WOD template or tooooo complicated, such as the  Chronicles of Darkness by Roll20. Is there any advice on how to use the template? Thank you so much. When you say "template", do you mean the roll template? Roll templates are a part of the character sheet, except for &{template:default}, which is available in all R20 games, with or without a character sheet. Or do you mean a different kind of template?
Oosh said: When you say "template", do you mean the roll template? Roll templates are a part of the character sheet, except for &{template:default}, which is available in all R20 games, with or without a character sheet. Or do you mean a different kind of template? Yes, I do mean the roll template  <rolltemplate class="sheet-rolltemplate-wod"> .  Even after inputting the CSS, the line seems just does not trigger the template. And the way they did in  Chronicles of Darkness by Roll20  is really hard to understand. 
1601767845

Edited 1601768177
Oosh
Sheet Author
API Scripter
I'm not at all familiar with the sheet - you're probably best off starting a new thread over in the Character Sheets & Compendium section, but here goes... Do you know how to use the template itself - all the available fields etc.? You'll probably need to be pretty familiar with it to get it to work. The templates are generally called from a button. So for example, this section: <button type='roll' class="sheet-roll" name='roll_customRoll1' value="&{template:wod-3part} {{name=@{character_name}}} {{roll_name=@{customRollName1}}} {{mod=[[?{@{modifiermacro}|0}]]}} {{part1=@{part1name_1}}} {{part2=@{part2name_1}}} {{part3=@{part3name_1}}} {{part1pool=@{part1pool_1}}} {{part2pool=@{part2pool_1}}} {{part3pool=@{part3pool_1}}} {{result=[[{((?{@{modifiermacro}|0}+(@{part1pool_1}+0)+(@{part2pool_1}+0)+(@{part3pool_1}+0))@{rolltype}" ></button> Creates a button, and the value="" property constructs the roll and sends it to the &{wod-3part} template. That's how you send a roll to a template, and have it output to chat. The bit you've quoted is the HTML layout of the roll template - how to put it together and make it look pretty when it's called from somewhere on the sheet, it won't create the template itself. It doesn't look like any part of the sheet currently uses &{template:wod} though, it uses &{template:wod-3part} or &{template:wod-simple}, or the initiative one. Perhaps the {wod} template is deprecated - is there a particular reason you need that template? If you wish to modify the sheet so it uses &{template:wod} instead, you will need to edit all those <button> and <input> sections which are currently pointing to the other templates, change the &{template) call to the template you want to use, and then go through every field it uses to make sure it will work with the template change. I think. I'm not familiar with the game or the sheet, nor am I particularly able with HTML - you'll get more qualified help over in Character Sheets & Compendium, I'm a beginner with this kind of thing :)