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

5th Edition OGL by Roll20 Companion !npchp

Is there somewhere to set which bar represents hp? The issue I'm having is this: Game Settings:  BAR 1 VALUE:  npc_ac,  BAR 2 VALUE:  passive_wisdom,  BAR 3 VALUE:  hp_max,  BAR 3 MAX:  hp_max Drag and drop a Boar from MM1 onto the page, values are all okay: Bar 1: 11/<blank>, Bar 2: 9/<blank> Bar 3:  11/11 Type in !npchp boar /or/ highlight the boar token and type !npchp  ==>  Bar 1: 13/13 (which should have been npc_ac) Type in !npchp boar /or/ highlight the boar token and type !npchp  a second time  ==>  Bar 3: 12/12 (which is the hp) Type in !npchp boar /or/ highlight the boar token and type !npchp  a third time time  ==> Nothing changes There are attributes on the Boar sheet: cd_bar#_v, cd_bar#_m, cd_bar#_l which is should be able to find the correct bar # for hp, but it doesn't appear to be doing that.
1531748784
The Aaron
Pro
API Scripter
The issue is that the 5th Edition OGL Companion inspects the value of the bars to determine which one is used for HP.  It checks them in numeric order, so finds bar 1's 11 first and determines that must be the HP, so sets it to the new value.  The next time you run it, it finds the 11 in bar 3 and so changes that one.  The 3rd time, there are now bars that have 11, so it does nothing. I don't actually know anything about this script, other than what I just tracked down, but this seems like a bug in the method chosen for implementation.
The Aaron said: The issue is that the 5th Edition OGL Companion inspects the value of the bars to determine which one is used for HP.  It checks them in numeric order, so finds bar 1's 11 first and determines that must be the HP, so sets it to the new value.  The next time you run it, it finds the 11 in bar 3 and so changes that one.  The 3rd time, there are now bars that have 11, so it does nothing. I don't actually know anything about this script, other than what I just tracked down, but this seems like a bug in the method chosen for implementation. Right, my experience too. I have my tokens set up with HP in bar 2 and AC in bar 1. The scripts seems to fail always if AC = HP (avg). E.g. Derro have AC 13 and HP 13. If I use !npchp on them, the AC is randomized and becomes a bar instead of HP. I also had sometimes the issue that the script then crashed with some error messages. Problem is: how should the script know what the HP are (since for monsters these are not linked in the toekn)? I see only two ways: Look not only for the value == HP (avg), but also if there is a max values set (which is of course not for AC). Look into the Game Default Settings (where I set up that AC is bar 1 and HP is bar 2). The least error-prone solution seems to me the first one, since the Game Default Settings are a fragile thing :-) Who is responsible for the script? Is it possible to address him/her somehow? Because it's an awesome feature and I really would like to use it in my campaigns. And by the way: if the script would not look at HP(avg) at all, but only whether there is a bar with value = max and randomize this, you could run the script multiple times on the same tokens - which is currently not possible, because after the randomizing it can't find a bar with the HP value anymore. This would just bad for people using a bar for a different attribute with value = max (e.g. temp HP or something). But I think that is a rare case.
1536205278
The Aaron
Pro
API Scripter
Steve from Roll20 maintains that script.