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

Help adjusting 5e OGL Resources created by player

Can someone help me add code to my macro for a Short Rest to alter Resources I create on the 5e OGL sheet please, for example, Rage?
1497626915
Ziechael
Forum Champion
Sheet Author
API Scripter
What have you got so far? There is no shortage of people who will jump in to help but they'll need to see what the starting point is :)
1497627556

Edited 1497627632
/me Dinbrik refills his ammo! @{Dinbrik Grimspark|other_resource} = 40 and ty for such a fast reply! matt
1497628183

Edited 1497628265
Ziechael
Forum Champion
Sheet Author
API Scripter
First off, attributes can't be amended from macros alone. You'd need something like  ChatSetAttr installed first (which requires the game creator to be a Pro... stated for reference since you are one ;) ) With that script you can use chat commands to change attributes easily and quickly. You'd end up with something like: /me Dinbrik refills his ammo! !setattr {{ --sel --other_resource|40 }}
youre a greek god, thanks!!
1497628456
Ziechael
Forum Champion
Sheet Author
API Scripter
Just an ordinary guy who spends a disproportionate amount of time here ;) But thanks. Any other issues just post and I (or someone smarter) will get you sorted in no time at all :)
Ok the long rest (resetting ammo to 40) is working /me Dinbrik fully refills his Arcane Magazine to its max of 40! !setattr {{ --name Dinbrik Grimspark --other_resource|40 }} But the short rest, which adds 10, but cannot exceed max of 40, is not working.  can you assist pls? /me -  Dinbrik adds 10 rounds of ammo !setattr {{ --name Dinbrik Grimspark --evaluate --other_resource|min(40,%other_resource% + 10) }} thx!
UGH it was Math.min not min, sorry!  its working!!!!!
This should also work (if your resource's maximum is set to 40 on the sheet): !modbattr --name Dinbrik Grimspark --other_resource|10
ahh so its smart enough not to exceed max, excellent!  thx!