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

FASERIP (again) working with the API and macros

1664740963
So RL got in the way for a bit, but we are back and moving forward with the campaign.  We have decided to leave the API as is until we have played a bit and develop a list of things we wish to add. I am working on creating macros for the players to use in their token bars.  I am trying to imbed the API command into the macro.  I created a list macro: ?{Atrribute|Fighting, @{selected|VFighting}| Agility, @{selected|VAgility}| Strength, @{selected|VStrength}| Endurance, @{selected|VEndurance}| Reason, @{selected|VReason}| Intuition, @{selected|VIntuition}| Psyche, @{selected|VPsyche}  but when i try and add the command for the API it fails.  This works,  !ut @{selected|vfighting} I tried this but it fails !ut ?{Atribute|Fighting, @{selected|VFighting}| Agility, @{selected|VAgility}| Strength, @{selected|VStrength}| Endurance, @{selected|VEndurance}| Reason, @{selected|VReason}| Intuition, @{selected|VIntuition}| Psyche, @{selected|VPsyche} I have tried it with wrapping the list in () {} and [].  no glory.  Any ideas?
1664751983

Edited 1664752006
GiGs
Pro
Sheet Author
API Scripter
I don't know the UT script so I'm just guessing. The code might be missing a closing } !ut ?{Atribute|Fighting,@{selected|VFighting}| Agility,@{selected|VAgility}| Strength,@{selected|VStrength}| Endurance,@{selected|VEndurance}| Reason,@{selected|VReason}| Intuition,@{selected|VIntuition}| Psyche,@{selected|VPsyche}} You might need to remove the spaces after the commas as I have above, or remove the first space like !ut?{Atribute|Fighting, @{selected|VFighting}| Agility, @{selected|VAgility}| Strength, @{selected|VStrength}| Endurance, @{selected|VEndurance}| Reason, @{selected|VReason}| Intuition, @{selected|VIntuition}| Psyche, @{selected|VPsyche}} If that doesn't work, I'd check through each of your attributes and make sure they are valid. But that only should matter if they are selected.
1664752044
GiGs
Pro
Sheet Author
API Scripter
PS Atribute is spelled Attribute
1664760361
GiGs said: PS Atribute is spelled Attribute Good catch.  More worried about getting it working.  
1664760603
GiGs said: You might need to remove the spaces after the commas as I have above, or remove the first space like That worked.  .....sigh
1665420936
Update for FASERIP use. We have successfully tested the API and now are have successfully started writing token actions. Here is my new question:  The API has one required and two optional variables.  I have written macro to deal with the required and the first optional variables.  The third variable is really the first just presented differently.  How do I get the results from the first input to apply to the third variable? How it works and what I am trying to do API requires the rank to be checked - In this example we are going to hit someone with a baseball bat.  So player selects Blunt Attack which is associated with the FIghting Attribute.  So the macro pulls the rank for fighting which is remarkable. The first optional is adjustment to roll (column shift).  - no change here so the player selects 0 from the drop down. The second optional is action type - so we chose blunt attack initially in the first step.  The API is looking for BA which is associated with blunt attack so that it can return the results of the roll (white, green, yellow or red) and the results of the attack (miss, hit, slam, stun).   I need to have Blunt attack return the BA.  How can I have the macro receive the first select "Blunt Attack" and pick from the array the correct "BA"?  Or how do I write it so that it pulls it from the hardcoded macro (see examples below) Here is the example provided by the API Example !ut Monstrous  (Monstrous rank roll) !ut Incredible 2 CA  (Incredible rank with +2 column shift on a Catching attempt) !ut Remarkable DO -2  (Remarkable rank with -2 column shift on a Dodging attempt) !ut Excellent BA  (Excellent rank Blunt Attack) Here is what I have so far this works for the required variable and the first optional variable which is the column shift. !ut ?{Action| Blunt Attack,@{selected|VFighting}| } ?{Column Shift|10|8|6|4|2|0|-2|-4|-6|-8|-10} Can I do something like this?  IF so how do i get the BA out of the line? !ut ?{Action| Blunt Attack,@{selected|VFighting},BA| } ?{Column Shift|10|8|6|4|2|0|-2|-4|-6|-8|-10}
1665421391
Different question: I have a player with an altar ego.  When they change the get a +2 column shift to their Agility ranking.  When doing a Agility check how would I apply the natural +2 to the check and have that be added to any column shift required by the roll.  So if the player is partial stuck by webbing and they want to dodge from a blow.  The DM gives them a -4 column shift to their dodge.  so the roll should be (rank [+2-4]) =results. Any thoughts on how to do that with this part of the command macro on agility based rolls only? ?{Column Shift|10|8|6|4|2|0|-2|-4|-6|-8|-10}
1665615032
@Gigs Any chance I can draw you into a convo for help with the above two questions?
1665616831
GiGs
Pro
Sheet Author
API Scripter
I havent been following the thread. Whats the issue?
1665617965
GiGs said: I havent been following the thread. Whats the issue? You were helping so i thought you were following... here is the first question: I have a player with an altar ego.  When they change the get a +2 column shift to their Agility ranking.  When doing a Agility check how would I apply the natural +2 to the check and have that be added to any column shift required by the roll.  So if the player is partial stuck by webbing and they want to dodge from a blow.  The DM gives them a -4 column shift to their dodge.  so the roll should be (rank [+2-4]) =results. Any thoughts on how to do that with this part of the command macro on agility based rolls only? ?{Column Shift|10|8|6|4|2|0|-2|-4|-6|-8|-10} Here is the main question: Here is my new question:  The API has one required and two optional variables.  I have written macro to deal with the required and the first optional variables.  The third variable is really the first just presented differently.  How do I get the results from the first input to apply to the third variable? How it works and what I am trying to do API requires the rank to be checked - In this example we are going to hit someone with a baseball bat.  So player selects Blunt Attack which is associated with the FIghting Attribute.  So the macro pulls the rank for fighting which is remarkable. The first optional is adjustment to roll (column shift).  - no change here so the player selects 0 from the drop down. The second optional is action type - so we chose blunt attack initially in the first step.  The API is looking for BA which is associated with blunt attack so that it can return the results of the roll (white, green, yellow or red) and the results of the attack (miss, hit, slam, stun).   I need to have Blunt attack return the BA.  How can I have the macro receive the first select "Blunt Attack" and pick from the array the correct "BA"?  Or how do I write it so that it pulls it from the hardcoded macro (see examples below) Here is the example provided by the API !ut Excellent BA  (Excellent rank Blunt Attack) Here is what I have so far this works for the required variable and the first optional variable which is the column shift. !ut ?{Action| Blunt Attack,@{selected|VFighting}| } Can I do something like this?  IF so how do i get the BA out of the line? !ut ?{Action| Blunt Attack,@{selected|VFighting},BA| } ?{Column Shift|10|8|6|4|2|0|-2|-4|-6|-8|-10}
1665892216
ok i think i've isolated part of my problem.  I will need some help with this either a really complicated macro or change to the API command or adding another variable to the API. so i am going to be begging for help here: @Gigs, @The Aaron, @Keithcurtis, @timmaugh so using the macro I am selecting "blunt attack" from a drop down to return the ranking from @selected|vfighting.  IF i try and reuse that drop down I will simply get  @selected|vfighting again.  What i need is "blunt attack" again.  so how do I get the entry from the drop down and not the results of the selection? If that won't work then might need to nest a set of variables in the API.  Have actiontypeselection=Blunt Attack return bluntattack which in variable actiontyperank returns the rank and actiontype returns bluntattack again.  Or something way better than that.