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

SWRPG-API [Star Wars] Macros

I have a few questions. First, Is there a list of what everything is called for writing macros? I'm incredibly new to doing so and have edited a few successfully, but I would like to write a few of my own. Second, I'm interested in doing power cards for somethings as well.Is that possible and is there separate call outs? Third, one of the macros I want to make is for the selected token to make an attack using their main weapon, or even better if I could could set it so they could select one of their weapons. How would I do this? If I can't make it a selected option how would I make it select a second or third weapon. Would it be possible to also select a target and automatically pull up their soak and defense? This is what I have so far. I found it on a post from @Ziechael. It doesn't seem to add purple dice though. How would I fix that? Also can I add any of the other options I mentioned above? !eed characterID(@{selected|character_id}) label(Weapon:@{selected|repeating_weapons_$0_weaponmake}|Damage:@{selected|repeating_weapons_$0_damage}|Critical:@{selected|repeating_weapons_$0_critical}|Range:@{selected|repeating_weapons_$0_weaponrange}|Qualities:@{selected|repeating_weapons_$0_weaponspecial}) @{selected|repeating_weapons_$0_weapondice} combat(personal) encum(@{selected|encumbrancemax}|@{selected|encumbrance}) @{selected|repeating_weapons_$0_weaponskill} @{selected|repeating_weapons_$0_weaponcondition} [[ {?{Range|Engaged,1|Short,1|Medium,2|Long,3|Extreme,4} + ?{PC Engaged|No,0|Yes and using Ranged - Light,1|Yes and using Ranged - Heavy,2} - ?{Target Larger|No,0|Yes,1},1}kh1 ]]p upgrade(ability|?{Upgrade Ability|0|1|2|3|4|5}) upgrade(difficulty|[[ ?{Upgrade Difficulty|0|1|2|3|4|5} + ?{Target engaged with ally|No,0|Yes,1} ]]) ?{Boost/Setback|No,0b 0blk|Yes,?{Boost (Blue)|0|1|2|3|4|5}b ?{Setback (Black)|0|1|2|3|4|5}blk} (gmdice) Thanks in advance, Palandar
1660685255
Ziechael
Forum Champion
Sheet Author
API Scripter
Been a while since I played SW but I'll give it a go... that macro was applied as a token action so I could easily replicate with a find/replace to change it for each weapon row... you could likely do a weapon selector with a query (untested): !eed characterID(@{selected|character_id}) label(Weapon:?{Weapon|@{selected|repeating_weapons_$0_weaponmake},@{selected|repeating_weapons_$0_weaponmake}|Damage:@{selected|repeating_weapons_$0_damage}|Critical:@{selected|repeating_weapons_$0_critical}|Range:@{selected|repeating_weapons_$0_weaponrange}|Qualities:@{selected|repeating_weapons_$0_weaponspecial}) @{selected|repeating_weapons_$0_weapondice} combat(personal) encum(@{selected|encumbrancemax}|@{selected|encumbrance}) @{selected|repeating_weapons_$0_weaponskill} @{selected|repeating_weapons_$0_weaponcondition}| @{selected|repeating_weapons_$1_weaponmake},@{selected|repeating_weapons_$1_weaponmake}|Damage:@{selected|repeating_weapons_$1_damage}|Critical:@{selected|repeating_weapons_$1_critical}|Range:@{selected|repeating_weapons_$1_weaponrange}|Qualities:@{selected|repeating_weapons_$1_weaponspecial}) @{selected|repeating_weapons_$1_weapondice} combat(personal) encum(@{selected|encumbrancemax}|@{selected|encumbrance}) @{selected|repeating_weapons_$1_weaponskill} @{selected|repeating_weapons_$1_weaponcondition}| @{selected|repeating_weapons_$2_weaponmake},@{selected|repeating_weapons_$2_weaponmake}|Damage:@{selected|repeating_weapons_$2_damage}|Critical:@{selected|repeating_weapons_$2_critical}|Range:@{selected|repeating_weapons_$2_weaponrange}|Qualities:@{selected|repeating_weapons_$2_weaponspecial}) @{selected|repeating_weapons_$2_weapondice} combat(personal) encum(@{selected|encumbrancemax}|@{selected|encumbrance}) @{selected|repeating_weapons_$2_weaponskill} @{selected|repeating_weapons_$2_weaponcondition}} [[ {?{Range|Engaged,1|Short,1|Medium,2|Long,3|Extreme,4} + ?{PC Engaged|No,0|Yes and using Ranged - Light,1|Yes and using Ranged - Heavy,2} - ?{Target Larger|No,0|Yes,1},1}kh1 ]]p upgrade(ability|?{Upgrade Ability|0|1|2|3|4|5}) upgrade(difficulty|[[ ?{Upgrade Difficulty|0|1|2|3|4|5} + ?{Target engaged with ally|No,0|Yes,1} ]]) ?{Boost/Setback|No,0b 0blk|Yes,?{Boost (Blue)|0|1|2|3|4|5}b ?{Setback (Black)|0|1|2|3|4|5}blk} (gmdice) To pull up soak and defence you could add another line to the macro along the lines of: /w gm Soak: @{target|soak} | Defence: @{target|defence} note: those likely aren't the attribute names, as I say... it's been a while! You should be able to hover over fields to get the true name or analyse the sheet code in the github repo. You'll have to remind me what purple dice are used for... pretty sure that macro was conclusive and the code suggests that a combo of range/engaged/target size should add purple dice?
I think I got some of it! this is what I am using for now. Though I would like it to allow me to select weapons from their sheet if that is possible. Also I haven't been able to get defense to work yet. !eed ?{Range|Engaged (2 Purple),2|Short (1 Purple),1|Medium (2 Purple),2|Long (3 Purple),3|Extreme (4 Purple),4|Engaged W/Range Light (2 Purple),2|Engaged with Ranged Heavy (3 Purple),3}p ?{Target Size|Same,0|Larger,-1|Smaller,1}p upgrade(ability|?{Upgrade Ability|0|1|2|3|4|5}) upgrade(difficulty|?{Upgrade Difficulty|0|1|2|3|4|5}) ?{Boost (Blue)|0|1|2|3|4|5}b ?{Setback  (Black)|0|1|2|3|4|5}blk} characterID(@{selected|character_id}) label(Weapon:@{selected|repeating_weapons_$0_weaponmake}|Damage:@{selected|repeating_weapons_$0_damage}|Critical:@{selected|repeating_weapons_$0_critical}|Range:@{selected|repeating_weapons_$0_weaponrange}|Qualities:@{selected|repeating_weapons_$0_weaponspecial}) @{selected|repeating_weapons_$0_weapondice} combat(personal) @{selected|repeating_weapons_$0_weaponskill})
Thank you for that info it helped! I'll keep trying with the weapon query thing. The purple dice are used for base difficulty. Red dice are upgraded difficulty. You are correct about range/engaged/target size should add purple dice.