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

Using the @{target|xxxxxx}. To pull multiple data without having re click target token every time.

I’m trying to write a macro to select your character (or any) and select the target u want to attack and for the macro to work out all the To-Hits and damage etc etc Now it’s easy to pull all the data for the attacking token using 1 click of @{selected|xxxxxx} But for the victim of the attack using @{target|xxxxxxx} only seems to let me pull 1 but of data per click - so I’d have to click the targets token 3 times to pulls its AC, hp and say armour type. is there a way I can do this with just clicking on the target token once Is the some way of making the macro remember who the  @{target|xxxxx} was so I don’t have to keep re clicking Perhaps something like @{targeted1|xxxxx    ????? or having 2 different @{selected|xxxxx}   So sort of @{selected1 and @{selected2| Or basically otherwise some trick/method of pulling 4-3 bits of info about 2 different tokens (the PC and the baddies)  trying to write a (non API) macro that calculate the attack to hit and roll damage
1762029902

Edited 1762030253
Example using 5e 2014: /desc @{target|attacker|token_name} attacks @{target|defender|token_name} (HP @{target|defender|bar1|max}, AC @{target|defender|npc_ac}) This would result in something like: "Orc attacks Duergar (HP 26, AC 16)" Change the field names to suit.  The wiki  has the details.
1762036702

Edited 1762036950
Cool - that works. im realy trying to get it to work for a Conan RPG game (using the Hyborian age sheet) which does include lines on the Attributes page of the character sheet - which makes it easy to pull attack bonus and damage. Anyway - I just mocked up a D&D 5e version here for illustration.  But as the attributes page of the 5e sheet does not have entries attack bonus & damage you’d have to add an extra line on the attributes or nest in a sub macro (Note - I calculated the d20 roll differently than normal.  I calculated what you need to hit rather than calculating the result - this way the d20 on screen is the what u want to see rather than the usual rolling and then looking into the chat to see the final result) - run the macro, select attacking token, then select defending token &{template:default} {{name=@{target|attacker|token_name} Bravely attacks @{target|defender|token_name}.  }}                                                                                                {{Defenders AC =@{target|defender|ac} }}                                                     {{roll to needed to Hit = [[@{target|defender|ac} -@{target|attacker|xxxxAttackModifierxxx} ]]. }}   {{Dice Roll = [[1d20]].  }}.  {{ Damage dealt =[[@{selected|attacker|xxxxxdamagedealt} ]].    - don’t include any returns