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

Is this possible in a Dropdown Query?

September 15 (9 years ago)
Im playing WFRP2e and have access to set of spells called Petty Magic. As the character progresses Ill have access to one or two other sets of spells. What Im hoping to do, instead of having a couple dozen macros on the screen, is have one for Petty Magic and each other set of spells, that brings up the dropdown with each spell in that set.

Ive tried a few things that almost look like they would work but not quite. I wouldnt be surprised if Im asking too much from Roll20, or it may need the code things Ive seen others use to replace certain punctuation.

Ill include a few of the spells that would be in my Petty Magic list. These can be trimmed a bit if itll help, but Id kinda prefer if they could work as is. The casting roll is the most important part if stuff must be cut.

Magic Dart
&{template:default} {{name=  Magic Dart }} {{Casting Number=6}} {{Casting Time=Half action}} {{Casting Roll=[[?{Channel?|Yes, @{Aeriph|Magic}| No, 0}+?{Number of dice?|1}d10s+?{Small dart? +1}]]}} {{Effect=One opponent within 16 yards. Magic missile attack with 3 Damage.}} {{Reference=WFRP pg146}}

Sleep
&{template:default} {{name= Sleep }} {{Casting Number=6}} {{Casting Time=Half action}} {{Casting Roll=[[?{Channel?|Yes, @{Aeriph|Magic}| No, 0}+?{Number of dice?|1}d10s+?{Piece of down? +1}]]}} {{WS Touch test=[[1d100]] Vs. [[@{Aeriph|WeaponSkill}+20]]}} {{Effect=Cause 1 opponent to sleep for [[1d10]] rounds}} {{Resist=Will Power Test}} {{Reference=WFRP pg146}}

Drop
&{template:default} {{name=⬇ Drop ⬇}} {{Casting Number=4}} {{Casting Time=Half action}} {{Casting Roll=[[?{Channel?|Yes, @{Aeriph|Magic}| No, 0}+?{Number of dice?|1}d10s+?{Dab of butter? +1}]]}} {{Effect=Compel a target within 24 yards to drop whatever he is holding.}} {{Resist=Will Power Test}} {{Reference=WFRP pg146}}

I describe how to do exactly this here: https://app.roll20.net/forum/post/2159164/post-you...

September 15 (9 years ago)
Awesome, Ill give that a look, thanks
September 16 (9 years ago)

Edited September 16 (9 years ago)
Hi Dustin, I'm working through the set up of a WFRPv1 game and so will need to do arrange something similar to this myself.

What I have got already is a single macro that covers all of the WFRP standard tests, and I'm assuming that it must work in a very similar fashion to your idea for Petty Magic Spells, as it starts by asking which type of test you wish to roll and then goes throught the modifiers etc for the chosen test before rolling the result.

You might want to check out the thread here: 
https://app.roll20.net/forum/post/2305282/wfrp-sta...

My hope is that having got Silvyre to create this macro I will be able to use the basic framework for similar macros such as spell macro lists just by substituting the code for a one test with another. 
September 16 (9 years ago)

Didz said:

 I will be able to use the basic framework for similar macros such as spell macro lists just by substituting the code for a one test with another. 

This absolutely should be possible.
September 16 (9 years ago)
Didz, I followed that thread for a while when I first saw it. It looked to me like there may be some big differences in the versions that might keep what youre doing from being compatible. I could be wrong, as that thread is the closest Ive ever come to seeing the rules for 1e.

I tried Mark's suggestion last night and was not successful. Could be from the other Roll Queries in my macros, since its suggested to avoid that. Ill give it another try sometime tonight and hopefully itll work better.
Dustin, if you copy/paste your code and a screenshot of it (so we see the HTML Entities)  we might be able to spot a mistake.

Double curly braces,  commas, pipes, and certain single curly brackets all have to be replaced.
September 16 (9 years ago)
Pipes are | right? None of those were replaced. Wouldnt surprise me if I missed a step or something, been years since Ive done anything close to this complicated.

