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

Some html help needed?

I work on the buffy sheet for unisystem. I am a complete html noob. I try to streamline this part: value="/e attacks with @{melee_weapon_name-1}, rolling [[@{melee_weapon_attack_rating-1} + d10]] to hit and [[((@{melee_weapon_damage_base-1} + (@{melee_weapon_twohanded-1})*(@{melee_weapon_damage_Multiplier-1})))*(@{melee_weapon_damage_type-1})]] damage (add @{melee_weapon_damage_type-1} x Success Levels to damage)."></button></th> I need to have a variable for this [[@{melee_weapon_attack_rating-1} + d10]] = var1 and compare it to fixed values and create another variable var2 var1 =1-8 then var2 = 0 var1 =9-10 then var2 = 1 var1 =11-12 then var2 =2 and so on. var2 then needs to be added to the damage like this: [[((@{melee_weapon_damage_base-1} + (@{melee_weapon_twohanded-1})*(@{melee_weapon_damage_Multiplier-1})))*(@{melee_weapon_damage_type-1})]]+ (var2 *  (@{melee_weapon_damage_type-1})) can someone help me with this?
1592139616
Andreas J.
Forum Champion
Sheet Author
Translator
This seems to have little to do with HTML, and is all about how Roll20 macros , dice syntax and the saved attributes works. This is on the advanced side, and I'm not even sure you'd be able to do this with sheetworkers , but might require creating an API to create var2. Someone more knowledgeable with juggling this macro might be able to figure out a way to do this without API, but I suspect sheetworkers are still needed in some form. var1 =1-8 then var2 = 0 var1 =9-10 then var2 = 1 var1 =11-12 then var2 =2 and so on. I assume the pattern will continue with var2 increase by  "1"  for every increase of two on var1?  I.e. "var1= 13-14, then var2=3"
1592144969

Edited 1592145050
Thank you! I did not know that. The pattern will continue this way: 11-12=2, 13-14=3, 15-16=4 BUT from now on it gets weird 17-20=5, and from now on every 3 so 21-23=6, 24-26=7, 27-29=8 and so on forever.
1592156367
GiGs
Pro
Sheet Author
API Scripter
The unisystem progression makes it probably-impossible to do this without an API script.
any advice how I could get started with the api?