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)

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... <a href="http://pastebin.com/raw/U1M6QBJh" rel="nofollow">http://pastebin.com/raw/U1M6QBJh</a>
1468972575
Silvyre
Forum Champion
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. &nbsp;Other attacks (older scripts) seem to be working fine.
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. &nbsp;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.
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. &nbsp;I've run scripts longer than that before successfully. &nbsp;I wonder if it's trying to parse all the data from those tables before running the conditionals...
1468979520
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:&nbsp; SyntaxError: Unexpected token } Ug. &nbsp;Sorry to bother you!
Ah, changing it now.
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)
1468980477
The Aaron
Pro
API Scripter
SkyCaptainXIII said: Ah, changing it now. Thanks!
1468980566
Silvyre
Forum Champion
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?
<a href="http://pastebin.com/raw/SzzRTZaR" rel="nofollow">http://pastebin.com/raw/SzzRTZaR</a>
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.&nbsp;?{Weapon|@{meleeweaponname1}, 1| etc. will work just fine and eliminates some inline rolls from the macro.
1468985380

Edited 1468985532
Silvyre
Forum Champion
Patrick said: <a href="http://pastebin.com/raw/SzzRTZaR" rel="nofollow">http://pastebin.com/raw/SzzRTZaR</a> 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&nbsp;with 0. Regex: @\{[^\}]+\} Replaced all table rolls with my own 1t[test] table. Regex: 1t\[[^\]]+\]
1468986221
Silvyre
Forum Champion
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)&nbsp;on top of self and gm in order to be able to use those things with PowerCards.
Will add it to the to do list. That one will be pretty easy.
1468990496
Silvyre
Forum Champion
Thanks!
Silvyre, was the script able to output proper table data in your test?&nbsp;
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)&nbsp;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. <a href="http://pastebin.com/raw/3equPbMD" rel="nofollow">http://pastebin.com/raw/3equPbMD</a> Any thoughts?
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.
1469041459
Silvyre
Forum Champion
Patrick said: Silvyre, was the script able to output proper table data in your test?&nbsp; 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!!
Let me known if it works or not. I only tested it with myself.
1469043138
Silvyre
Forum Champion
So far it seems to work (with gm and I).
Cool. :)
1470598660

Edited 1470600017
!power {{ --name|Skill --$Hidden:| ?{Skill|Skill1,Skill1|Skill2,Skill2} ?{Take 10|Yes,10|No,1d20} --?? ?{Skill} == Skill1 ?? Skill1:| [[ ?{Take 10} + 1 ]]. --?? ?{Skill} == Skill2 ??&nbsp; 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]". &nbsp;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. &nbsp;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). &nbsp;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.
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?
1471892079

Edited 1471892145
Silvyre
Forum Champion
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.
Is there a way roll for crit confirmation and crit damage if a crit is threatened inside a powercard?
1471969143

Edited 1472074479
Silvyre
Forum Champion
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 &gt;= @{target|AC} ?? Crit| }}
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.
1472011102

Edited 1472011137
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.
1472057355

Edited 1472057438
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.&nbsp; Also thanks for the reply Skycaptain. Loving powercards even if I am basically learning to script from scratch for it LOL.&nbsp;
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.
1472060549

Edited 1472061780
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.
1472067244
Silvyre
Forum Champion
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 .
Thank you Silvyre, that was what I am looking for. &nbsp;:)
1472084297
Tetsuo
Forum Champion
Sorry for all the questions, I'm very new to using Scripts and coding in general.&nbsp; 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.&nbsp; 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&gt;3 --?? $Roll &gt;= 1 ?? Result|Good Job --?? $Roll == 0 ?? #Vanish
@silvyre Thankss!!!
1473798217

Edited 1473798760
Ziechael
Forum Champion
Sheet Author
API Scripter
There is a space missing on this line: --?? $Atk.base == 1 OR $Atk.total &lt; @{npcd_ac}?? !Miss:|$$#ff0000|**Miss!**$$ should be: --?? $Atk.base == 1 OR $Atk.total &lt; @{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.
I would like to have a Eldritch blast be more compacted. &nbsp;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 &gt; 5 ?? Crit1: | [[1d8]] --?? $Atk2.base &gt; 5 ?? Crit2: | [[1d8]] --?? $Atk3.base &gt; 5 ?? Crit3: | [[1d8]] --?? $Atk4.base &gt; 5 ?? Crit4: | [[1d8]] }}
1474934121

Edited 1474934693
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.&nbsp; 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.&nbsp; 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.&nbsp;
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.&nbsp; 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.&nbsp; 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.&nbsp; Yeah, you can do that with just ?{What number was rolled|0}
1475026738

Edited 1475027177
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.&nbsp;
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.&nbsp; No problem.
Hey SkyCaptainXIII. &nbsp;Maybe you should make a wiki dude. &nbsp;PowerCards is kinda beefy to be a forum post IMO. &nbsp;Just sayin'.