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

[AD&D 1E Sheet] Spell level template - can't call spell level properly in a generic macro

1491255546

Edited 1491272212
Not sure if this would be the right forum to post in, if not then please move it. Background Trying to get a different 'default macro text' set up for sheet. The current macro text on the sheet for all the spells is; Current Spell Macro text &{template:general} {{name=@{character_name}}} {{subtag=Casts: @{name}}} {{Range:=@{range}}} {{Duration:=@{duration}}} {{AOE:=@{aoe}}} {{Save:=@{save}}} I would like to do something along the lines of this as the new macro text for spells; Possible New Spell Macro text &{template:default}{{name=*@{character_name} casts* **@{name}**}} &nbsp;{{Spell level=@{level} }} {{Caster Level=@{selected|class} @{selected|level}}} {{school=@{school}}}{{components=@{components}}}{{Casting Time=@{ct}}}{{range=@{range}}}{{duration=@{duration}}}{{AOE=@{aoe}}}{{save=@{save}}} {{Effects=@{description}}} {{Full Description=[Click **Here** to View](<a href="http://pandaria.rpgworlds.info/cant/rules/adnd_spells.htm#@{name}" rel="nofollow">http://pandaria.rpgworlds.info/cant/rules/adnd_spells.htm#@{name}</a>) }} Problem The problem I'm having is getting the spell level to display correctly. When I hit the roll button for the spell on the spell sheet itself, it outputs/displays the spell level correctly in the chat. But when I call the macro from an api button menu, the level is now pulled from the character level, no longer from the spell level.&nbsp; API Button Menu /w @{selected|character_name} &{template:general}{{name=@{selected|character_name}'s Spells}} {{subtag=Choose a spell}} {{ 1st Level=[@{selected|repeating_spells_$0_name}](~selected|character-name|repeating_spells_$0_roll)[@{selected|repeating_spells_$1_name}](~selected|character-name|repeating_spells_$1_roll)[@{selected|repeating_spells_$2_name}](~selected|character-name|repeating_spells_$2_roll) etc. }} Everything else pops out the correct info., just not the level. Obviously the&nbsp; {{Spell level=@{level} }} portion above is not the correct call for this, but I can't seem to find what it should be.&nbsp; :::::Edit:::: Some various things that didn't work; {{Spell level=@{selected|level} }} Returns the character level when using built in sheet button and also when running the API button menu. {{Spell level=@{level} }} Returns the actual spell level when using the sheet button, but then returns the character level when using the API menu. And because someone is sure to ask, the original default 'Spell Macro Text' behaves the exact same way that my modified macro does. In short when using the spell sheet 'button' it returns the actual spell level that is filled in for that spell, buuut when using an API button menu to then call that spell it also returns the character level instead of the spell level. Thanks for any help. Cheers.
You would need something to the effect of @{selected|level} I would think. I could be wrong, but since the rest of the macro is pulling character info with @{selected| I'd imagine that would fix it.
One of the things I tried, but didn't work. Thanks for that though. I think I might have to edit the above to better reflect some of the things that didn't work, and how exactly they failed. Pretty sure I'm going to need one of the folks who made the sheet to help me out here. But anyone who has experience with the 1ed sheet is welcome to chime in.
1491284220
vÍnce
Pro
Sheet Author
I believe the issue is that all attributes must be uniquely named. The sheet has "attr_Level"&nbsp;for Class 1's level, and it also uses "attr_level" ( @{repeating_spells_$X_level} ) within the repeating spells sections to indicated a spell's level. ;-( &nbsp; At one time, attributes within a repeating section "could" use the same attribute name as another located outside a fieldset. &nbsp;That changed once repeating sections got the update that gave them rowid's and the ability to rearrange the rows. &nbsp;While it "may" still work on-sheet and possibly with some macros, other uses (API Command buttons, sheet workers, API scripts, etc.) could be problematic, since it seems to find one version of the attribute and stops. IDK for sure what is actually going on under roll20's hood, but the bottom line is I probably need to change the class 1 level attribute name to "@{Level_1}" similar to the other class level attributes&nbsp;@{Level_2}, and @{Level_3}. &nbsp;I suppose there will also need to be a sheet worker migration routine as well. &nbsp;Joy. &nbsp;
Whoa there Nelly. Back up the bus, there. And any other pithy phrase you care to use. No need to change the sheet on my account. Just trying to find out if there was something I was overlooking, since I'm still finding my way with macros here. It'd be great if things could be resolved to where a generic macro call actually works, but I can live with just leaving it out of the macro text for now. Just wasn't sure if it wasn't something silly/stupid/glaringly obvious that I was missing. As far as I'm concerned you can put this on the back burner, and whenever you get to it, you get to it. Well you know what they say the reward for a job well done is......more work. &nbsp;:-) Cheers.
1491316576
vÍnce
Pro
Sheet Author
No worries AI H. &nbsp;You just discovered something that SHOULD BE rectified. &nbsp;I'll play around and see if there is another option. &nbsp;Even with a migration routine that would swap class one level @{level} to @{level_1}, I'm afraid existing off-sheet macros would break since they would still be looking for @{level}. I would rather not change the spell level attribute since it's used in the fully editable macro-text on each spell, which means a migration(parser) to check and change existing macro-text on people's sheets. &nbsp;Javscript is still just a dusty tome on my desktop. &nbsp;;-) &nbsp;
1491322042

Edited 1491322059
Like I said, no worries. Just another item to be put on the "Leaning Tower of Things to be Gotten to Sometime Before the Heat Death of the Universe"