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
This post has been closed. You can still view previous posts, but you can't post any new replies.

[Script] PowerCards 3 (Thread 3)

November 20 (9 years ago)
Mister Sinister
Sheet Author
Hello. I'm having trouble with Macros, I haven't tried anything complex but i am getting me this message in Chat:



Hoping some one can suggest what I have done wrong. I have tested a few other people macros to check, but get the same message.

Thanks


November 20 (9 years ago)
Can't nest, but you can just add AND $Ammo.total >= 1 to the attack roll lines.

Oh duh, you're right!  Thanks HB!
November 20 (9 years ago)

FGIsembard said:

Hello. I'm having trouble with Macros, I haven't tried anything complex but i am getting me this message in Chat:

Hard to help without seeing the actual macro you're using. Does this work?

!power {{
--name|PowerCard Test
--!Test|This is a test.
}}
November 20 (9 years ago)
The Aaron
Pro
API Scripter

FGIsembard said:

Hello. I'm having trouble with Macros, I haven't tried anything complex but i am getting me this message in Chat:



Hoping some one can suggest what I have done wrong. I have tested a few other people macros to check, but get the same message.

Thanks



I'm guessing you don't have the {{ and }} in there around the arguments across multiple lines.
November 20 (9 years ago)
Oh duh... I'm dumb. I should go to bed. Been awake since 4pm yesterday.
November 20 (9 years ago)

Edited November 20 (9 years ago)
Mister Sinister
Sheet Author
Sorry, I knew I'd done something daft. I had copy/pasted the macro from a different game and not picked up the }} .

Thank You
November 20 (9 years ago)

Edited November 20 (9 years ago)
Mister Sinister
Sheet Author
Embarrassingly I had sat for over an hour looking at that, lol
November 20 (9 years ago)

Edited November 20 (9 years ago)
Sometimes when copying macros from here on the forums, the ! exclamation mark gets replaced by some html character entity or it adds an extra space in the macro... and that can also screw things up. Usually though, that one will still send !power into chat and not show any formatting changes.
November 20 (9 years ago)
The Aaron
Pro
API Scripter
Yeah, I've seen that before too.  I think it's actually coping some non-printing unicode character.  The ! must be at the start of the line.  If you put the cursor on the !, move left one with the arrow key and then delete back to the beginning a few times, it usually fixes it.
November 20 (9 years ago)

Edited November 20 (9 years ago)
Grrr...I'm still having issues with the trying to get the attack roll and such to not show when running out of ammo.  Again, probably something I'm boogering up.

As soon as I add in the "AND" statements checking the $Ammo variable, the macro breaks.  It prompts for a target and my roll query, but displays nothing after that.  Even if I take out the conditional on the end that would display that they're out of ammo.  Here's what I've got.  I appreciate your help.

!ammo @{selected|token_id} rangedammo1 -1
!power {{
--charid|@{character_id}
--emote|@{selected|token_name} pulls back a @{rangedweaponname1} and fires at @{target|token_name}!
--format|COMBAT
--corners|10
--titlefont|Arial
--titlefontsize|9
--subtitlefont|Arial
--name|**Ranged Attack**
--leftsub|**@{rangedweaponname1}**
--rightsub|**Range 80/320**
--Target:|$$#ff0000|**@{target|token_name}**$$
--Ammo:|[[ [$Ammo] @{rangedammo1} - 1 ]] out of [[ @{rangedammo1|max} ]]
--Attack:|[[ [$Atk] @{AdvDisadv} + @{dexterity_mod} + @{prof_bonus} ]] vs AC
--?? $Atk.total < @{target|npc_AC} AND $Atk.base <> 1 AND $Atk.base <> 20 AND $Ammo >= 1 ?? Miss:|The attack missed!
--?? $Atk.base == 1 AND $Ammo >= 1 ?? Critical Miss:|The attack was fumbled!
--?? $Atk.total >= @{target|npc_AC} AND $Atk.base <> 1 AND $Atk.base <> 20 AND $Ammo >= 1 ?? Hit:|You hit for [[ @{rangeddmg1} + @{dexterity_mod} ]] @{rangeddmgtype1} damage!
--?? $Atk.base == 20 AND $Ammo >= 1 ?? Critical Hit:|You decimate the **@{target|token_name}** for [[ (@{rangeddmg1} + @{dexterity_mod}) * 2 ]] @{rangeddmgtype1} damage!
--?? $Ammo.total <= 1 ?? Out of Ammo: You cannot attack with your @{rangedweaponname1}.
}}
November 20 (9 years ago)

