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 .
×

PowerCards Macro Helper

Hello. I am trying to tweak the output of PCMHelper. I love many aspects of this, but there are two tweaks that would make it fit my game even better.  1) When it posts to the chat box, for example, "Ilehana Neleh uses Dagger against Zombie", I would love for "Zombie" to instead reference the token name. Thus, if I have two Orcs whose tokens are named Quugug and Kurdan, it would put their names there, instead of simply "Orc". I cannot figure out which values to replace in the PCMHelper templates and/or macros. 2) I would love to be able to set up a PowerCard Format file so that each of my characters can have a different color title bar so that they are easily differentiated. I have attempted this myself, and my rudimentary knowledge of how the API works, and not been successful.  Any help would be welcome! Thank you! Colin
1610727242
Kurt J.
Pro
API Scripter
#1 is slightly tricky because the current replacement commands all work on characters instead of tokens. That said, it looks useful and is something I will look into supporting directly in the code in some way. It is still possible to do what you want with the current structure, however. There are a couple of ways to do this, but editing directly within the Roll20 editor is usually bad news because it throws a bunch of extra HTML junk in there. Method #1 (Recommended) : If you are using OneClick PCMHelper, go to the OneClick screen and remove PowerCards Macro Helper. Then select it again in the API Scripts dropdown and click the "Import" button instead of the normal Add Script button. This will create a copy of the code in your game that you can then modify. On the API tab, pick PowerCards Macro Helper and you should see the code window that, near the top, contains the macros. There is a line that starts with "var pc_pcattack" that defines the macro for  the attacker. Edit this text to add a line after the replaceattrs line for T-. The new line should read "--inlinereplace|T-CN|@{target|token_name}", so in whole the variable should look like this (I bolded the line in question): var pc_pcattack = `!power {{ --replacepcattack|@{selected|character_id}|?{Select attack to use|@{selected|attacklist}} --replacement|Advantage --replaceattrs|S-|@{selected|character_id} --replaceattrs|T-|@{target|character_id} --inlinereplace|T-CN|@{target|token_name} --template|Basics|@{selected|token_id};@{target|token_id};uses ~PCA-NAME$;~PCA-NAME$;~PCA-ATYPE$;~PCA-RANGE$;@{selected|whispertoggle} --template|PCAttack|~@{selected|rtype}$;@{selected|whispertoggle};@{selected|global_attack_mod};@{selected|global_damage_mod_roll};@{selected|global_damage_mod_type};@{selected|global_damage_mod_crit} }}`; Click the "Save Script" button and let things reload. Return to your game and type !pcmsetup to regenerate the macros and templates. You should now have it working. Essentially what is happening is that you are overriding the replacements made by replaceattrs and specifying the value of ~T-CN$ to the token name directly. Method 2 (Not recommended) you can update the PowerCard Templates PCMHelper handout. The built-in Roll20 Text Editor will butcher the handout text by adding a bunch of HTML junk to it, so select all of the text and paste it into and external editor (as simple as Notepad) and make the changes there, then clear out the handout text and paste in what you have from Notepad. The change you want to make is to add the same line in Method 1 above to the pc_attack template. This method avoids making a separate copy of the script, but your changes will be overwritten when a new version of PCMHelper comes out and you run !pcmsetup. For your second item, I suspect you are running into the problem mentioned above in option #2 with the Roll20 text editor. The same solution there should work to allow you to make format changes successfully. Also note that when PowerCards looks for template, replacement, and format handouts it will process everything starting with "PowerCard Formats", so you can create multiple handouts like "PowerCard Format Players" with your player formats in it.
Kurt, you are amazing! Method 1 worked perfectly! I'm having trouble with the second piece of this, though. Even though I put the text through a plain text editor, it's not making any difference. Every card that is generated is a dark green. My "PowerCard Formats" file is the following: Ilehana Neleh: --txcolor|#ffffff --bgcolor|#440044 --titlefontshadow|#0000cc --corners|10 --emotefont|font-family: Arial; font-weight: bold; Jhanni'ss: --txcolor|#ffffff --bgcolor|#000044 --titlefontshadow|#0000cc --corners|10 --emotefont|font-family: Arial; font-weight: bold; Oak Barstow: --txcolor|#ffffff --bgcolor|#440000 --titlefontshadow|#0000cc --corners|10 --emotefont|font-family: Arial; font-weight: bold; Belac Ydarb: --txcolor|#000000 --bgcolor|#004400  --titlefontshadow|#0000cc --corners|10 --emotefont|font-family: Arial; font-weight: bold; Do I need to be altering the Macros or Template in any way to make PowerCards understand that I want it to follow to the Formats file when I have a PC? Or is it supposed to just do it automatically?
1610834653
Kurt J.
Pro
API Scripter
Colin C. said: Kurt, you are amazing! Method 1 worked perfectly! I'm having trouble with the second piece of this, though. Even though I put the text through a plain text editor, it's not making any difference. Every card that is generated is a dark green. My "PowerCard Formats" file is the following: Ilehana Neleh: --txcolor|#ffffff --bgcolor|#440044 --titlefontshadow|#0000cc --corners|10 --emotefont|font-family: Arial; font-weight: bold; Jhanni'ss: --txcolor|#ffffff --bgcolor|#000044 --titlefontshadow|#0000cc --corners|10 --emotefont|font-family: Arial; font-weight: bold; Oak Barstow: --txcolor|#ffffff --bgcolor|#440000 --titlefontshadow|#0000cc --corners|10 --emotefont|font-family: Arial; font-weight: bold; Belac Ydarb: --txcolor|#000000 --bgcolor|#004400  --titlefontshadow|#0000cc --corners|10 --emotefont|font-family: Arial; font-weight: bold; Do I need to be altering the Macros or Template in any way to make PowerCards understand that I want it to follow to the Formats file when I have a PC? Or is it supposed to just do it automatically? It should be picking them up automatically. The Basics template (automatically included in the PCMHelper macros) uses ~S-CN$ for the --format tag, which should match based on character name.