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

Generic ability calls

I am currently playing a Godbound game and I'm looking to streamline a few things (mainly a large network of abilities that any given character might have) I've started with a simple dropdown query that calls the relevant abilities: some of which call other abilities. These will never need to call another character (or token) - so it's all local to the character using the ability i.e  ?{Sorcery|   ability name1, %{Bob|ability_name1} |   ability name2, %{Bob|ability_name2} |   ability name2, %{Bob|ability_name3}  } The problem with this is that I can't readily paste it between characters without replacing the character name ("Bob" in this case) with whatever the name of the new character is. I know I can use "@{character_name}" to get the calling character's name, but I'm unsure of how to nest this into the above code Any ideas or suggestions? 
1494860664

Edited 1494860840
If you create this as an ability, you can do ?{Sorcery| ability name1, %{@{character_name}|ability_name1} | ability name2, %{@{character_name}|ability_name2} | ability name3, %{@{character_name}|ability_name3} } It won't work as a macro, though, only as an ability. I don't think macros can call abilities. Beware  nested roll queries , though!
1494867338

Edited 1494867632
David T. said: If you create this as an ability, you can do ?{Sorcery| ability name1, %{@{character_name}|ability_name1} | ability name2, %{@{character_name}|ability_name2} | ability name3, %{@{character_name}|ability_name3} } It won't work as a macro, though, only as an ability. I don't think macros can call abilities. Beware  nested roll queries , though! Hmmm - Im afraid that's returning the same error I was getting before =/ "No ability was found for %{@{Bob|character_name} No ability was found for %{@{Bob|character_name} No ability was found for %{@{Bob|character_name} Player1: Bob" I can hard-code it if it comes to it, but hard-coding names like that makes me cringe :(  I don't suppose it's possible to declare a variable in a macro is it? (i.e name = "bob") :P? ::EDIT:: should have said - those errors (no ability was found) show up when the ability starts - the character name is then returned whenever you select an input value Also, works fine if I replace "@{character_name}" with "Bob"
Can you post the exact ability you just tried, and the abilities it references?
1494868197

Edited 1494868840
There we go (this is in the "Attributes and abilities" tab on the character sheet) "option1" doesn' work, (returns the player name), other two do work ::Edit:: "abilities 1-3 just return a bit of text saying "ability 1-3 has just ran"
1494868858

Edited 1494868891
Have you saved TEST? When I have TEST open and roll, it returns Bob. When I save TEST and roll, it returns the contents of the ability I chose. If I reopen TEST and roll, it goes back to returning Bob. It only seems to work when the ability is saved and closed.
A-HA! I was running it from within (using the button at the top right) I should have realised! Many thanks! ;)
Im back!  Lol, just got back into the macro/ability programming and... now I see what you meant when you said "Beware nested roll queries , though!" So it turns out that if I call another dropwdown menu from within a dropdown menu, then something interesting happens. Put simply, it's loading the nested dropdown's options inside the top-level dropdown For instance: "?{Sorcery| Low Magic,%{@{character_name}|empty-hand}| Negate Magic,%{@{character_name}|negate_magic}| Invocation of the Gate,%{@{character_name}|gate_magic}| Delay Spell,%{@{character_name}|excellent_pause} }" is loading the options from "low magic" (empty_hand) into the options of the sorcery - which would appear to be caused by it running the nested ability *while* it's parsing the initial one. The problem is... I'm not sure what parts of the code to replace with their HTML characters as per  Advanced Usage for Roll Queries . I've tried various combinations from replacing the characters in the "@{character_name}|ability_name" section, BUT when I do this it just prints off the ability... and I'm reaching the point where a) the chat log is full of random crapola, and b) the frustration levels are reaching the "I think I need a drink" sort of region!     Any idea what I'm doing wrong? Should it be the underlying "ability"'s code that I replace the problem-characters with their HTML equivalents?
Callum R. said: "?{Sorcery| Low Magic,%{@{character_name} | empty-hand } | Negate Magic,%{@{character_name} | negate_magic } | Invocation of the Gate,%{@{character_name} | gate_magic } | Delay Spell,%{@{character_name} | excellent_pause } }" Try this
No luck I'm afraid! It's returning: "No ability was found for %{ Invocation of the Gate,%{Player1|gate_magic}| Delay Spell,%{Player1|excellent_pause} }" and then printing the original code (with the html characters dutifully filled in xD) to the chat I might be at the point where I just give up and re-writing it in python and copy+pasting into Roll20 when I need it =/ I'll give it another hour and see if I get anywhere -and if not I'll officially give up xD
1495314154

Edited 1495314254
Silvyre
Forum Champion
Callum R. said: Should it be the underlying "ability"'s code that I replace the problem-characters with their HTML equivalents? Yes, precisely. Here's what  Advanced Usage for Roll Queries has to say about this: Locate and replace all problematic characters within the values of any Attributes, Abilities or Macros. Since those values now contain HTML entities, they are probably unable be able to be called individually (i.e. outside of a Roll Query). So, you might now consider directly inserting these values into your Roll Query, replacing their call . Macros which contain HTML entities may no longer function autonomously.