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

Max hp not understanding the result of another Attribute when deploying token on the board

1730636305

Edited 1730650903
Hello, im starting to have a little fun with doing my own macros and abilities in the 2014 5E character sheets, but I just ran into a problem with the max hp of a token when I place it on the board. This npc token is an extension of a character token and its stats change depending of this one character.  In the attribute page of the npc token i have a custom attribute that I've called "nivel" (level but in spanish just ignore it) that attribute calls to the character sheet of the player where a class resource returns a custom number that I can change when I please, lets say this number is 2 for the example. In the max hp slot of the npc sheet I write a simple string that reads "5+10*@{nivel}" the result that I would look for is 5+10*2 and when calling @{name|hp|max} in text chat it does indeed display 5+10*2 But even tho the the function works fine, when I drop the token on the board the hp bar displays just 5+10* it doesn't even try to sum the 5+10. Just out of curiosity I removed the *@{nivel} section out of the max hp slot and the operation 5+10 would then work when i drop the token in the board, giving the number 15. The bar is able to read attributes fine like @{hp|max} but it seems that if the value comes from another sheet I hit a wall even if I use the keyword as a means to refer to another sheet.  Sorry for my english but if anyone has any idea of how to solve or surround this problem i would die happy, every help is welcomed.
1730656755

Edited 1730656831
Gauss
Forum Champion
Hi Didac A.,  Calculations will not display calculated values in the Token's bars. For that you need an intermediate step such as an API Script or a Character sheet's sheetworker calculation.  To put it another way:  Attribute "A" has 5+10*@{nivel} A Script calculates the value of Attribute "A" and pushes that into Attribute "B" Attribute "B" now has a value and can be used for the token's bubble.  If your Game's Owner has a pro account a script such as ChatSetAttr, could do the job. Or, if you need the max HP to react to changes automatically you will need some script that includes a listener. In that case I'd ask the Mods (API Scripts) forum.
Hi Gauss, thank you for the answer Looking into it now i see how the bar works, tho I still cant get around the fact that the bar fails to read said attribute even if I omit any calculation. I'm essentially putting the following inside the @{hp|max} attribute --> @{Ilm|repeating_resource_left_resource_left} the value of which is 2 without doing any calculation, the key thing is that this value is extracted from a different character sheet named "Ilm" and the result when dropping the token on the board turns out to be blank. Does the token bar fail at reading attributes from other sources aside from its own sheet?? If that is the case is the setAttr the only way of inputting the correct lecture? Thanks again for answering if you could i would like to know a little bit more about how the bar works when it interacts with different prompts like Attributes, abilities or macros 
1730659065
GiGs
Pro
Sheet Author
API Scripter
Shes can't read from other sheets. There are some things  roll20 that can (like, for instance, macros) and to complicate things, sheets can include macros. But attribute values cannot include identities that point to another sheet. (To be pedantic, there is a way around thisd, usinf character ids - but this is not documented or supported, and recommended only to people who really know what they are doing.) So in short - you can't link max hp and show it in a token bar, if it is linked to another character sheet.
Hi GiGs, I see that this is then something that just does not work then sadly, every other stat affected by the other sheet seems to work tho, I guess it is because it affects things that appear in the text chat. Traits, attacks, pb and initiative do not give any trouble in this sense, but the token bar does not work like a chat input so no reading from other sheets then I guess.  If it is no bother can you expand on the character ids theme? or know a way to make the bar read the value of a macro/ability, ive tryed to put a macro (#) and an ability (%) inside the @{hp|max} attribute but the resulting token bar comes with a blank response in both cases... is it also unable to read abilities and macros?
1730664110

Edited 1730664136
GiGs
Pro
Sheet Author
API Scripter
Didac A. said: If it is no bother can you expand on the character ids theme? or know a way to make the bar read the value of a macro/ability, I'm sorry, I can't help with the first part. I am going to start a project that will answer that, but it won't be for a while - you shouldn't wait for me. Failing that, I have two ideas (and a summary you might not like to hear, but really have to face). Use Custom Roll Parsing in combination with target. Tokens could periodically grab the hit point max value from the target: just click a button, select the token representing the character who has the hp (and any other attributes) you want, and they'll be copied to the character and stay there till you do it again. Do the same as step 1 with no automation. Just look at the character who has the HP you want, and mqaually type them into a space on the character that needs to be updated. Both steps abandon automation, and you need to ask yourself, why do you need to grab these values from another character anyway? Roll20 isn't really designed for what you want, and you'll likely be fighting it at every step of the way. Step #2 above is the easiest approach.