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

Using PowerCards in conjunction with ChatSetAttr

March 02 (4 years ago)

Edited March 02 (4 years ago)

Greetings everyone,

I have recently discovered PowerCards and a series of tutorial that helped me understand the basics of this amazing and very potent script. Until then, I was using the regular R20 Template since I am running games on a custom system and have no real knowledge in programming. I know a bit of HTML but no Javascript at all, even though I have become pretty knowledgeable in using the macro system of Roll20.

That being said,

In my games, I am using ChatSetAttr to automatically remove Mana (or Ressource) from my spellcasters, manage other ressources ,etc...

While my current system still works with the addition of Powercards, I was wondering if it could be possible to use ChatSetAttr (or any other system) to do "damaging" attacks and spells. This is currently a base exemple of one powercard that I'm using :

!power {{
  --name|Burning Strike
  --format|Gurr
  --Ability:|Combat

  --Roll:|[[ [$Roll]1D20]] + [[@{Gurr|Strength}+@{Gurr|Proficiency}]]

  --?? $Roll.base < @{Gurr|Critical} ?? Damage:|[[@{Gurr|WeapPhy}+14+@{Gurr|ATTACK}]] Fire damage
--?? $Roll.base == @{Gurr|Critical} AND $Roll.base <> 20 ?? Critical damage:|[[(round((@{Gurr|WeapPhy}+14+@{Gurr|ATTACK})*1.5))]] Fire damage
--?? $Roll.base == 20 ?? Critical success damage:|[[(round((@{Gurr|WeapPhy}+14+@{Gurr|ATTACK})*2))]] Fire damage
--Effect|[irrelevant] --Action Point:|1 --Cost:|[[40]] Energy --Available:|Turn [[@{tracker|Current Turn}+3]] }} !modbattr --silent --name Gurr --Energy|-40

TL;DR : in this system, characters can critically hit in two different ways, first by meeting a threshold that is set by their gear/stats, which multiplies total damage by x1,5 and then by doing a regular natural 20 that doubles the damage x2.

Right now as you can see, the character Gurr is using 40 Energy to use this Ability, but I would also like to automatically be able to deal damage to enemies, based on the roll.

Basically, each damage would be registered as [$Dmg], [$CritDmg] and [$CritSuccessDMG] and then that would be dealt to the @{target|HP} in some way.

I have spent 3-4 hours trying to figure this out yesterday with no success whatsoever and I have come here in desperation. 

Can anyone provide help or tips to make this work ?

Thank you in advance,

Boris.

March 02 (4 years ago)

Edited March 02 (4 years ago)

I'lll try to help you the best I can :)




Boris said:

Greetings everyone,

I have recently discovered PowerCards and a series of tutorial that helped me understand the basics of this amazing and very potent script. Until then, I was using the regular R20 Template since I am running games on a custom system and have no real knowledge in programming. I know a bit of HTML but no Javascript at all, even though I have become pretty knowledgeable in using the macro system of Roll20.

That being said,

In my games, I am using ChatSetAttr to automatically remove Mana (or Ressource) from my spellcasters, manage other ressources ,etc...

While my current system still works with the addition of Powercards, I was wondering if it could be possible to use ChatSetAttr (or any other system) to do "damaging" attacks and spells. This is currently a base exemple of one powercard that I'm using :

!power {{
  --name|Burning Strike
  --format|Gurr
  --Ability:|Combat

  --Roll:|[[ [$Roll]1D20]] + [[@{Gurr|Strength}+@{Gurr|Proficiency}]]

  --?? $Roll.base < @{Gurr|Critical} ?? Damage:|[[@{Gurr|WeapPhy}+14+@{Gurr|ATTACK}]] Fire damage
--?? $Roll.base == @{Gurr|Critical} AND $Roll.base <> 20 ?? Critical damage:|[[(round((@{Gurr|WeapPhy}+14+@{Gurr|ATTACK})*1.5))]] Fire damage
--?? $Roll.base == 20 ?? Critical success damage:|[[(round((@{Gurr|WeapPhy}+14+@{Gurr|ATTACK})*2))]] Fire damage
--Effect|[irrelevant] --Action Point:|1 --Cost:|[[40]] Energy --Available:|Turn [[@{tracker|Current Turn}+3]] }} !modbattr --silent --name Gurr --Energy|-40

TL;DR : in this system, characters can critically hit in two different ways, first by meeting a threshold that is set by their gear/stats, which multiplies total damage by x1,5 and then by doing a regular natural 20 that doubles the damage x2.

Right now as you can see, the character Gurr is using 40 Energy to use this Ability, but I would also like to automatically be able to deal damage to enemies, based on the roll.

Basically, each damage would be registered as [$Dmg], [$CritDmg] and [$CritSuccessDMG] and then that would be dealt to the @{target|HP} in some way.

I have spent 3-4 hours trying to figure this out yesterday with no success whatsoever and I have come here in desperation. 

Can anyone provide help or tips to make this work ?

