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

5eDefault template

Hello, I have an issue with the macro I'm preparing for Turning Undead for a BECMI game. This is the code so far:  &{template:5eDefault} {{ability=1}} {{subheader=@{selected|token_name}'s Turn Undead}} {{emote=@{selected|token_name} rises the holy symbol and starts the ritual to turn undead}} ?{Which type of undead?| Skeleton,{{title=Turn Skeleton}} {{freetext=You @{selected|turnskeleton} }}| Zombie, {{title=Turn Zombie}} {{freetext=You @{selected|turnzombie} }}| Wraith, {{title=Turn Wraith}} {{freetext=You @{selected|turnwraith} }} } {{Turn result=[[2d6]]}} {{HD destroyed (2d6)=[[2d6]]}} {{HD destroyed (3d6)=[[3d6]]}} {{HD destroyed (4d6)=[[4d6]]}} I placed it in the character sheet, in the Ability section. The query works, it lets me choose the undead, but when it displays the result in the chat screen, that's what I get: I don't understand why the dice rolls are not parsed correctly... any hint?
1615380168

Edited 1615383950
David M.
Pro
API Scripter
Not familiar with that template, but just eyeballing it: is that a stray closing bracket at the end of the 4th line, immediately before "{{Turn result...etc" ?
Yes it is, it should be the one closing the query loop, isn't it?
1615383942
David M.
Pro
API Scripter
Yep, sorry. I hate nested queries. Did a quick  forum search on the template, and it seems the example given in that thread doesn't work when I created a test game using the 5e community sheet. Are there still free-form fields available like what you have? e.g. Turn Result, HD Destroyed, etc.  This is not what you are looking for, but it at least displays the info you wanted. I just jammed the rolls into the freetext field query. &{template:5eDefault} {{ability=1}} {{subheader=@{selected|token_name}'s Turn Undead}}{{emote=@{selected|token_name} rises the holy symbol and starts the ritual to turn undead}} ?{Which type of undead?| Skeleton,{{title=Turn Skeleton}} {{freetext=You @{selected|turnskeleton} Turn result=[[2d6]] HD destroyed (2d6)=[[2d6]] HD destroyed (3d6)=[[3d6]] HD destroyed (4d6)=[[4d6]]}}| Zombie, {{title=Turn Zombie}} {{freetext=You @{selected|turnzombie} Turn result=[[2d6]] HD destroyed (2d6)=[[2d6]] HD destroyed (3d6)=[[3d6]] HD destroyed (4d6)=[[4d6]]}}| Wraith, {{title=Turn Wraith}} {{freetext=You @{selected|turnwraith} Turn result=[[2d6]] HD destroyed (2d6)=[[2d6]] HD destroyed (3d6)=[[3d6]] HD destroyed (4d6)=[[4d6]]}}} I will now back away slowly and hopefully one of the nested query experts can chime in.
David M. said: Are there still free-form fields available like what you have? e.g. Turn Result, HD Destroyed, etc. Well, I suppose there are still functional, honestly I didn't realize that. Anyway thank you for your time. What is really pissing me off is that I do not really understand what I am doing wrong on my code: the query works and it's enclosed correctly, the issue should be in what come  after  it.
1615388582
David M.
Pro
API Scripter
I asked the question about the fields because when I removed the query it didn't output any of the fields in question: &{template:5eDefault} {{ability=1}} {{subheader=@{selected|token_name}'s Turn Undead}} {{emote=@{selected|token_name} rises the holy symbol and starts the ritual to turn undead}} {{Turn result=[[2d6]]}} {{HD destroyed (2d6)=[[2d6]]}} {{HD destroyed (3d6)=[[3d6]]}} {{HD destroyed (4d6)=[[4d6]]}}  
I got it, in the end. Customized fields work only if you have added {{outputall=1}} before which, unfortunately, does not work with freetext.  So either one or the other, depending on the result you wanna get and on which template you are working on. Personally, in my case I chose to use freetext rather than the customized fields, so I followed your lead and went on with that.
1615410741
David M.
Pro
API Scripter
Ahh, cool. Glad you figured it out. Finding up-to-date documentation on the various templates out there is sometimes a tedious process.