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

[Script Help] Universal bonus/penalty script

1450642547
Tom
Plus
Sheet Author
I need help with a script idea, assuming its even possible within the scope of Roll20. I'd like to find a good way, as a GM, to impose a "universal" bonus or penalty (mainly penalties) on my players. Example, fighting at night or in pitch darkness.  Rather than having to constantly remind each player each round for X rounds to apply a penalty to their dice pools, it would be so nice to just be able to dial a penalty up that would apply to all the characters until I turn it off.   Has anyone already done something like this? If not, anyone interested in putting one together? thanks,  Tom
1450668830
The Aaron
Pro
API Scripter
Hmm.  How would you see that working?  It seems like it might be very system dependent.  I naive implementation might be to just have a script that reads each chat message with an inline roll, or each /roll message and sends a message like: Roll Adjusted: 17 - 2 [Darkness] = 15 That would be pretty easy, but you'd see it on all attack rolls and damage rolls and skill checks, etc.. Anything more complicated might be difficult to configure.  Thoughts?
1450702218
Tom
Plus
Sheet Author
Aaron, Hmmm...that's a very good point about not wanting it to apply to damage rolls. i suppose what you could do is have it apply to an Attribute that normally defaults to 0. So the GM sets the "condition" value at the beginning of combat and it affects all rolls that reference that attribute. So the script would do the following: 1) set a "hidden" attribute for all players, perhaps through a separate token, and maybe 2) prompt the GM each round of the condition still exists yes, the penalties would have to be system dependent, but depending on how the script is structured, I would think you could adjust it on a game by game basis. I don't think it could do Advantage//Disadvantage, but setting the "condition" attribute at -X dice, -X, or -xx% wouldn't be too hard, would it?
1450702346
Tom
Plus
Sheet Author
I suppose the low tech alternative would be to create some "condition card" images that I could just drop on the screen to prompt the players to do this themselves.
1450703078
The Aaron
Pro
API Scripter
The low tech sounds a bit more feasible currently. :/ The API can certainly add attributes, but unless you control all the macros/abilities the players are using, you still have the problem is when to apply the attribute. The attribute is just a storage option. 
The easiest way would require players to add a label to all their attack rolls like [[ [Atk] 1d20 + 0 ]] and then the api script would only apply the global modifier to rolls with the correct label.
1450707644

Edited 1450721282
Ziechael
Forum Champion
Sheet Author
API Scripter
For true global elements I have dabbled in the past with a DM token which has 6 potential values I can use for things, by incorporating these values in a variety of ways you could have global values that affect attack, damage, skill checks etc and depending on the number of values needed you could even have them for PC's and NPC's separately, eg: DMToken -  Bar 1 - PC Attack (value) / Damage (max) Bar 1 - NPC Attack (value) / Damage (max) Bar 3 - Global Skill Variable (value) / Global General Variable (max) Then with rolls incorporating these you have yourself an easily adjustable variable enforcer: Attack = [[1d20 + @{DMToken|bar1} + ?{other stuff|0} ]] etc Damage = [[1d8 + @{DMToken|bar1|max} + ?{other stuff|0} ]] etc Skills = [[1d20 + @{DMToken|bar3} + ?{other stuff|0} ]] etc
The DM token is a nice way to do that without using an api. Awesome.
1450727778
The Aaron
Pro
API Scripter
That is a good option!  You don't actually have to have a token for that either, just a character and then you can name the attributes more appropriately.  =D  I think OldSchoolChris was the first person I saw doing something similar. =D 
1450776655
Ziechael
Forum Champion
Sheet Author
API Scripter
True, I did think of a character but until charMod is complete there would be no quick and easy way to change the values on the fly ;) (apart from opening the sheet and changing them there but that is like a whole 2 or 3 clicks!!!!)
1451669670
Tom
Plus
Sheet Author
The idea of a DMToken sounds intriguing.  But how would something like that interface with a character sheet?  Most of my players use the roll buttons built into the character sheet.  Would I have to adjust every one to read the DMToken?  Or am I missing something?
1451671990
The Aaron
Pro
API Scripter
You are correct, you'd have to adjust everyone's character sheet to reference the master in some way.  Using a DM Character would probably be better as it would work across pages where the token doesn't exist anymore.  You'd likely go into each player's character's sheet and add something like @{DMAdjustments|toHit} to the appropriate fields.  Then you'd just have to adjust the attributes on that character when you need to give them a + or -.  The major drawback from your original situation is that you couldn't be selective about who gets the bonus among the characters.
I believe the 5e sheet has a field that lets you automatically add a global modifier to all attack rolls. You could put the DMCharacter mods there.