&{template:pf_attack} {{name= ?{Petty Magic|Drop, ⬇ Drop ⬇}} {{Casting Number=4}} {{Casting Time=Half action}} {{Casting Roll=[[?{Channel?|Yes, @{Aeriph|Magic}| No, 0}+?{Number of dice?|1}d10s+?{Dab of butter? +1}]]}} {{Effect=Compel a target within 24 yards to drop whatever he is holding.}} {{Resist=Will Power Test}} {{Reference=WFRP pg146|Glowing Light, ❇️ Glowing Light ❇️}} {{Casting Number=3}} {{Casting Time=Half action}} {{Casting Roll=[[?{Channel?|Yes, @{Aeriph|Magic}| No, 0}+?{Number of dice?|1}d10s+?{Drop of lamp oil? +1}]]}} {{Effect=Cause any item in your grasp to glow with light of a lantern for 1 hour or until let go}} {{Reference=WFRP pg146|Magic Dart,  Magic Dart }} {{Casting Number=6}} {{Casting Time=Half action}} {{Casting Roll=[[?{Channel?|Yes, @{Aeriph|Magic}| No, 0}+?{Number of dice?|1}d10s+?{Small dart? +1}]]}} {{Effect=One opponent within 16 yards. Magic missile attack with 3 Damage.}} {{Reference=WFRP pg146|Marsh Lights, ✨ Marsh Lights ✨}} {{Casting Number=6}} {{Casting Time=Full action}} {{Casting Roll=[[?{Channel?|Yes, @{Aeriph|Magic}| No, 0}+?{Number of dice?|1}d10s+?{A firefly? +1}]]}} {{Effect=Create lights within 100 yards. Lasts 1 hour}} {{Reference=WFRP pg146|Sleep,  Sleep }} {{Casting Number=6}} {{Casting Time=Half action}} {{Casting Roll=[[?{Channel?|Yes, @{Aeriph|Magic}| No, 0}+?{Number of dice?|1}d10s+?{Piece of down? +1}]]}} {{WS Touch test=[[1d100]] Vs. [[@{Aeriph|WeaponSkill}+20]]}} {{Effect=Cause 1 opponent to sleep for [[1d10]] rounds}} {{Resist=Will Power Test}} {{Reference=WFRP pg146|Sounds,  Sounds }} {{Casting Number=4}} {{Casting Time=Half action}} {{Casting Roll=[[?{Channel?|Yes, @{Aeriph|Magic}| No, 0}+?{Number of dice?|1}d10s+?{Tiny bell? +1}]]}} {{Effect=Create a phantom noise. Lasts up to 1 round}} {{Reference=WFRP pg146} }}


September 16 (9 years ago)

Edited September 17 (9 years ago)
i. You substituted the commas in your parent Roll Query. When nesting Roll Queries, one should not substitute the nonproblematic syntax of parent Queries; only the problematic syntax (i.e. commas, vertical bars and closing braces) of nested (child) Queries.

ii. Consequently, you substituted some (commas) but not all of the problematic syntax of your nested Roll Queries (i.e. "Channel", "Number of dice?", etc.) with HTML entities.