Thank you in advance,

Boris.

  --Roll:|[[ [$Roll]1D20]] + [[@{Gurr|Strength}+@{Gurr|Proficiency}]]

 should be

  --Roll:|[[ [$Roll] 1d20 + @{Gurr|Strength} + @{Gurr|Proficiency} ]]

"Strength" and "Proficiency" should be listed as they appear in Gurr's Atributes and Abilities tab and need to include a numerical input if being used in a roll equation. For example, Proficiency in 5E is "@{selected|pb}", Strength can be "@{selected|strength_mod}" or "@{selected|strength}". Atributes are case-sensitive. The roll also should have spaces between value (IE [[ [$Atk] 1d20 + @{Gurr|strenght} ]]). The roll will also need a RollID, which can be referenced further below in the PowerCard.


 --?? $Roll.base < @{Gurr|Critical} ?? Damage:|[[@{Gurr|WeapPhy}+14+@{Gurr|ATTACK}]] Fire damage

Should be split into two parts.

--hroll|[[ [$CriticalDmg] @{Gurr|WeapPhy} + 14 + @{Gurr|ATTACK} ]] 

Can be rolled if you have attributes with numerical values on Gurr's atributes and abilities tab for "WeapPhy" and "ATTACK". After you put the hidden roll line (usually below tokenID line)

 --?? $Roll.base <= @{Gurr|Critical} ?? Damage:|[^CriticalDmg.total] Fire damage

Will display the results of the hidden roll.

This is as far as I've gotten and my lunch is over, I'll work on it more later, best of luck Boris!



Speaking of which, you should also have a couple of lines such as the following (unless you have them somewhere else and didnt use them)

!power {{
  --name|Burning Strike

  --tokenid|@{selected|token_id}
  --targetlist|@{target|token_id}

--hroll|[[ [$CriticalDmg] @{Gurr|WeapPhy} + 14 + @{Gurr|ATTACK} ]] 
  --format|Gurr
  --Ability:|Combat

  --Roll:|[[ [$Roll] 1d20 + @{Gurr|Strength} + @{Gurr|Proficiency} ]]

  --?? $Roll.base < @{Gurr|Critical} ?? Damage:|[^CriticalDmg.total] Fire damage
  --?? $Roll.base == @{Gurr|Critical} AND $Roll.base <> 20 ?? Critical damage:|[[(round((@{Gurr|WeapPhy}+14+@{Gurr|ATTACK})*1.5))]] Fire damage
--?? $Roll.base == 20 ?? Critical success damage:|[[(round((@{Gurr|WeapPhy}+14+@{Gurr|ATTACK})*2))]] Fire damage
--Effect|[irrelevant] --Action Point:|1 --Cost:|[[40]] Energy --Available:|Turn [[@{tracker|Current Turn}+3]] }} !modbattr --silent --name Gurr --Energy|-40


Please forgive the messed up formatting :p

March 02 (4 years ago)

Thank you for your answer during your break, I have no words for how much I appreciate the efforts.

My takeaway from this is that I am going to need to have a RollID if I want to use the roll to check for the creature's AC and then deal the damage ?

Also, thanks for the corrections on the script, I had forgotten to format it so that I could use Roll.base and Roll.total

 --?? $Roll.base < @{Gurr|Critical} ?? Damage:|[[@{Gurr|WeapPhy}+14+@{Gurr|ATTACK}]] Fire damage

Should be split into two parts.

--hroll|[[ [$CriticalDmg] @{Gurr|WeapPhy} + 14 + @{Gurr|ATTACK} ]] 

Can be rolled if you have attributes with numerical values on Gurr's atributes and abilities tab for "WeapPhy" and "ATTACK". After you put the hidden roll line (usually below tokenID line)

 --?? $Roll.base <= @{Gurr|Critical} ?? Damage:|[^CriticalDmg.total] Fire damage

Will display the results of the hidden roll.

I am not sure that I have understood all this correctly but let me add a few clarifications :

  • All the "attributes" that I am referencing contain a numeral value, that includes Critical, WeapPhy, etc... 
  • The goal is to set up 3 rolls of damage and use the appropriate one, with roll n°1 being [[X]], roll n°2 being [[round(((X)*1,5))]] and roll n°3 being [[round(((X)*2))]].

My goal is to have each of these rolls identified (currently as Damage, CriticalDamage, CriticalSuccessDamage, or something) and then whenever the base dice roll ($roll) hits the conditions which are :

  1. Below Gurr's Critical Threshold (e.g. 18) → Damage
  2. Equal to or above Gurr's Critical Threshold, but not 20 (so 18 and 20) → CriticalDamage
  3. Equal to 20 → CriticalSuccessDamage

, it would automatically deal damage to the targeted token. Does that make sense ?


TL;DR: Use PowerCards to dynamically modify the displayed damage based on whether the roll is a normal (x1), critical (x1.5) or critical success (x2) and then modify the damage dealt to the targeted token adequately.

Thank you again !