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)

July 19 (8 years ago)

Patrick said:

I thought
[[ 20 - @{extendedcrit} ]]
wouldn't work within the conditional.

Math using RollID's don't work. An inline roll will. So you can do that, but you can't do [[ $Dmg1 + $Dmg2 ]].
Grrr... now I'm getting API error
There was an error communicating with the QuantumRoll server.
undefined
Here is the full code at the moment...
http://pastebin.com/raw/U1M6QBJh
July 19 (8 years ago)

Patrick said:

There was an error communicating with the QuantumRoll server.

This should clear up on its own after not too long, possibly within an hour. This isn't an issue with PowerCards.
I'm still getting the QuantumRull server error every time I try to run the script as-is.  Other attacks (older scripts) seem to be working fine.
July 20 (8 years ago)
Maybe the quantum roll server has an issue with that many inline rolls at one time. Not to mention the script re-rolls everything to do the math properly.
It would make sense.  I feel like I've read somewhere that the Roll20 max in a single go is 100... though I don't recall when or where.
July 20 (8 years ago)
I think that's roll queries, not inline rolls. Dunno how many inline rolls it can handle.
I tried splitting the first block for weapon1 off into its own little script and on running it gave me the same API error.  I've run scripts longer than that before successfully.  I wonder if it's trying to parse all the data from those tables before running the conditionals...
July 20 (8 years ago)
The Aaron
Pro
API Scripter
Hey HoneyBadgerCaptainXIII, do you mind changing the last line of your script to:
/* END FUNCTIONS /////////////////////////////////////////////////////////////// */
Rather than
// END FUNCTIONS ///////////////////////////////////////////////////////////////
I just spent the last hour or so tracking down a most obnoxious bug, the result of the concatenation logic building this construct:
// END FUNCTIONS ///////////////////////////////////////////////////////////////on('ready',function(){
and throwing: SyntaxError: Unexpected token }

Ug.  Sorry to bother you!
July 20 (8 years ago)
Ah, changing it now.
July 20 (8 years ago)
July 19th, 2016 ~ 10:00 pm eastern
  • Version: 3.2.19
  • Link: gist.github.com/Sky-Captain-13/452330a3d926b32da49c
  • Bugfix: Change to fix concatenation errors when using multiple scripts. (per TheAaron)
July 20 (8 years ago)
The Aaron
Pro
API Scripter

SkyCaptainXIII said:

Ah, changing it now.

Thanks!
July 20 (8 years ago)

Patrick said:

I tried splitting the first block for weapon1 off into its own little script and on running it gave me the same API error.

Could you post this?
http://pastebin.com/raw/SzzRTZaR
July 20 (8 years ago)
This line...
--Weapon Slot|[[ [$W] ?{Weapon|@{meleeweaponname1},[[1]]|@{meleeweaponname2},[[2]]|@{meleeweaponname3},[[3]]|@{meleeweaponname4},[[4]]|@{meleeweaponname5},[[5]]|@{meleeweaponname6},[[6]]}+0d0]]
... doesn't need the inline rolls in there. ?{Weapon|@{meleeweaponname1}, 1| etc. will work just fine and eliminates some inline rolls from the macro.


July 20 (8 years ago)

Edited July 20 (8 years ago)

Patrick said:

http://pastebin.com/raw/SzzRTZaR

I wasn't able to replicate the QuantumRoll issue. I made only three changes to the above macro code:
  • Added 0d0 to all inline rolls to prevent issues with Roll IDs. Regex: \]\]
  • Replaced all Attribute calls with 0. Regex: @\{[^\}]+\}
  • Replaced all table rolls with my own 1t[test] table. Regex: 1t\[[^\]]+\]
July 20 (8 years ago)
Feature/workaround request: to make it easier to use stuff like API/Ability Command Buttons / Markdown images with PowerCards, would it be possible to add --whisper|all to PowerCards? I know how silly that sounds, but it's an incredible pain to manually list the names of every player (which can easily change) on top of self and gm in order to be able to use those things with PowerCards.
July 20 (8 years ago)
Will add it to the to do list. That one will be pretty easy.
July 20 (8 years ago)
Thanks!
Silvyre, was the script able to output proper table data in your test? 
July 20 (8 years ago)

Silvyre said:

Feature/workaround request: to make it easier to use stuff like API/Ability Command Buttons / Markdown images with PowerCards, would it be possible to add --whisper|all to PowerCards? I know how silly that sounds, but it's an incredible pain to manually list the names of every player (which can easily change) on top of self and gm in order to be able to use those things with PowerCards.

July 20th, 2016 ~ 9:00 am eastern
  • Version: 3.2.20
  • Link: gist.github.com/Sky-Captain-13/452330a3d926b32da49c
  • Minor Update: Added --whisper|all per request from Silvyre. Script will send powercard to all online players only. I have no idea what would happen if it tried to whisper offline players as well. The script uses the _displayname attribute of the Player object to determine who to send the whisper to.
