symposion / roll20-shaped-scripts

Support script for 5e Shaped Character Sheet on Roll20.net
http://roll20.net/
7 stars 5 forks source link

Macros with "per use" set to 0 are incorrectly reducing the uses #487

Closed mlenser closed 7 years ago

mlenser commented 7 years ago

{{per_use=0}} seems to be ignored. Full macro:

@{Ungrim|output_option} &{template:5e-shaped} {{character_name=@{Ungrim|character_name}}} @{Ungrim|show_character_name} {{title=Chainsaw}} {{action=1}} @{Ungrim|attacher_attack} @{Ungrim|hide_gm_info} {{@{Ungrim|shaped_d20}=1}} {{uses=10}} {{uses_max=10}} {{per_use=0}} {{repeating_item=repeating_attack_-kgubqrbo6qtvldx6t4s}} {{attack_type_macro=[Melee Weapon Attack:](~-Kc3TzA70UIiXVHspZlg|repeating_attack_-KgubQRbo6qTvLdx6T4S_attack)}} {{has_attack_damage=1}} {{attack_damage_crit=[[2d8]]}} {{attack_damage=[[2d8[damage] + 4[str] + 2[melee weapon damage modifier]]]}} {{attack_damage_type=slashing}} {{has_attack_damage=1}} {{attack_damage_macro=[Hit:](~-Kc3TzA70UIiXVHspZlg|repeating_attack_-KgubQRbo6qTvLdx6T4S_attack_damage)}} {{attack_damage_crit_macro=[Crit:](~-Kc3TzA70UIiXVHspZlg|repeating_attack_-KgubQRbo6qTvLdx6T4S_attack_damage_crit)}} {{attack1=[[@{Ungrim|shaped_d20}@{Ungrim|d20_mod} + 3[proficient] + 4[str]]]}}

symposion commented 7 years ago

Yeah, I think I default it to 1 if it's zero, on the assumption that per_use=0 was probably a missing per_use value. If the only way for per_use to equal zero is if it's set intentionally I can easily change it to honour that. Out of interest, what's the use case for having uses but a per_use=0?

mlenser commented 7 years ago

In the specific case I have a homebrew weapon that uses a battery, but the battery is only used to turn it on and it lasts for an hour. Each attack doesn't consume a use.

I'm likely going to remove the qty field soon and uses will function similarly. See https://app.roll20.net/forum/permalink/5020271/ for that. In which case it's more important that not ever activation is a use.

While in this area of code perhaps consider adding support for the new self output, perhaps using "{{dont_use=1}}" which would prevent a spell or use from being consumed if it's sent to the output.

thorsteneb commented 7 years ago

Behavior changed so that per_use of 0 is not going to decrement. Empty per_use still defaults to "1".

While in this area of code perhaps consider adding support for the new self output, perhaps using "{{dont_use=1}}" which would prevent a spell or use from being consumed if it's sent to the output.

Please explain. What is "the new self output"? Who would send dont_use=1, the character sheet? When does the sheet send that? By "when" I mean, what in the configuration of something with uses corresponds to dont_use=1 being sent?

mlenser commented 7 years ago

new self output: I store values on sheet_chat_output and Lucian setup the script to output them. It's basically used for outputting a roll template from pseudo buttons on the sheet.

mlenser commented 7 years ago

Resolved as part of 11.0.0