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 .
×
Due to an outage with an external service provider, we’re experiencing intermittent loading issues on Roll20. Please refresh if needed.
Create a free account

Transitioning to an API call in Power Card to TokenMod and Syntax

1670383819

Edited 1670384360
I am working on a Cure Wounds script in power card that will cast the cure wounds spell and apply the healing to the target token. I am having issues with the conversion of tokenmod syntax within a power card. I have the script working perfectly when using Tokenmod syntax but when I try to add and convert the normal syntax into Power Card it doesnt display anything and doesnt apply the healing to the target token. I could sure use some assistance as I am new to coding. Here is my normal Tokenmod script that works: /me @{selected|token_name} channels the healing power of Shar into @{target|Who is being healed?|token_name}. !token-mod {{   --set bar3_value|[[@{target|Who is being healed?|bar3}+?{Level|1|2|3|4|5|6|7|8|9}d8+@{selected|wisdom_mod}]]!   --report all|"@{target|Who is being healed?|token_name} heals {bar3_value:abschange} points of health"   --ids @{target|Who is being healed?|token_id} }} Here is the Power Card Script I am trying to get working: !power {{  --token_id|@{selected|token_name}  --emote|** @{selected|token_name} channels the healing power of Shar into his target.. --Target|@{target||token_name} --api_token-mod _set bar3_value|[[@{target||token_name}?|bar3}+?{Level|1|2|3|4|5|6|7|8|9}d8+@{selected|wisdom_mod}]]!   _report all|" --Target|@{target||token_name} heals {bar3_value:abschange} points of health"   _ids --Target|@{target||token_name} }} Any assistance is appreciated!!
1670405230
Andrew R.
Pro
Sheet Author
I would recommend converting to ScriptCards because it's actively developed and getting new features. I converted my entire 13th Age Glorantha campaign from PowerCards to ScriptCards easily. 
1670422468
timmaugh
Forum Champion
API Scripter
While I agree with Andrew about the conversion to ScriptCards, if I understand the issue properly you'll run into the same issue in that script as you are here with PowerCards. I would bet the issue is that you don't have TokenMod set up to let players use ids (the setting playerscanids ). TokenMod is by default configured to only let GMs use the --ids argument. When you run the command separate from PowerCards (or ScriptCards) that is exactly what is happening: you're the GM, and you want to use the --ids argument. No problem. However, when you put the same command line into a macro where you expect another mod to call it (like PowerCards, ScriptCards, or Plugger), the "player" who actually issues the TokenMod command is the script Moderator (what we used to call the "API"). That player is not a GM, so the command that works on its own (with you calling it) instead fails.