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

Creating a drop down box to select a spell from

Im currently trying to create a macro that when run will give a list of my Spells and then run the pre-prepared macros for them. reading other posts the style should be:

?{Spells:|Inflict Wound, #Inflict-Wounds 
|Cure Wounds, #Cure-Wounds }


My macro for my Inflict Wounds Spell is: (with Bill posters being my character name and using 5E OGL)

%{Bill Posters|repeating_attack_-LI7YvMjimrXZiwV4z0m_attack}

Unfortunately all that gives me is a string of nonsense in the chat 

Rather than trying to nest these macros in a query, I would recommend using API command buttons (API subscription not required).

July 26 (7 years ago)

Actually, a Query is not that much different from a Chat Button in this regard.


My suggestion would be to have it instead do the Spells in a hidden (from Journal) All Access Sheet, and calling them there with your Query. It's what I'm planning on doing in my own Campaign, I'm using exclusively the Spell Cards because I get more room per Line that way, and I like the Background, plus I Inline Roll all of the relevant details on the spot, so nobody needs to look up their Spell DC, or what type of Save it is, or Roll for Damage (I even handle Toll the Dead)


Go to your Spell List, there's 3 kinds of Spells in the OGL Sheet:

  • Current Level Spell Card
  • Potentially Higher Level Spell Card
  • Attack Spell

Current Level Spell Card is used for things like Prestidigitation, which has no effect when used in a higher Spell Slot

Potentially Higher Level Spell Card is self explanatory: Ice Knife, Fireball, Scorching Ray, Bless, Sleep, etc. If it's got something for casting at higher Levels, it's going to ask, this is a different type of Macro from the previous one

Attack Spell: Unlike Bless & Sleep, Ice Knife & Fireball actually deal Damage, so they instead use the Attack Macro, which uses the Weapon Attack Template (you can disable this)


Send one of those things, I'm assuming you are on a Desktop or Laptop of some kind, then go into the Chat Entry section, hit the Up Arrow Key, Copy & Paste that Text into it's own Ability really quickly so you can edit it down, replacing your Character Name

@{Bill Posters|

with

@{selected|

Now, read it over, piece by piece, you'll see what it's placing where, how it's looking up various things in your Sheet, and how you are capable of doing the exact same thing.

The next step is to get rid of the extra stuff. Whatever you don't need for that Spell, ditch it.

CureWounds for example, unless you are a Life Domain Cleric, I doubt you'll need Damage2. Since you aren't Rolling to Hit; you can cut Attack, Crit1, & Crit2. That's already 4 useless Calls it's been making for you, cleaned out. Pretty sure Cure Wounds also has no Saving Throw, so that's another 2 at least.

If you wish to use the Spell Card Template, or Default Template

&{template:default}

This would be a good time to switch to it, since you are already restructuring the template for your tastes.


If you wish to make a Spell Sheet for everyone's Spell Macros, you'll need Creator or GM Access to create the Sheet, give nobody View Access, but All Players Edit Access, this allows them to %{call} the Sheet.

You'll then need to set up an Ability Macro with all of the information for the Spells involved, remember, Macro Names don't like Spaces, Character Names seem to be exclusively exempt form that problem, it can even happen to Token Names.

I'm currently restructuring my GitHub Repo or I'd post the link to it for you (it's embarrassingly out of shape, I'm still gutting the Community Sheet bits)


Also, there's a better way to call a Repeating List (in this case you've pointed at your Repeating Weapons List), although I'm not familiar with the exact call for OGL, it goes something along the lines of %{selected|repeating_weapon1} or something. I'm 99% positive I worded it wrong, but it's much clearer, much cleaner, and far more reliable unless you frequently reorganize the list (for example, removing an item, or moving something up/down the list)


Cantrip AutoMath is easy, since it scales with Player Level:

[[[[((floor((@{level} +1) /6)) +1)]]d10]]

Monk's Unarmed Strike Damage is trickier, but still easy:

[[1d[[((floor((@{base_level} +1) /6)) +1) *2]]]]

or, depending on if Monk is their 1st, 2nd, or 3rd time going Multiclass:

[[1d[[((floor((@{multiclass1_lv} +1) /6)) +1) *2]]]]
[[1d[[((floor((@{multiclass2_lv} +1) /6)) +1) *2]]]]
[[1d[[((floor((@{multiclass3_lv} +1) /6)) +1) *2]]]]

Thanks for the quick replies. There's some hinkey stuff happening in my spell sheet i don't want the other players seeing so i think that rules out the API option though that seems way easier. Gonna give the Macro option a go and see what happens.

July 26 (7 years ago)

Edited July 26 (7 years ago)

If you start the Macro with

/w @{selected|character_name}

You can end up whispering yourself everything after that (be sure to select to use as a Token Action). Another command that's useful for debugging:

/talktomyself on
July 26 (7 years ago)

I'm on my Laptop now, tinkering away on my Code on my GitHub. here's that Link btw:

https://github.com/Blue64/Roll20

keep in mind, it's barely even a foundation (^_^") although, if you have any ideas, feel free to submit a Pull Request or Bug Report. It's just me working on it for now, and I don't even have Home Wi-Fi (gotta hang out at a local Restaurant, nothing in my Region is 24 Hours, in the Southern Tip of Texas (McAllen, Texas) it frequently reaches 100+ by noon, it's brutal), plus I then need to transfer everything from GitHub to Roll20, it's all very hectic.

July 26 (7 years ago)
GiGs
Pro
Sheet Author
API Scripter

You can also copy your campaign from the Launch Game page, to create a copy of the campaign you use for testing. It's a bit of a hassle to keep them in sync, but for short-term testing, when there's something specific you're having issues with, you can copy the campain, do your testing, find out what the issue is, then delete the copy.

When copyiing, remember to uncheck to Copy Players box (you'll see it after you click Copy Campaign), otherwise the players will also have access to it and can see what you're testing :)

July 26 (7 years ago)

Edited July 26 (7 years ago)

I found the Repeating Calls! This is where it starts talking about it, and it has examples for other fields lower down:
https://wiki.roll20.net/5th_Edition_OGL_by_Roll20#.2813.29_Class_.26_Other_Resources

That should help you call your stuff at least a little easier, & here's a good spot to go over all of the various template commands & styles available to you on the OGL Sheet besides

&{template:default}

https://wiki.roll20.net/5e_OGL_Roll_Templates

Thanks for everyone ones help. API is running bust using the code

/w "@{selected|character_name}"
[Inflict Wounds](!Inflict Wounds 
#Inflict-Wounds )
[Cure Wounds](!Cure Wounds 
#Cure-Wounds )

But looking at your @Blue64 GitHub has definitely given me some ideas so thanks!