HoneyBadger said:

Actually you should already be able to use --whisper|self,gm. If not, that would be easy to fix.

--whisper|self,foo,gm will output to foo and gm but not to self
November 20 (9 years ago)

Edited November 20 (9 years ago)
!ammo @{selected|token_id} rangedammo1 -1
!power {{
--name|**Ranged Attack**
-- ?? $Ammo < 0 ?? Out of Ammo:| You cannot attack [...].
-- ?? $Ammo >= 0 ?? 1 ammo used:|[[ [$Ammo|TXT] @{selected|rangedammo1} - 1 + 0d0 ]] of [[ [TXT] @{selected|rangedammo1|max} + 0d0 ]] now remaining.
-- ?? $Ammo >= 0 ?? Attack:|[[ [$Atk] 1d20 ]] vs AC
-- ?? $Ammo >= 0 AND $Atk.base == 1 ?? Critical Miss:|The attack was fumbled!
-- ?? $Ammo >= 0 AND $Atk.base <> 1 AND $Atk.base <> 20 AND $Atk < @{target|npc_AC} ?? Miss:|The attack missed!
-- ?? $Ammo >= 0 AND $Atk.base <> 1 AND $Atk.base <> 20 AND $Atk >= @{target|npc_AC} ?? Hit:|You hit [...]!
-- ?? $Ammo >= 0 AND $Atk.base == 20 ?? Critical Hit:|You decimate [...]!
}}
I made quite a few alterations/redactions (most for functionality; some for flavor) and a few corrections (e.g. added missing | to Out of Ammo: tag; added 0d0 to inline roll that defines $Ammo) to the core of your macro, Craig. Please let me know if you have any questions.
November 20 (9 years ago)
The Aaron
Pro
API Scripter
On line 446, change to this:
			_.each(PowerCard.whisper.split(","), function(y) {
				var resip = ('self' === y.trim() ? msg.who : y.trim());
				sendChat(msg.who, "/w " + resip + " " + Display);
			});
November 20 (9 years ago)

Silvyre said:

HoneyBadger said:

Actually you should already be able to use --whisper|self,gm. If not, that would be easy to fix.

--whisper|self,foo,gm will output to foo and gm but not to self

Ok. Will implement Aaron's little snippet.
November 20 (9 years ago)
THE HOLY CRAP IT'S AN UPDATE TO POWERCARDS POST...

November 20th, 2015 ~ 4:30 pm eastern
  • Version: 3.2.11
  • Link: gist.github.com/Sky-Captain-13/452330a3d926b32da49c
  • Bugfix: You can now use self as part of multiple target whispers.
    • Example: --whisper|self,gm
    • Courtesy of TheAaron
  • Minor Bugfix: Added a blank line semi-colon at the start of the script to help reduce possible errors of a missing semi-colon in another script. Will not have any affect if you have no other scripts. Added after reading about it in one of TheAaron's other posts somewhere.
  • Update / Bugfix: Conditionals now properly test for both text and numbers. However, you're only going to get text from a roll query or attribute call and not an inline roll. So for example, in my D&D 5e game, I set up an attribute (AttackRoll ) on my character sheet and put ?{Attack|Standard, 1d20|w/Advantage, 2d20kh1|w/Disadvantage, 2d20kl1} in that attribute. I can now reference it via @{AttackRoll}. If I select Standard, it returns 1d20 and Advantage returns 2d20kh1. These conditionals are case sensitive. Yes does not equal yes or yEs or YEs or any combination other than Yes.
    • Example: -- ?? @{AttackRoll} == 2d20kh1 ?? Advantage|I have advantage!
    • Example: -- ?? ?{Flanking?|Yes|No} == Yes ??Flanking:|I am flanking!
    • Courtesy of Nate W.
November 21 (9 years ago)
Silvyre, thank you!  I had to tweak your solution a bit, but it is working great!  Thanks for your help!

