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

Powercards Question (Token Mod/Alterbars/ChatSetAttr)

September 10 (4 years ago)

I have a spell macro using powercards. The intent is to have the macro calculate the save of the target and then apply the effect, whcih is +1 to the target's A.C. I am using castles & crusades which essentially has two target numbers, 12 and 18, depending on if an attribute is a prime or not. This spell depends on the target failing its save against illusion. Overall the macro works very well, except it applies the chatsetattr effect twice. I need it to be applied if the target fails based on prime or not status of intelligence. 

This is my code. 

!power {{

--bgcolor|#1c4587

--erowbg|F1F1D4

--orowbg|#b6d7a8

--name|Dragon Armor

--tokenid|@{selected|token_image}

--emote|**Anáil nathrach, ortha bháis is beatha, do chéal déanaimh**

--leftsub|**R:** T **CT:** 1 **D:** @{selected|Spell-Strength} Minute(s) **C:** VSM

--Effect:| The spell places the illusion of plate armor on **@{target|token_name}**. **@{target|token_name}** moves and sounds like they have plate armor, but are not encumbered by the illusion.

--Result:| If Save is failed, **@{target|token_name}** increase their Armor Class by [[ 1 ]]!

--@{target|token_name} Save Roll:| [[ [$Save] 1d20 +2 +@{target|IntelligenceMod} + @{target|Level} + @{target|Protection} + ?{Challenge Level|0} -@{selected|Spell-Strength} ]] **Prime:** @{target|IntelligencePrime}

--soundfx|_audio,play,nomenu|charm of making

--?? @{target|IntelligencePrime} == Yes AND $Save >= 12 ?? Success: | You have **MADE** your save!

--?? @{target|IntelligencePrime} == No AND $Save >= 18 ?? Success: | You have **MADE** your save!

--?? @{target|IntelligencePrime} == Yes AND $Save <= 11 ?? Failure: | You have **FAILED** your save!

--?? @{target|IntelligencePrime} == No AND $Save <= 17 ?? Failure: | You have **FAILED** your save!

--?? @{target|IntelligencePrime} == Yes AND $Save <= 11 ??api_setattr|_name @{target|token_name} _mod _A.C.|1 _silent

--?? @{target|IntelligencePrime} == No AND $Save <= 17 ??api_setattr|_name @{target|token_name} _mod _A.C.|1  

--api_setattr|_name @{selected|token_name} _mod _numspells_1|-1  

--Spell Inventory: |**@{selected|token_name}** has [[ @{selected|numspells_1} -1 ]] 1st level spell(s) remaining!

}}


This is how it looks.


September 11 (4 years ago)

Edited September 11 (4 years ago)

Issue resolved.  Moved the AC modifier from the --results line  to the --?? Lines as 1d1 rolls and gave each their own referral.  Used alterbars referencing the AC mods as different referrals and numbered the alterbars. Now it works fine.


I don't know if this is the right place to post this but... Using power cards I would like to set the color according to the Player color. Where should I look for help to do this? Thank you.

September 11 (4 years ago)

I'm not sure if you could call up a color code using an attribute. Maybe create an attribute called character _color and then in the --bgcolor line place @{selected|character_color} .

What I want to know is how to read the color code from the Player tool bar so that I can then put it in an attribute on the character sheet.

September 11 (4 years ago)

Go to the draw tool. Find the color, the color code is at the bottom 

September 11 (4 years ago)
Kraynic
Pro
Sheet Author

I wonder if that color selection is available to the api?  Hopefully someone like The Aaron, Scott C., or someone pretty familiar with messing with that side of things will chime in.  I don't remember seeing a script pull that color for something before, but that doesn't necessarily mean it can't be done (or that I haven't just missed seeing it).

September 11 (4 years ago)

What? The f1f1d4? I imagine if it weren't available it would return as an error. 

September 12 (4 years ago)

Using @{selected|character_color} with the postcards works. So assuming you give the attribute and a color code to every character and monster you could easily have your powercards macros color coordinated. I assume you could do the same with even and odd rows and fonts if you really wanted to.

September 12 (4 years ago)
Oosh
Sheet Author
API Scripter

I think Kraynic is referring to dynamically grabbing a player's current colour setting, not hard-coding it.

September 12 (4 years ago)

That seems unlikely. I don't think those are stored on the character sheet or even the token. However if the 3d dice can do it, who knows.

September 12 (4 years ago)
Kraynic
Pro
Sheet Author

I think that is what Keeper is wanting to do.  I could be wrong on that though.

September 14 (4 years ago)
Kurt J.
Pro
API Scripter

The player's color is available via the API (the player object contains a "color" property) but in order to pass that to PowerCards you would need to be able to access it from the Chat server, which I don't believe there is a way to do.

PowerCards already includes some support for doing something similar, though. If you create a "PowerCard Formats" handout (see the Wiki) and create formats for each character by name, you can use "--format|@{selected|character_name}" to apply those formats to cards based on who is running them. I generally have a "badguys" or some other format that I use for my NPC cards since generally they can't use the same cards that players use because of the differences in the character sheet formats.