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

Thw !act script macro issue

1729532372

Edited 1729534177
So i am trying to track the duration of spells and effects in my came. I found out turn tracker script that works great so i want to automate it <a href="https://app.roll20.net/forum/post/6371080/turntracker1-spell-durations-and-effects" rel="nofollow">https://app.roll20.net/forum/post/6371080/turntracker1-spell-durations-and-effects</a> So i am playing D&amp;D, 5th, 2014 with no Jumpgate I maCacro the call !act -1 10 --Bless. When calling the macro with # everything is good. Then i tryed to make a character with bless, i edited the sescription of bless and added&nbsp; %{SpellDuration}. The sudenly the macro does not get called and i get TypeError: Cannot read properties of undefined (reading 'substring'), Why? My next step would be to make the macro variable and take the duration from the spell and the name if possible. Even further i would like to have a button on attack spells to press it only when a creature fail the save but these are still a fantasy as i cannot do the simple thing. Any help much appriciated! Best regards, George
You'll need a reference to a character to make ability calls work. %{name|ability} is the syntax, and you'll get that error without it. Both of those two other things should be doable, depending on the specifics you want.
What game are you playing, and which character sheet are you using? If it is D&amp;D 5th Edition, are you using the 2014 character sheets, the 2024 sheets, or both in your game? If you are using the 2024 sheet, is that the sheet that is being used for the character in question? Are you playing in a Jumpgate game or a classic game? When you say that you edited the description of Bless, what do you mean? Did you edit the Global Save Modifier and Global Attack Modifier, or something else?&nbsp;&nbsp; The reason that the macro is failing is that the %{SpellDuration} is missing a character reference.&nbsp; You can use %{SpellDuration} directly on a character sheet, because Roll20 will supply the Character ID from the character sheet.&nbsp; But if %{SpellDuration} is being called from anywhere else (such as from a script, or a macro) then you need to include a Character ID or 'selected' or 'target'. If the call is coming from a script then you may need to use Metascripts to supply the selected character's ID.
Tuo said: You'll need a reference to a character to make ability calls work. %{name|ability} is the syntax, and you'll get that error without it. Both of those two other things should be doable, depending on the specifics you want. Well just tried both selected and the name of a character and does the same
Fair point so i added all detail also in the OP So i am playing D&amp;D, 5th, 2014 with no Jumpgate By edit i mean i went to spell description on the CS and entered a line with the script in question. Unfortunatelly selected or the character name still gives an error&nbsp; No ability was found for %{Beastmaster|SpellDuration} Jarren said: What game are you playing, and which character sheet are you using? If it is D&amp;D 5th Edition, are you using the 2014 character sheets, the 2024 sheets, or both in your game? If you are using the 2024 sheet, is that the sheet that is being used for the character in question? Are you playing in a Jumpgate game or a classic game? When you say that you edited the description of Bless, what do you mean? Did you edit the Global Save Modifier and Global Attack Modifier, or something else?&nbsp;&nbsp; The reason that the macro is failing is that the %{SpellDuration} is missing a character reference.&nbsp; You can use %{SpellDuration} directly on a character sheet, because Roll20 will supply the Character ID from the character sheet.&nbsp; But if %{SpellDuration} is being called from anywhere else (such as from a script, or a macro) then you need to include a Character ID or 'selected' or 'target'. If the call is coming from a script then you may need to use Metascripts to supply the selected character's ID.
George said: By edit i mean i went to spell description on the CS and entered a line with the script in question. Unfortunatelly selected or the character name still gives an error&nbsp; No ability was found for %{Beastmaster|SpellDuration} If you type&nbsp;%{Beastmaster|SpellDuration} directly into the chat window, does it work?&nbsp;&nbsp; 'SpellDuration' has to be an ability on a character named 'Beastmaster'. What is the full content of the macro that you are using to add the custom turn to the Turn Tracker and also cast the spell?&nbsp; " !act -1 10 --Bless" will only add the custom turn, but it won't do anything related to displaying or casting the Bless spell. I have a feeling that the other part of the macro is where the error is.&nbsp;&nbsp; I'm not understanding what the entire setup looks like.&nbsp;
So, when you make an ability call, there's three different errors you can get - "TypeError: Cannot read properties of undefined (reading&nbsp; 'substring ')" means you're missing a reference to a character sheet, and the parser doesn't know where to look, "No character was found for&nbsp; '[any invalid reference] '", meaning you have a reference, but that reference doesn't point to a character sheet that can be found, and "No ability was found for [ability call]", where the reference is valid, but on the referred sheet, there is no ability with the name matching the ability call.