feature/form_bbcode

load previous
Mar 1, 2022 3:57 pm
Chalrytharendir says:

It might be nice if it renders with the calculated value, mainly because the variable are internal to the sheet, so the creator of the sheet will understand them, but users of the sheet might not understand unless the variable names are well chosen.

I don't think this is a critical fix, but I thought it was worth noting.
This was one of those Oh dear gods, no. moments. You're right, but abilities and snippets were always designed to show the raw BBCode and changing it to be half BBCode and half calculated html was a little daunting.

Anyway, I've done that (on staging)
Also, we have two new functions.

* lookupBonus(val, 1,3,-3, 4,5,-2, 6,8,-1, 9,12,0, 13,15,1, 16,17,2, 18,18,3)

This takes val and looks for it in the triples. If val is inclusively between 1 and 3 return -3. If between 4 and 5 return -2. etc.

* dwBonus(12) This is a shortcut for dungeon world players so they don't need that whole mess of lookupBonus code.
Quote
Mar 1, 2022 4:02 pm
Adam says:
* dwBonus(12) This is a shortcut for dungeon world players so they don't need that whole mess of lookupBonus code.
Very nice.

It would be cool if GMs could add their own shortcuts to the game's Advanced Rules Definitions (by the Dice Highlighting).
Quote
Mar 1, 2022 7:23 pm
I'm really grateful that you code-savvy and gm-experienced people stepped up for this. Looking forward to break test these stuff.
Quote
Mar 1, 2022 10:56 pm
Adam says:
This was one of those Oh dear gods, no. moments. You're right, but abilities and snippets were always designed to show the raw BBCode and changing it to be half BBCode and half calculated html was a little daunting.

Anyway, I've done that (on staging)
Awesome! I just tested this as well as both lookupBonus() and dwBonus() and they all work well.
vagueGM says:
It would be cool if GMs could add their own shortcuts to the game's Advanced Rules Definitions (by the Dice Highlighting).
I like this idea, but I think Adam mentioned on discord that this could open up security issues, so they need to be built-in unfortunately.

Thanks for the fix and addition! I'll go have some more fun breaking testing things, as Antiproduct suggests XD
Quote
Mar 2, 2022 4:56 am
Chalrytharendir says:
... I think Adam mentioned on discord that this could open up security issues, so they need to be built-in unfortunately ...
Yes, that is a concern.

I was more proposing a macro system like dwBonus, which would just be another name for for a specifically defined lookupBonus or other existing expansion. But it is not really worth the risk since those types of things are mainly only used during character creation (or occasionally when Stats change), and once constructed (which they would need to be no matter what) they can just be copy/pasted.

You do not have permission to post in this thread.