I reorganized the code to make it more readable, but it's still stalling, this time after the two player prompts with the target selection still up.
http://pastebin.com/raw/3equPbMD
Any thoughts?
July 20 (8 years ago)
It may simply be too big for roll20 and the script to handle. Send me an invite to your campaign so I can test it as is without having to do a lot of replacements on the script to run it in my campaign.
July 20 (8 years ago)

Patrick said:

Silvyre, was the script able to output proper table data in your test? 

Yup.

SkyCaptainXIII said:

July 20th, 2016 ~ 9:00 am eastern
  • Version: 3.2.20
  • Link: gist.github.com/Sky-Captain-13/452330a3d926b32da49c
  • Minor Update: Added --whisper|all per request from Silvyre. Script will send powercard to all online players only. I have no idea what would happen if it tried to whisper offline players as well. The script uses the _displayname attribute of the Player object to determine who to send the whisper to.

Awesome!!
July 20 (8 years ago)
Let me known if it works or not. I only tested it with myself.
July 20 (8 years ago)
So far it seems to work (with gm and I).
July 20 (8 years ago)
Cool. :)
August 07 (8 years ago)

Edited August 07 (8 years ago)
!power {{
--name|Skill
--$Hidden:|
?{Skill|Skill1,Skill1|Skill2,Skill2}
?{Take 10|Yes,10|No,1d20}
--?? ?{Skill} == Skill1 ??
Skill1:|
[[ ?{Take 10} + 1 ]]. --?? ?{Skill} == Skill2 ??  Skill2:| [[ ?{Take 10} + 1 [Modifier] ]]. }}
Taking 10 using Skill2 breaks the API.

Could not determine result type of: [{"type":"M","expr":"1+9+floor((18-10)/2)"},{"type":"L","text":"DEX"},{"type":"M","expr":"+0"},{"type":"L","text":"Ranks"},{"type":"M","expr":"+3-3"},{"type":"L","text":"Class Skill"},{"type":"M","expr":"+0"},{"type":"L","text":"Bonus"}]
undefined
But this error means nothing, of course.

The issue is the "[Modifier]".  Any descriptor "tags" you put in after the prompt plugs in a flat value instead of a die roll crashes it.
I've circumvented this issue by doing "?{Take 10|Yes,0d0+10|No,1d20}" instead.  For the record, it works fine outside of PowerCards.
There are, of course, other ways to swap out the 1d20 for a flat 10 but this would be the cleanest manner of doing so.

Edit: Oh yeah, and there's still the bug where if within any modifiers you have the specific inline roll options, that specific sequence of letters will disappear (but still won't do anything).  For example, if you ever have "[Enhancement]" as a tag inside your roll, it'll show up as "[Eancement]", but crit failures/successes will still highlight as normal.
August 22 (8 years ago)
I apologize if this has been answered already, but is there a functionality to direct a query? For example if I wanted to make a player macro that does a skill check, and I want it to show as failed or succeeded, can I have the player click the macro but query the GM for the DC?
August 22 (8 years ago)

Edited August 22 (8 years ago)

Arjuna said:

can I have the player click the macro but query the GM for the DC?

Possibly the easiest way to do this is to set the DC as a value on a Token's Bar, and have the players' macros access that DC through an Attribute call targeting that Token.
August 23 (8 years ago)
Is there a way roll for crit confirmation and crit damage if a crit is threatened inside a powercard?

August 23 (8 years ago)

Edited August 24 (8 years ago)

Sudain said:

Is there a way roll for crit confirmation and crit damage if a crit is threatened inside a powercard?


Something like this?
!power {{
--Attack|[[ [$Atk] 1d20 ]]
--?? $Atk.base == 20 ?? Confirm| [[ [$Cfm] 1d20 ]]
--?? $Atk.base == 20 AND $Cfm >= @{target|AC} ?? Crit|
}}
August 23 (8 years ago)

Arjuna said:

I apologize if this has been answered already, but is there a functionality to direct a query? For example if I wanted to make a player macro that does a skill check, and I want it to show as failed or succeeded, can I have the player click the macro but query the GM for the DC?

No, no way to direct a query to a specific token or character or player/GM without a multi-step macro using the API to store results and send a button to the target and then return those values and do the final output. It technically is possible, but is not something PowerCards can do.
August 24 (8 years ago)

Edited August 24 (8 years ago)
Tetsuo
Forum Champion
Is it possible to have a power card display a prompt containing a roll, then loop depending on the answer?


EX: Prompt would read "Do you have the [[1t[powers]]] power?" Drop down would contain yes and no. If no, display a card that says "Player gained [result of the table roll]" If yes, loop the macro.
August 24 (8 years ago)

Edited August 24 (8 years ago)

Silvyre said:

Arjuna said:

can I have the player click the macro but query the GM for the DC?

Possibly the easiest way to do this is to set the DC as a value on a Token's Bar, and have the players' macros access that DC through an Attribute call targeting that Token.

So i would just update that token with whatever DC I wanted? Makes sense, cool. 



Also thanks for the reply Skycaptain. Loving powercards even if I am basically learning to script from scratch for it LOL. 

August 24 (8 years ago)

Franky H. said:

