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

Any Macros I can make for tracking a modified spellcasting system?

I am playing in a Star Wars 5e game. Me and the other players are used to using the OGL 5e script to automatically tracks spells and the like. It works with this modified character sheet pretty well but it can't track "spells." This conversion uses points similar to sorcerer points to cast powers. I imagine that an API could be made to work but I have no idea where to start there. So that leaves Macros. Can any of you guys think of a solution, existing or otherwise, that might allow us to track them? We are using ChatSetAttr.
1556363041

Edited 1556363688
Andreas J.
Forum Champion
Sheet Author
Translator
I'm not that familiar with API scripts, but it should be possible in some way. Creating a whole API script that listens to people Force/Tech rolls and subtracts the appropriate amount from  "tech_power_points_expended" or "force_power_points_expended" depending on which one is used, and API:Chat could be central for that. I rolled a 1st level Force power from the sheet and it told the output macro for it was: @{Guy|wtype}&{template:power} {{level=force 1}} {{name=Force Push}} {{castingtime=1}} {{range=30 ft}} {{target=enemy}} {{duration=}} {{description=1d6 force dmg}} {{athigherlevels=}} {{innate=}} 0 @{Guy|charname_output} So the abstract would be something like: 1. Scripts listens for chatt output made with "template:power" 2. reads the character's name and the level of the power("Guy", and "force 1" in the above example) 3. calculates based on the power level how many points are to be subtracted from "force_power_points_expended" (I'm pretty sure it was 1+[level of power] in SW5E) (if the stat would go under zero, it would say in chat that the char doesn't have enough points) 4. (optional) output to chat that the subtraction was made, tell the remaining force points If you just go with trying to use CharSetAttr, based on a quick skim on the Readme, I guess it could be something like: !setattr --sel --force_power_points_expended|-[[number]] where "number" is replaced with how many points is to be subtracted, and the "--sel" command would do this to the selected token inked to a character sheet. The CharSetAttr script cold do better than what I suggested, but then I suggest to read the Readme carefully and experiment with some of it's more advanced options, like combining it with templates or macros. Or you could make Force/Tech points one of the token bubbles, which would make them easy to edit on the fly. EDIT: This thread about API and spell points from a few weeks ago might also help
So I've been able to make this so far. %{selected|repeating_attack_$1_attack} !modbattr --name charname --force_power_points_total|-[[?{Cast at what level?}+1]] &{template:atk} {{desc=**Force Reserves: @{Gaaraddik|force_power_points_total}}} I'm running into two problems.  1. The desc showing my remaining force points comes out before the attribute is changed. Is there a way to add a delay so it displays the force points after the attribute change? 2. The calculation for ?{Cast at what level? works with the built in spell upscaling but I can't get it to add a +1. It just uses whatever spell level I selected and doesn't add +1 unlike if I just type -[[?{Cast at what level?}+1]] in chat which does what I want it to. .
1556468670
Andreas J.
Forum Champion
Sheet Author
Translator
I think you could use the --silent command to not make it show the points, and only call it when you want to see the total?
Andreas J. said: I think you could use the --silent command to not make it show the points, and only call it when you want to see the total? So the silent command only takes away the yellow part here. The "Force Reserves: 9" comes out before the chatsetattr changes the total to 7. I need the &{template:atk} {{desc=**Force Reserves: @{Gaaraddik|force_power_points_total}}} to come out only after the total has changed. I can work around this by it just telling me that I'm out of FP and can't cast. But I'd prefer it to work this way. The bigger issue is that !modbattr --name charname --force_power_points_total|-[[?{Cast at what level?}+1]] doesn't do the cast level +1. It only subtracts the cast level. I imagine it's some syntax error on my part but I can't figure it out.