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 .
×
May your rolls be merry + bright! 🎄
Create a free account

Improving on Token Action creations

Say you use token action to create your main actions, say an attack or a healing. You can of course add to the raw initial macro that looks like %{-Mt3nDIAAZD1C2My8caj|repeating_attack_-Mt4DkpcCUC2bhjVMrwv_attack} in terms of video, sound, comments etc. What if you wanted to use one of the results (eg : damage or healing) of the action to complete it (eg : heal the target) with the amount just drawn ? It starts like : !token-mod --sel @{target|token_id} --set bar1_value|+[[(?{Damage Healed})]] but that wont work, unless there is another syntaxe mistake, I guess the problem is "Damage healed". I tried Heal, or ¨Heal...where can I find the names of damage or attack roll or healing from the original macro ? Thanks in advance
1643409659
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
If I understand correctly, the issue is that each line (action and API call) are separate events. I don't believe that queries span separate events.
I am unsure it is what I meant. The question could be phrased differently : I have a macro about healing or attack. It could read !javelin or !healing. I then want to add a line to my macro that uses the results of the attack (say damage) or the results of a healing (say 1d4 + 4 = ?). I dont know how to name such results so it will be understood. Of course, one way to do it is to not use the healing macro created by token action, but to recreate the spell. Is that what you mean to be the only solution ? Or is there a way to "translate"  %{-Mt3nDIAAZD1C2My8caj|repeating_attack_-Mt4DkpcCUC2bhjVMrwv_attack} into actual lines of codes, so I can "pickup" the healing result ? At the end of the day, the idea is simply that when someone administers a healing, he can target the beneficiary, and its hit points wil be automatically increased...
1643477997
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Without knowing what !javelin does (That's an API script formatted command), it's hard to answer. If you run that macro (%{-Mt3nDIAAZD1C2My8caj|repeating_attack_-Mt4DkpcCUC2bhjVMrwv_attack}) by pressing the button on the character sheet that produces it, then going into chat and pressing the up arrow, you should be able to see all the code that was sent. That code is "fire and forget" though. Once it is sent to chat, there is no hook to get at it again.* What I was getting at is that a macro that contains separate commands: !SomeAPICOMMAND Macro Code 1 Other Macro Code 2 ...has no communication between lines. The API command can't use anything from Macro Code 1, and Macro Code 2 can't use anything produced by Macro Code 1. You can't carry information from one command to another. *However... If you can post the full code from an example cooperation you seek, there could be workarounds, possibly with one of Timmaugh's meta scripts.