Final solution for anyone wondering.  As long as the PC has at least 1 ammo to use the attack will go off.  If not, they'll get the dreaded "out of ammo" message.
--Ammo:|[[ [$Ammo] @{rangedammo1} - 1 + 0d0 ]] of [[ @{rangedammo1|max} + 0d0 ]] remaining.
--?? $Ammo < 0 ?? Out of Ammo:|You cannot attack with your @{rangedweaponname1}.
--?? $Ammo > 0 ?? Attack:|[[ [$Atk] @{AdvDisadv} + @{dexterity_mod} + @{prof_bonus} ]] vs AC
--?? $Ammo > 0 AND $Atk.total < @{target|npc_AC} AND $Atk.base <> 1 AND $Atk.base <> 20 ?? Miss:|The attack missed!
--?? $Ammo > 0 AND $Atk.base == 1 ?? Critical Miss:|The attack was fumbled!
--?? $Ammo > 0 AND $Atk.total >= @{target|npc_AC} AND $Atk.base <> 1 AND $Atk.base <> 20 ?? Hit:|You hit for [[ @{rangeddmg1} + @{dexterity_mod} ]] @{rangeddmgtype1} damage!
--?? $Ammo > 0 AND $Atk.base == 20 ?? Critical Hit:|You decimate the **@{target|token_name}** for [[ (@{rangeddmg1} + @{dexterity_mod}) * 2 ]] @{rangeddmgtype1} damage!
November 21 (9 years ago)
Cool. :) Heads up, though: if your @{rangedammo1} equals 1 when you use your macro, $Ammo will equal zero, and then nothing will display (hence $Ammo >= 0 instead of $Ammo > 0).
November 21 (9 years ago)
Mister Sinister
Sheet Author
Hello, once more I am after a little help. I have the following Macro:

!power {{
--charid|@{selected|character_id}
--emote|//@{selected|token_name} is attempting a Quick test...//
--orowbg|#F5DEB3
--erowbg|#FFFFF0
--name|Quick Test 
--leftsub|Attribute (roll under)

--hroll| Attribute [[ [$ATType] ?{Roll Type:|Quick, 0|Initiative, 1} +0d0 ]]

--?? $ATType == 0 ?? !Roll0:|**Quick:** [[ [nh|$ATQCK] 1d20]] vs [[@{selected|Quick} + ?{Roll Modifier|0}]]
--?? $ATType == 0 AND $ATQCK > @{selected|Quick} ?? ^Failure|
--?? $ATType == 0 AND $ATQCK <= @{selected|Quick} ?? ^Success|

--?? $ATType == 1 ?? !Roll1:|**Initiative:** [[ [nh|trkr] @{selected|Quick}d1]] ^^**Tiebreak:** [[1d20]]

}}

When I select to roll Quick from the Dropdown Menu it makes the roll and displays correctly but add the token to the Turn Tracker. I don't want it to do that.

When I select the Initiative roll from the drop down it asks for a roll modifer, which I only need for the quick roll. It too displays correctly in chat and adds the token to the tuen tracker. It is as if the 2 option are mingling a bit. Not sure how to fix it.

