We use Cookies to help personalize and improve Roll20. For more information on our use of non-essential Cookies, visit our Privacy Policy here.
Accept
Advertisement Create a free account

Power Cards variables

1596207677
Hi there, i have a problem with power cards....the main problem is me, because i don't know what i am doing :-) ok...what i am looking for is this: I want a power card for the psychic power "doombolt"...the player should insert his Psy Rating because the Damage and Range is depending on that value. Power card should take this player input and do 2 things.....multiply it with 20m and roll the damage (1d10 + Players Psy Rating). I didn't really understand how variables are working in power cards and searched a while....but i found nothing really helpfull. This is my macro so far: !power {{ --!showpic|[image](<a href="https://data.whicdn.com/images/175335572/original.gif" rel="nofollow">https://data.whicdn.com/images/175335572/original.gif</a>) --titlebackground|none --titlefontshadow|none --format|atwill --name|Doombolt --tokenid|@{selected|token_id} --emote|@{selected|token_name} uses his psychic energy... --leftsub|Half Action --rightsub|Subtype: Attack, Concentration --Sustained:| No --Psy Rating:|[[ [$psy]?{Psy Rating|3}&nbsp; ]] --Range:|[[ [$psy] x 20&nbsp; ]]m --Damage:|[[ 1d10 + $psy ]] }} of course i am doing something wrong....hopefully you understand what i am looking for...and perhaps you can help me with that "power card noob" issue.
1596210521

Edited 1596210607
Kurt J.
Pro
API Scripter
H0ND0 said: Hi there, i have a problem with power cards....the main problem is me, because i don't know what i am doing :-) ok...what i am looking for is this: I want a power card for the psychic power "doombolt"...the player should insert his Psy Rating because the Damage and Range is depending on that value. Power card should take this player input and do 2 things.....multiply it with 20m and roll the damage (1d10 + Players Psy Rating). I didn't really understand how variables are working in power cards and searched a while....but i found nothing really helpfull. This is my macro so far: !power {{ --!showpic|[image]( <a href="https://data.whicdn.com/images/175335572/original.gif" rel="nofollow">https://data.whicdn.com/images/175335572/original.gif</a> ) --titlebackground|none --titlefontshadow|none --format|atwill --name|Doombolt --tokenid|@{selected|token_id} --emote|@{selected|token_name} uses his psychic energy... --leftsub|Half Action --rightsub|Subtype: Attack, Concentration --Sustained:| No --Psy Rating:|[[ [$psy]?{Psy Rating|3}&nbsp; ]] --Range:|[[ [$psy] x 20&nbsp; ]]m --Damage:|[[ 1d10 + $psy ]] }} of course i am doing something wrong....hopefully you understand what i am looking for...and perhaps you can help me with that "power card noob" issue. PowerCards does not support variables. You can assign the results of rolls to RollIDs, but those can only be used for conditional statements and for displaying their results - they can't interact with other rolls. All rolls happen at the same time before the card is processed. What will work is something like this: !power {{ --!showpic|[image](<a href="https://data.whicdn.com/images/175335572/original.gif" rel="nofollow">https://data.whicdn.com/images/175335572/original.gif</a>) --titlebackground|none --titlefontshadow|none --format|atwill --name|Doombolt --tokenid|@{selected|token_id} --emote|@{selected|token_name} uses his psychic energy... --leftsub|Half Action --rightsub|Subtype: Attack, Concentration --Sustained:| No --Psy Rating:|[! ?{Psy Rating|3} !] --Range:|[[ ?{Psy Rating} * 20&nbsp; ]]m --Damage:|[[ 1d10 + ?{Psy Rating} ]] }} When using roll queries (?{Question|Default}) any reuse of the same "question" will not prompt the user again - it will just substitute the value that was entered the first time, so ?{Psy Rating} the first time (in the Psy Rating line) will ask the user. The Range and Damage lines will use whatever they entered there. This is true for all macros, and isn't specific to PowerCards. Multiplication uses the * (you have a lowecase x in your card above). The [! and !] around a value in my example make the number for Psy Rating look like a roll, even though no dice have been rolled there. If you leave out the [! and !] you will just get the entered number as the output.
1596218253
Holy cow.....thank you so much!!!! And thank you for explaining how the machine god is working :-)