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

TokenMod call from ScriptCards not setting a status marker

February 13 (3 years ago)

Hello,

I'm having an issue with a ScriptCards macro I'm using in one of my games. This same macro works just fine in a test game so I'm looking for help in understanding why. Pasting the code below.

I have a status marker named Rage in my games. Everything works in the test game as expected but in the actual game everything works except for the setting of the status marker on the token. In the API console, I see the ScriptCards: Making API call - !token-mod call like I expect. If I copy that token-mod call into the chat manually, TokenMod sets the status on the token but the same doesn't happen from this ScriptCards macro and I'm quite puzzled as to why it would work in one game and not the other and why it would work copying the command manually in chat but not via ScriptCards.

Does anyone have any ideas as to what might be the issue or further troubleshooting steps to take? 

!scriptcard {{
  +++dnd5elib+++
  --&FeatureName|Rage
  --&ResourceName|[&FeatureName]
  --#title|[&FeatureName]
  --#sourceToken|@{selected|token_id}

  -->Lib5E_FindResource|@{selected|character_id};[&ResourceName];ResName;ResValue;ResMax
  --?[$ResValue] -eq 0|InsufficientResources
  --#emoteText|[*S:character_name] enters into a rage. RAWR!

  --:GlobalDamageFlag|
  --Rfirst|@{selected|character_id};repeating_damagemod
  --:TestDamageType|
  --?"[*R:global_damage_type]" -eq [&ResourceName]|SetRageFlag
  --Rnext|
  --^TestDamageType|
  --:SetRageFlag|
  --@setattr|_silent _charid @{selected|character_id} _[*R>global_damage_active_flag]|1

  --:DeductResources|
  --@modattr|_silent _charid @{selected|character_id} _[&ResValue]|-1

  --:SetStatusMarker|
  --@token-mod|_ids @{selected|token_id} _set statusmarkers|[&FeatureName]

  --:ShowDescription|
  --Rfind|@{selected|character_id};[&ResourceName];repeating_traits;name
  --+[&ResourceName]|[*R:description]
  -->Done|

  --:InsufficientResources|
  --#emoteText|Out of [&ResourceName]
  --+Out of Uses|No more remaining uses of [&ResourceName]
  --:Done|
}}
February 13 (3 years ago)

Nevermind. I figured it out. I forgot to enable players to ID in the TokenMod config. I knew I was making a dumb mistake

February 13 (3 years ago)
The Aaron
Roll20 Production Team
API Scripter

Glad you got it worked out!