Thanks
November 21 (9 years ago)
The Aaron
Pro
API Scripter
All rolls are evaluated on the client side. Powercards just adjusts which ones are displayed. I think there might be a work around you can use for initiative, but I don't remember it off the top of my head. 
November 21 (9 years ago)
Here's a workaround that involves nesting tags within a Roll Query:
!power {{
--charid|@{selected|character_id}
--emote|//@{selected|token_name} is attempting a Quick test...//
--orowbg|#F5DEB3
--erowbg|#FFFFF0
--name|Quick Test 
--leftsub|Attribute (roll under)

?{Roll Type| Quick, --!Roll0:&#124;**Quick:** [[ [nh&#124;$ATQCK] 1d20]] vs [[@{selected|Quick} + ?{Roll Modifier&#124;0&#125;]] -- ?? $ATQCK > @{selected|Quick} ?? ^Failure&#124; -- ?? $ATQCK <= @{selected|Quick} ?? ^Success&#124; | Initiative, --!Roll1:&#124;**Initiative:** [[ [nh&#124;trkr] @{selected|Quick}d1]] ^^**Tiebreak:** [[1d20]] }

}}
November 21 (9 years ago)

The Aaron said:

All rolls are evaluated on the client side. Powercards just adjusts which ones are displayed. I think there might be a work around you can use for initiative, but I don't remember it off the top of my head. 

Someone else asked about not processing the content of stuff blocked by conditionals. I probably can, just need to look at the order things are processed.
November 21 (9 years ago)
Mister Sinister
Sheet Author

Silvyre said:

Here's a workaround that involves nesting tags within a Roll Query:
!power {{
--charid|@{selected|character_id}
--emote|//@{selected|token_name} is attempting a Quick test...//
--orowbg|#F5DEB3
--erowbg|#FFFFF0
--name|Quick Test 
--leftsub|Attribute (roll under)

?{Roll Type| Quick, --!Roll0:|**Quick:** [[ [nh|$ATQCK] 1d20]] vs [[@{selected|Quick} + ?{Roll Modifier|0}]] -- ?? $ATQCK > @{selected|Quick} ?? ^Failure| -- ?? $ATQCK <= @{selected|Quick} ?? ^Success| | Initiative, --!Roll1:|**Initiative:** [[ [nh|trkr] @{selected|Quick}d1]] ^^**Tiebreak:** [[1d20]] }

}}


Thank You. Works exactly as I wanted.
November 21 (9 years ago)
Ugh, I've spent too much time away from working on this script. There are spots where it's doing something that I can't remember why it's doing it... lol.
November 21 (9 years ago)
With the multiple whispers... Could you after adding the --whisper tag, then add an input box like ?{Who?} and list more than one person, i.e. player 2, player3, player5?
November 21 (9 years ago)
Yes.
November 21 (9 years ago)
Just keep in mind that if you'd have to replace the commas in such a list with HTML entities.
November 21 (9 years ago)

Silvyre said:

Just keep in mind that if you'd have to replace the commas in such a list with HTML entities.

Not in this case I believe. It would be --whisper|?{Whisper to|} and he would type the names in.
November 21 (9 years ago)

HoneyBadger said:

Silvyre said:

Just keep in mind that if you'd have to replace the commas in such a list with HTML entities.

Not in this case I believe. It would be --whisper|?{Whisper to|} and he would type the names in.

Ah, yes—you're right. In fact, it appears that, so long as there isn't more than one vertical bar in a Roll Query, commas don't break Roll Queries.
November 21 (9 years ago)

HoneyBadger said:

Silvyre said:

Just keep in mind that if you'd have to replace the commas in such a list with HTML entities.

Not in this case I believe. It would be --whisper|?{Whisper to|} and he would type the names in.

Getting this error when I try my code:

TypeError: Cannot read property 'substring' of undefined
Here is the code:
!power {{
--charid|@{character_id}
--emote|**@{selected|token_name}** is speaking in ?{What language are you speaking?}
--name|Languages


--whisper|?{Whisper to?} ?{Message..}
}}
Any ideas?

November 21 (9 years ago)
The only thing that should be placed within whisper tag is a list of names separated by commas. You'll need to place your message Roll Query within another tag.
November 21 (9 years ago)

Silvyre said:

The only thing that should be placed within whisper tag is a list of names separated by commas. You'll need to place your message Roll Query within another tag.

Changed code to this:

!power {{
--charid|@{character_id}
--emote|**@{selected|token_name}** is speaking in ?{What language are you speaking?}
--name|Languages


--whisper|?{Whisper to?} 


--!Message|?{Message..}
}}

And I'm still getting the 'substring' error.
November 21 (9 years ago)
Arthur, would you mind troubleshooting your issue by incrementally removing tags from your macro until your error ceases to pinpoint its source?
November 21 (9 years ago)

Edited November 21 (9 years ago)
I dunno. I just tested it and it worked fine for me.
November 21 (9 years ago)

Silvyre said:

Arthur, would you mind troubleshooting your issue by incrementally removing tags from your macro until your error ceases to pinpoint its source?

It seems to be the --charid tag that's throwing it off.
November 21 (9 years ago)
Do this as a macro for me please: @{character_id} and copy/paste the id here. I want to see what part of the character id is throwing it off.
November 22 (9 years ago)

HoneyBadger said:

Do this as a macro for me please: @{character_id} and copy/paste the id here. I want to see what part of the character id is throwing it off.

This is what I got when I did that:

TypeError: Cannot read property 'substring' of undefined

November 22 (9 years ago)

Edited November 22 (9 years ago)
Hey Calhanol (or whomever else can answer),

I'd like to learn more about that awesome spellbook PowerCard you created.  Do the buttons call off to another macro to fire off the spell?  Which part of the formula is doing that? 

Is it this part?  
%{B-R8|04-Arcane-Armor})
I'd like to create one of these as well for 5e spells.  Sorry, I'm a little "wet behind the ears" with how the API works and interacts.  Thanks!