Is it possible to have a power card display a prompt containing a roll, then loop depending on the answer?


EX: Prompt would read "Do you have the [[1t[powers]]] power?" Drop down would contain yes and no. If no, display a card that says "Player gained [result of the table roll]" If yes, loop the macro.

No, the api script cannot trigger queries or prompts unfortunately. All those are resolved before anything is sent to the script.
August 24 (8 years ago)

Edited August 24 (8 years ago)
Another question I couldn't find the answer to easily.
Does powercards include the functionality to edit character attributes? I know macros themselves don't.


August 24 (8 years ago)

Arjuna said:

Does powercards include the functionality to edit character attributes?

No, but there exist many other API Scripts that can do this. One such script is ChatSetAttr.
August 24 (8 years ago)
Thank you Silvyre, that was what I am looking for.  :)
August 25 (8 years ago)
Tetsuo
Forum Champion
Sorry for all the questions, I'm very new to using Scripts and coding in general. 

Is it possible to display the result of a roll in multiple places in a power card? EX:

attack roll is 1d20+1 and results in a 19. 

Can I force it to display that 19 in 2 different locations?

Question 2: Can a power card force itself to loop?

Ex:
-- name|Vanish
--Attempt|[[ [$Roll] 2d6>3
--?? $Roll >= 1 ?? Result|Good Job
--?? $Roll == 0 ?? #Vanish
August 25 (8 years ago)
@silvyre Thankss!!!
September 13 (8 years ago)

Edited September 13 (8 years ago)
Ziechael
Forum Champion
Sheet Author
API Scripter
There is a space missing on this line:
--?? $Atk.base == 1 OR $Atk.total < @{npcd_ac}?? !Miss:|$$#ff0000|**Miss!**$$
should be:
--?? $Atk.base == 1 OR $Atk.total < @{npcd_ac} ?? !Miss:|$$#ff0000|**Miss!**$$

Also it should be @{target|npc_ac} if you are using the 5e sheet, not sure if npcd_ac is an attribute? The same goes for the next line which does has the @{target... prefix in place.
September 23 (8 years ago)
I would like to have a Eldritch blast be more compacted.  Can anyone help with making the crits all on same line?

This is what I currently have
!power {{
--name|Eldritch Blast
--target_list|@{selected|token_id}
--Attack|[[ [$Atk]1d20 + %%Strength_Mod%% + %%pb%%]] | [[ [$Atk2]1d20 + %%Strength_Mod%% + %%pb%%]] | [[ [$Atk3]1d20 + %%Strength_Mod%% + %%pb%%]] | [[ [$Atk4]1d20 + %%Strength_Mod%% + %%pb%%]]
--target_list|@{selected|token_id}
--Dmg|[[ [$Force]1d10 + %%charisma_mod%% ]] | [[ [$Force2]1d10 + %%charisma_mod%% ]] | [[ [$Force3]1d10 + %%charisma_mod%% ]] | [[ [$Force4]1d10 + %%charisma_mod%% ]]
--?? $Atk.base > 5 ?? Crit1: | [[1d8]]
--?? $Atk2.base > 5 ?? Crit2: | [[1d8]]
--?? $Atk3.base > 5 ?? Crit3: | [[1d8]]
--?? $Atk4.base > 5 ?? Crit4: | [[1d8]]
}}
September 26 (8 years ago)

Edited September 27 (8 years ago)
DM
Pro
I'm sure this has been in one of the 4 or 5 threads, but is there a way to have the powercard ask for a number instead of generating its own roll? My players are all in the same room as I. Plavers view on the TV and DM view on my laptop. Would like to use a power and insert the number the (I) rolled. 

These cards are awesome by the way. Combining this with the old Monster Importer script should really speed up gameplay. Thanks for all the hard work. 


Edit: Just realized how rude it is to say I know there are 4 or so threads but to ask the question without checking them. Will do first. 
September 27 (8 years ago)

DM said:

I'm sure this has been in one of the 4 or 5 threads, but is there a way to have the powercard ask for a number instead of generating its own roll? My players are all in the same room as I. Plavers view on the TV and DM view on my laptop. Would like to use a power and insert the number the (I) rolled. 

These cards are awesome by the way. Combining this with the old Monster Importer script should really speed up gameplay. Thanks for all the hard work. 


Edit: Just realized how rude it is to say I know there are 4 or so threads but to ask the question without checking them. Will do first. 
Yeah, you can do that with just ?{What number was rolled|0}

September 28 (8 years ago)

Edited September 28 (8 years ago)
DM
Pro
Awesome. With your character/monster importer, I just replace the dice rolls with this. Looks like as long as its in this format, I can have the text say whatever. Very cool Thanks again. 
September 28 (8 years ago)

DM said:

Awesome. With your character/monster importer, I just replace the dice rolls with this. Looks like as long as its in this format, I can have the text say whatever. Very cool Thanks again. 

No problem.
September 28 (8 years ago)
Hey SkyCaptainXIII.  Maybe you should make a wiki dude.  PowerCards is kinda beefy to be a forum post IMO.  Just sayin'.