See:
the Advanced Usage section of Using a variable with a Macro.
September 16 (9 years ago)
Tried some changes. I think I get what youre trying to say Silvyre, but apparently not enough to get it right. The punctuation stuff in the main dropdown code should be typed as normal, and the ones in the individual spells should be replaced with the code, right? I did a find/replace for { } | and , for each spell, then filled out the dropdown code. This is getting me an error, "SyntaxError: Expected "(", ".", "[", "abs(", "ceil(", "d", "floor(", "round(", "t", "{", [ |\t], [+|\-] or [0-9] but "?" found."

&{template:default} {{name=?Petty Magic| Drop, ⬇ Drop ⬇}} {{Casting Number=4}} {{Casting Time=Half action}} {{Casting Roll=[[? { Channel?|Yes, @ { Aeriph|Magic } | No, 0 } +? { Number of dice?|1 } d10s+? { Dab of butter? +1 } ]]}} {{Effect=Compel a target within 24 yards to drop whatever he is holding.}} {{Resist=Will Power Test}} {{Reference=WFRP pg146|Glowing Light, ❇️ Glowing Light ❇️}} {{Casting Number=3}} {{Casting Time=Half action}} {{Casting Roll=[[? { Channel?|Yes, @ { Aeriph|Magic } | No, 0 } +? { Number of dice?|1 } d10s+? { Drop of lamp oil? +1 } ]]}} {{Effect=Cause any item in your grasp to glow with light of a lantern for 1 hour or until let go}} {{Reference=WFRP pg146|Magic Dart,  Magic Dart }} {{Casting Number=6}} {{Casting Time=Half action}} {{Casting Roll=[[? { Channel?|Yes, @ { Aeriph|Magic } | No, 0 } +? { Number of dice?|1 } d10s+? { Small dart? +1 } ]]}} {{Effect=One opponent within 16 yards. Magic missile attack with 3 Damage.}} {{Reference=WFRP pg146|Marsh Lights, ✨ Marsh Lights ✨}} {{Casting Number=6}} {{Casting Time=Full action}} {{Casting Roll=[[? { Channel?|Yes, @ { Aeriph|Magic } | No, 0 } +? { Number of dice?|1 } d10s+? { A firefly? +1 } ]]}} {{Effect=Create lights within 100 yards. Lasts 1 hour}} {{Reference=WFRP pg146|Sleep,  Sleep }} {{Casting Number=6}} {{Casting Time=Half action}} {{Casting Roll=[[? { Channel?|Yes, @ { Aeriph|Magic } | No, 0 } +? { Number of dice?|1 } d10s+? { Piece of down? +1 } ]]}} {{WS Touch test=[[1d100]] Vs. [[@ { Aeriph|WeaponSkill } +20]]}} {{Effect=Cause 1 opponent to sleep for [[1d10]] rounds}} {{Resist=Will Power Test}} {{Reference=WFRP pg146|Sounds,  Sounds }} {{Casting Number=4}} {{Casting Time=Half action}} {{Casting Roll=[[? { Channel?|Yes, @ { Aeriph|Magic } | No, 0 } +? { Number of dice?|1 } d10s+? { Tiny bell? +1 } ]]}} {{Effect=Create a phantom noise. Lasts up to 1 round}} {{Reference=WFRP pg146} }}


September 16 (9 years ago)

Edited September 17 (9 years ago)
You're getting closer.

i.
Regarding the opening braces ('{') within both your Roll Queries (parent and child) and Attributes; some have spaces before and after them (when they should not) and others seem to have disappeared from your macro.

ii. Similarly, you should remove additional spaces before the closing braces ('}') of your Attributes (and, optionally, your Roll Queries).

iii. Furthermore, one should not make any entity substitutions for Attributes (the order of operations ensures that Attributes are parsed before Roll Queries, i.e. before Attribute syntax is able to become problematic).

For the record: it is usually never necessary to substitute opening braces (I wouldn't classify them as "problematic syntax").
September 17 (9 years ago)
So are spaces bad in general, or just extra spaces? I went through and removed all spaces that werent part of a sentence, and changed the Attributes (I think, thats the @{character|stat} part right?), didnt seem to help. I didnt notice any opening braces missing, could be at least part of whats keeping me from success. I have a feeling something in the advice just isnt clicking, hopefully soon Ill get that "ohhhh" moment and understand it all, haha.


September 17 (9 years ago)

Edited September 17 (9 years ago)
In terms of Attributes, macro calls and (albeit to a degree less so) Roll Queries, any spaces are extra spaces and will break things.

For the missing open brace(s) (I personally can only see one at a quick glance), give your parent Query a look over to start.

Like I said earlier; if you'd like, you could replace all instances of { with { — it may make it easier to spot errors.

You also may want to alter the last three characters (counting an HTML entity as a single character for this purpose) at the end of the macro; remember that the Query will end at the first nonsubstituted closing brace it encounters.
September 17 (9 years ago)

Edited September 17 (9 years ago)

Dustin M. said:

Didz, I followed that thread for a while when I first saw it. It looked to me like there may be some big differences in the versions that might keep what youre doing from being compatible. I could be wrong, as that thread is the closest Ive ever come to seeing the rules for 1e.

Hi Dustin.

You're right in that as far as I know not many people are using Roll20 for WFRPv1e.  So, I'm pretty much starting my game set up from scratch.  However, I've checked my copy of the WFRPv2 Core Rule Book and WFRPv1e Standard Tests should work pretty much the same way as WFRPv2 Skills Tests.  The name was changed from Standard to Skill when the Talent system was introduced in v2, but the actual test format looks identical.
.
1. Decide on the type of test that applies to the situation.
2. Agree how difficult it is (e.g. Impossible +20 or Very Easy -20) and input test modifier to the macro.
3. Select the appropriate Related Talents (v1 calls them skills)
4. Roll 1d100 trying to score less than the success threshold.
5. Determine the degree of success or failure.

So, I think the format should work quite readily for v2 as well as v1 with just a few tweaks to the modifiers for v1 skills to reflect the new talent system.

I think the real difference is that your working on a spell casting macro which uses a different procedure to a skill test.  So, for example there is no difficulty modifier on a casting test, so you don't need the first modifier query.  However, the basic drop down list of the tests that can be rolled, ought to be a good template for a list of Petty Magic spells that can be cast, and then the casting roll for each spell could be subsituted for the test roll.

One thing that does puzzle me is why you've chosen Petty Magic casting as a process that needs to be in a single macro anyway.  

I opted to start with Standard Tests because standard tests get used all the time in WFRPv1 and need a lot of cross-referencing with skill tables to check for modifiers.  But in v1 magic hardly gets used at all, and even if a PC magic user is involved most of them only know one or two petty magic spells.  e.g. The Elven Wizard Apprentice in my last game only knew Sleep and Glowing Object.  So, I've never considered magic casting as a high priority for a global macro.  In my last game I would have just made a macro for Sleep and another for Glowing Object and left it at that until the PC learnt another spell.  

So I was just planning to do individual macros for the specific spells my magic users know and possibly link them to their character tokens to avoid button clutter..
September 17 (9 years ago)
Alright Ill give the code another go over.

Didz, that does sound more like both versions use the same basic format, which really would make sense. Sounds like magic is a bit different. From what Ive seen (this will be my first time playing a magic user in the system) you get all 6 of whichever Petty Magic set your career gives you. Later Ill have a few Lesser Magic spells and a set of spells from an Arcane Lore, so Ill be wanting to set up my Arcane spells the same way Im trying to do the Petty. I may have to look through your thread again and see if I can use anything from it after all.
September 17 (9 years ago)
So, I replaced all the { with { and Im confident I removed all spaces that arent part of a text output, oh and changed the last 3 back to }. It seems its technically working now, though not quite flawlessly.

This was the result choosing Magic Missile. The name text seems to stay the same while the results show as they should.


I didnt spot the missing {, though its possible I fixed it when adding all of those back in. This screenshot doesnt have the 3 } at the end but the rest should be accurate to what Ive changed.


September 17 (9 years ago)

Edited September 17 (9 years ago)
Dustin M. said:
I didnt spot the missing {

?Petty Magic


Last three characters should be
}}}
September 17 (9 years ago)
It works! Thanks so much for all the help. It figures it was something simple at the end haha. Now hopefully I can do this again much easier when its time for my Arcane spells.
September 17 (9 years ago)
Nice.
September 18 (9 years ago)

Dustin M. said:

Didz, that does sound more like both versions use the same basic format, which really would make sense. Sounds like magic is a bit different. From what Ive seen (this will be my first time playing a magic user in the system) you get all 6 of whichever Petty Magic set your career gives you. Later Ill have a few Lesser Magic spells and a set of spells from an Arcane Lore, so Ill be wanting to set up my Arcane spells the same way Im trying to do the Petty. I may have to look through your thread again and see if I can use anything from it after all.
Hi Dustin,  my bad.  I had forgotten that they changed the rules for learning spells in v2 to reflect the catalogue system used in Imperial Magic colleges.  In v1 a Wizard Apprentice starting career only gets two petty magic spells, usually chosen at random, and after that everything has to be learnt from approved spell sources.  If you change to a magic career during the game you only get one, so as I said earlier the Elven magic user in my game only had Sleep and Glowing Object.

But yes a macro makes more sense if you have six spells to remember.