The fruits of your assistance... (EDIT: Added in castings per day that change as used (with !ammo script))
!power {{
--orowbg|#F5DEB3
--erowbg|#FFFFF0
--name|**Spellbook**
--leftsub|**Power: 1** 

--whisper|self

--!Blank1|~~~
--!Rank0|~C**Rank 0 Spells**~C
--!Blank2|~~~
--!Spells0|[[ @{B-R8|ArcaneArmor} + 0d0 ]] [**Arcane Armor**](!
%{B-R8|04-Arcane-Armor}) ^^ [[ @{B-R8|MagicDart} + 0d0 ]] [**Magic Dart**](!
%{B-R8|07-Magic-Dart})  ^^ [[ @{B-R8|MagicLock} + 0d0 ]] [**Magic Lock**](!
%{B-R8|05-Magic-Lock}) ^^ [[ @{B-R8|SenseMagic} + 0d0 ]] [**Sense Magic**](!
%{B-R8|03-Sense-Magic}) ^^ [[ @{B-R8|SecureSite} + 0d0 ]] [**Secure Site**](!
%{B-R8|02-Secure-Site})

--!Blank3|~~~
--!Rank1|~C**Rank 1 Spells**~C
--!Blank4|~~~
--!Spells1|[[ @{B-R8|Evade} + 0d0 ]] [**Evade**](!
%{B-R8|06-Evade}) ^^ [[ @{B-R8|UnerringDarts} + 0d0 ]] [**Unerring Darts**](!
%{B-R8|08-Unerring-Darts})
}}
November 22 (9 years ago)

Arthur B. said:

HoneyBadger said:

Do this as a macro for me please: @{character_id} and copy/paste the id here. I want to see what part of the character id is throwing it off.

This is what I got when I did that:

TypeError: Cannot read property 'substring' of undefined


Could you copy, paste and enter @{selected|character_id} into the text chat after selecting the token that's linked to the Character that you're having difficulty with?
November 22 (9 years ago)
Wait... is this TypeError in chat with an orange background or in the api console?
November 22 (9 years ago)

Silvyre said:

Arthur B. said:

HoneyBadger said:

Do this as a macro for me please: @{character_id} and copy/paste the id here. I want to see what part of the character id is throwing it off.

This is what I got when I did that:

TypeError: Cannot read property 'substring' of undefined


Could you copy, paste and enter @{selected|character_id} into the text chat after selecting the token that's linked to the Character that you're having difficulty with?
When I do the @{selected|character_id} everything works fine with all the character id's.

November 22 (9 years ago)

HoneyBadger said:

Wait... is this TypeError in chat with an orange background or in the api console?

In chat.
November 22 (9 years ago)

Arthur B. said:

HoneyBadger said:

Wait... is this TypeError in chat with an orange background or in the api console?

In chat.

Any errors in chat that have an orange background are Roll20 errors and have nothing to do with PowerCards. You most likely have a corrupted character journal or something. Can probably fix it just by copying the character.
November 22 (9 years ago)

Edited November 22 (9 years ago)

Craig L. said:

Do the buttons call off to another macro to fire off the spell?  Which part of the formula is doing that? 

Is it this part?  
%{B-R8|04-Arcane-Armor})

Close!

