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 .
×

Macros; Variable within Variable

This might not be possible, but I might just be missing the syntax. Trying to do macro for monster abilities and instead of showing {power-1-attack} vs {power-1-def}, I'd like to actually display a target's {power-1-def}, now I could obviously hardcode it to do something like: [[1d20+@{selected|power-1-attack}]] vs @{target|AC} AC, but I'd like to do something [[1d20+@{selected|power-1-attack}]] vs @{target|{selected|power-1-def}} @{selected|power-1-def}
1468137974

Edited 1468138168
Matt
Plus
Bobby said: This might not be possible, but I might just be missing the syntax. Trying to do macro for monster abilities and instead of showing {power-1-attack} vs {power-1-def}, I'd like to actually display a target's {power-1-def}, now I could obviously hardcode it to do something like: [[1d20+@{selected|power-1-attack}]] vs @{target|AC} AC, but I'd like to do something [[1d20+@{selected|power-1-attack}]] vs @{target|{selected|power-1-def}} @{selected|power-1-def} Because of order of operations , this does not really work. It can also not be done with prompts for the same reason (it attempts to evaluate the outside attribute before the inside attribute becomes something meaningful). I recommend hard-coding the powers to the correct defense, since it saves a step (rather than macro -> attribute --> target, it just goes macro-->target), and it actually works. If the power could use more than one defense, hardcode both or use a { @{target|AC},@{target|Ref} }kl1 type of thing. I'm not sure how having a power-1-def attribute actually saves any work rather than just copying/pasting.
The power-1-def is what is in the D&D 4E sheet under powers.  I was hoping to use a universal macro for all monsters, having like Mob 1 Power, Mob 2 Power,... and it using the variables in the character sheet.  But I understand that its an odd request, just trying to do a little too much via macros probably.
1468141692

Edited 1468141717
Matt
Plus
Honestly, for 4e I prefer NOT to use the sheets, as I find that they tend to add tons of unnecessary attributes (for instance power-1-def). Rather, I just use an macro attack template and a couple core attributes (STR, DEX, WIS, AC, Fort, Ref, etc, Half Level, WEnh, Prof, Expertise, ItemDmg, etc.), since almost all of your attacks will be virtually identical and could just be based off these core values rather than having atk-1-bonus, atk-2-bonus for 20 different powers where they're all the same number for every single sheet. Do you really need to know every player's Misc bonus to streetwise? Prob not. Also I've had the sheet overwrite my customized attribute values with sheet values, going so far as to repeatedly replace my ACs with 0 because the sheet had an ac value at 0, so I prefer to just get rid of it entirely and just write the macros myself as token actions. For instance: /me makes an attack against @{target|token_name}: [[1d20+@{Int}+@{Half Level}+@{Wenh}+?{atk bonus|0}]] vs Reflex @{target|Reflex}! If it hits, it deals [[1d8+@{Int}+@{Wenh}]] psychic damage! Quicker, easier, will not change itself without warning, uses only a couple important things, and does not take up the entire chat window like lots of roll templates do (especially with how complicated higher-level 4e powers are). Additionally, since 90% of your attacks will use the same bonuses, you can just copy/paste the whole thing and change "Reflex" to "Fortidude" and "psychic" to "cold" and you're done. That's just my preference though, and I recognize others like other things as well, so try a couple things and do what works for you! Cheers!
1468152160
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Also, as general info for future macros you make, you can't mix selected and target in the same macro. Having target in the macro deselects everything when the macro is activated.
You certainly can mix selected and target. I do it all the time.
1468153558
Lithl
Pro
Sheet Author
API Scripter
What you can't do is use @{target} in an API command and expect the chat:message event to have a msg.selected array.
1468168133
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Doh! sorry, I was thinking of the msg.selected for API, which is obviously (now that I've had it pointed out to me), not relevant here