This post has been closed. You can still view previous posts, but you can't post any new replies.

[Script] PowerCards 3 (Thread 3)

1468970773
Sky
Pro
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 ]].
1468971426
Grrr... now I'm getting API error There was an error communicating with the QuantumRoll server. undefined
1468971720
Here is the full code at the moment... http://pastebin.com/raw/U1M6QBJh
1468972575
Silvyre
Roll20 Mod Team
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.
1468977320
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.
1468977439
Sky
Pro
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.
1468977880
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.
1468978314
Sky
Pro
I think that's roll queries, not inline rolls. Dunno how many inline rolls it can handle.
1468978400
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...
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:  SyntaxError: Unexpected token } Ug.  Sorry to bother you!
1468980098
Sky
Pro
Ah, changing it now.
1468980383
Sky
Pro
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
Roll20 Mod Team
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?
1468984232
http://pastebin.com/raw/SzzRTZaR
1468985048
Sky
Pro
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.
1468985380

Edited 1468985532
Silvyre
Roll20 Mod Team
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\[[^\]]+\]
1468986221
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.
1468989046
Sky
Pro
Will add it to the to do list. That one will be pretty easy.
1468990496
Thanks!
1469016101
Silvyre, was the script able to output proper table data in your test? 
1469019390
Sky
Pro
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.
1469024942
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?
1469025024
Sky
Pro
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
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!!
1469042931
Sky
Pro
Let me known if it works or not. I only tested it with myself.
1469043138
So far it seems to work (with gm and I).
1469043171
Sky
Pro
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 ??  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.
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
Roll20 Mod Team
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.
1471965733
Is there a way roll for crit confirmation and crit damage if a crit is threatened inside a powercard?
1471969143

Edited 1472074479
Silvyre
Roll20 Mod Team
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| }}
1471970870
Sky
Pro
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
Franky H.
Roll20 Mod Team
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.  Also thanks for the reply Skycaptain. Loving powercards even if I am basically learning to script from scratch for it LOL. 
1472058658
Sky
Pro
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
Roll20 Mod Team
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 .
1472074157
Thank you Silvyre, that was what I am looking for.  :)
1472084297
Franky H.
Roll20 Mod Team
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
@silvyre Thankss!!!
1473798217

Edited 1473798760
Ziechael
Pro
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.
1474607738
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]] }}
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.  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. 
1474976931
Sky
Pro
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}
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. 
1475062985
Sky
Pro
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.
1475086518
Hey SkyCaptainXIII.  Maybe you should make a wiki dude.  PowerCards is kinda beefy to be a forum post IMO.  Just sayin'.