%{B-R8|04-Arcane-Armor} is an Ability Macro, which that holds the spell macro. [**Arcane Armor**](!&#13;&#37;{B-R8|04-Arcane-Armor}) is the API Command Button that calls that Ability Macro when pressed.

At the moment, a --whisper tag is required to use API Command Buttons within a PowerCard. For advanced use, I showcased the steps needed to nest a [child] PowerCard within an API Command Button within a [parent] PowerCard in an earlier post.
November 22 (9 years ago)

Edited November 22 (9 years ago)

Craig L. said:

Hey Calhanol (or whomever else can answer),

I'd like to learn more about that awesome spellbook PowerCard you created.  Do the buttons call off to another macro to fire off the spell?  Which part of the formula is doing that? 

Is it this part?  
%{B-R8|04-Arcane-Armor})
I'd like to create one of these as well for 5e spells.  Sorry, I'm a little "wet behind the ears" with how the API works and interacts.  Thanks!

The fruits of your assistance... (EDIT: Added in castings per day that change as used (with !ammo script))
!power {{
--orowbg|#F5DEB3
--erowbg|#FFFFF0
--name|**Spellbook**
--leftsub|**Power: 1** 

--whisper|self

--!Blank1|~~~
--!Rank0|~C**Rank 0 Spells**~C
--!Blank2|~~~
--!Spells0|[[ @{B-R8|ArcaneArmor} + 0d0 ]] [**Arcane Armor**](!
%{B-R8|04-Arcane-Armor}) ^^ [[ @{B-R8|MagicDart} + 0d0 ]] [**Magic Dart**](!
%{B-R8|07-Magic-Dart})  ^^ [[ @{B-R8|MagicLock} + 0d0 ]] [**Magic Lock**](!
%{B-R8|05-Magic-Lock}) ^^ [[ @{B-R8|SenseMagic} + 0d0 ]] [**Sense Magic**](!
%{B-R8|03-Sense-Magic}) ^^ [[ @{B-R8|SecureSite} + 0d0 ]] [**Secure Site**](!
%{B-R8|02-Secure-Site})

--!Blank3|~~~
--!Rank1|~C**Rank 1 Spells**~C
--!Blank4|~~~
--!Spells1|[[ @{B-R8|Evade} + 0d0 ]] [**Evade**](!
%{B-R8|06-Evade}) ^^ [[ @{B-R8|UnerringDarts} + 0d0 ]] [**Unerring Darts**](!
%{B-R8|08-Unerring-Darts})
}}

This part right here:
--!Blank1|~~~
--!Rank0|~C**Rank 0 Spells**~C
--!Blank2|~~~
--!Spells0|[[ @{B-R8|ArcaneArmor} + 0d0 ]] [**Arcane Armor**](!
%{B-R8|04-Arcane-Armor}) ^^ [[ @{B-R8|MagicDart} + 0d0 ]] [**Magic Dart**](!
%{B-R8|07-Magic-Dart})  ^^ [[ @{B-R8|MagicLock} + 0d0 ]] [**Magic Lock**](!
%{B-R8|05-Magic-Lock}) ^^ [[ @{B-R8|SenseMagic} + 0d0 ]] [**Sense Magic**](!
%{B-R8|03-Sense-Magic}) ^^ [[ @{B-R8|SecureSite} + 0d0 ]] [**Secure Site**](!
%{B-R8|02-Secure-Site})
is what calls to the spells for the buttons in the PowerCard. 
--!Blank1|~~~
--!Rank0|~C**Rank 0 Spells**~C
--!Blank2|~~~
--!Spells0|[[ @{B-R8|ArcaneArmor} + 0d0 ]] 
^^^This part creates the frame for the buttons.
[**Arcane Armor**](!
%{B-R8|04-Arcane-Armor})
^^^The first part here [**Arcane Armor**] - shows what goes in the button the ** ** makes it bold. the second part calls to the macro of the character, this one calls 04-Arcane-Armor macro for the character B-R8. So altogether you have [bold**button name**](call to macro! and then you need to use HTML entities (carriage return)&#37(@ symbol{B-R8(chracter name)|04-Arcane-Armor-(Macro)}

The parts in () is what each part of the code is.


EDIT: You beat me to it Silvyre, but did I do a good job explaining it? I was so happy I could actually answer one of these, thanks to all the help I got from the rest of you!
November 22 (9 years ago)

Arthur B. said:

EDIT: You beat me to it Silvyre, but did I do a good job explaining it? I was so happy I could actually answer one of these, thanks to all the help I got from the rest of you!

Yup. :)
November 22 (9 years ago)

Silvyre said:

Arthur B. said:

EDIT: You beat me to it Silvyre, but did I do a good job explaining it? I was so happy I could actually answer one of these, thanks to all the help I got from the rest of you!

Yup. :)

<<<<<Doing happy dance!!!
November 22 (9 years ago)
Hey, thanks guys!  I've gotten much closer due to your help.  I'm going to tinker with it to see if I can figure it out myself.  I've gotten the initial card to display with a button.  Now on to launching the spell PowerCard from there.  I'll cry "uncle" when I get frustrated enough.
November 22 (9 years ago)
Ok, figured a couple things out... and I will put an update out tomorrow, but I want to go over it again in the morning when I'm not so tired. Hidden initiative rolls (due to a conditional) will not add or modify a token's initiative now.
November 22 (9 years ago)

Edited November 22 (9 years ago)
November 22nd, 2015 ~ 12:30 pm eastern
  • Version: 3.2.12
  • Link: gist.github.com/Sky-Captain-13/452330a3d926b32da49c
  • Bugfix: Content hidden by conditionals will not be processed. This really only affects the [trkr] roll option that sends a token to the turn order tracker.
    • Example: -- ?? ?{Send to Init|Yes|No} == Yes ?? Initiative:|[[ [trkr] 1d20 ]]
    • If you select no, the token will not be added to the turn order tracker, nor will its existing initiative be modified.
  • Update: You can now display the base value of a Roll ID by adding [^Roll ID] to your PowerCard. This cannot be used as a stored variable to do math with however.
    • Example: --Damage:| [[ [$Physical] 1d8 + [$Fire] 1d6 + [$Necrotic] 2d6 ]] ([^Fire] fire, [^Necrotic] necrotic) would show up as Damage: [19] (4 fire, 9 necrotic)
    • If you want to include a modifier as part of the base value, you must wrap the roll and modifier in curly brackets like this: [[ [$Physical] {1d8 + 3 [Str Mod] } + [$Fire] {2d6 + 3} ]]
  • Bugfix: As part of the above update, I was able to get Roll ID's to work with multiple dice and their base sum. Before the bugfix, $ID.base would only use the last number rolled, regardless of the number dice rolled.
    • Example: If you rolled [[ [$Fire] 3d6 + 10 ]] and rolled a 3, 3, 5... [^Fire] would only show the five and any conditionals trying to use $Fire.base would only test against the value of five instead of eleven, the sum of the dice only.
    • This would be most useful for system that use multiple dice for a roll that may or may not have modifiers applied, but also bases things like critical success off the base rolls. Like using 3d6 for attacks rolls in D&D instead of 1d20. You would be able to do the following, which did not work before.
      • -- Attack:| [[ [$Atk] 3d6 + 3 [Str Mod] ]] vs AC
      • -- ?? $Atk.base >= 18 ?? Critical Hit:|You got a critical hit!
November 22 (9 years ago)

Edited November 22 (9 years ago)
Is there a format option to default a result to zero if it happens to go into the negatives?  I'm displaying current ammo amounts to my PCs and have to subtract -1 from the attribute before displaying it.  I'm also using that same result in conditionals.  Due to the order of operations, the ammo script does decrement the value, but PowerCards must be firing at the same time because when I display the attribute it is at it's previous value.  Although, once everything is done executing the attribute has the decremented value.

For example, this is what I'm doing to get the display to show the right value:
...A bunch of stuff above this...

--Ammo:|[[ [$Ammo] (@{selected|rangedammo1} - 1) + 0d0 ]] of [[ @{selected|rangedammo1|max} + 0d0 ]] remaining.
--?? $Ammo <= 0 ?? Out of Ammo:|You cannot attack with your @{selected|rangedweaponname1}.
--?? $Ammo > 0 ?? Attack:|[[ [$Atk] @{AdvDisadv} + @{selected|dexterity_mod} + @{selected|prof_bonus} + 0d0 ]] vs AC

....A bunch of stuff below this....
If I were to run the macro and let's say the PC has 10 arrows before attacking.  The macro is run, the ammo script will subtract the one arrow, the PowerCard displays, but if I didn't have the "-1" in there it would display "10" instead of "9".  Plus, none of the later conditionals would be evaluating the right value.  Additionally, when the attribute hits "0" then the display is showing "-1".  Very annoying!