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

How do i modify Init value based on another value that changes during a combat round?

I have initiative as 2d10+modifier. I need to use a modifier each round the player gets 4 AP (action points). Each action point grants a bonus to your initiative. do its 2d10+modifier+(AP*5). question 1 how do I do that and assign a variable AP=4. Then I need a macro to do AP=AP-1 and for it to refigure a person initative. Example start of round. +2 modifier. 4 AP points  Total initiative is 32. The player draws a weapon this cost 1 AP. the person initiative should now read 27 and the imitative track should be updated also. How do I do this?
Lemme see if I've got the process straight. First a player starts the round by rolling 2d10 + some modifier + 5 times their current AP. Then, when a player performs an action, their current AP goes down by the number of AP the action costs, and their initiative goes down five times that number. Is that right? You can do most of this as follows: First, on a Character, create an Attribute called AP. Set its Current and Max values to 4, or whatever the starting AP value is. Next, create an Ability called Initiative. Make it look like this: /roll 2d10 + ( ?{Modifier|0} ) + @{AP} * 5 &{tracker} When a Token linked to this Character is selected, this Ability will ask the player for a modifier, then roll initiative and put it in the Turn Order window. You can optionally add additional lines explaining what is happening in the chat, like: /me rolls for initiative. Now create another Ability called Action. This Ability should look like this (with the same option to add additional lines for description): /roll ?{Action Points|1} * 5 &{tracker:-} When a Token linked to this Character is selected, this Ability will ask the player for the number of Action Points to spend, then will reduce the token's initiative in the Turn Order window by five times that number. You cannot automate changing Attribute values using Macros or Abilities; you must lower the AP Attribute manually. If you want to link it to one of a Token's bar, you can edit the appropriate bubble on the Token.
By the way, you can make these into general Macros that work on all Tokens linked to Characters if you change @{AP} above to @{selected|AP} and create Macros instead of Abilities.
thanks is there one page that actually explains the syntax of the programming languages and macros.
While that command is good is there any way to make all the text silent I just want to update the initiative tracker. /roll ?{Action Points|1} * 5 &{tracker:-}. Also is there any way to put an action point total for a character on the screen each player has 4 per round to spend. Also the player should only be able to input 0 to 6 (4+2 if hasted) when prompted.
Dice rolling syntax is explained here:&nbsp; <a href="https://wiki.roll20.net/Dice_Reference" rel="nofollow">https://wiki.roll20.net/Dice_Reference</a> Macros are explained here:&nbsp; <a href="https://wiki.roll20.net/Macros" rel="nofollow">https://wiki.roll20.net/Macros</a> Abilities are like Macros that are specific to one Character. They are briefly described here:&nbsp; <a href="https://wiki.roll20.net/Journal#Abilities_.28Need_Update.29" rel="nofollow">https://wiki.roll20.net/Journal#Abilities_.28Need_Update.29</a> See the rest of the wiki for more information.
1539281940

Edited 1539281991
I don't think an Ability or Macro can update the Turn Tracker without also sending text to the Text Chat. You can minimize the amount of space that goes to the Text Chat, though, by using Inline Rolls instead of the /roll command. Here's an example that sends only one line: Initiative: [[ 2d10 + ( ?{Modifier|0} ) + @{selected|AP} * 5 &amp;{tracker} ]] Alternatively, if you don't want players to see anything, but you're fine with seeing things yourself, you can change /roll to /gmroll, and only you, the GM, will see it: /gmroll 2d10 + ( ?{Modifier|0} ) + @{selected|AP} * 5 &amp;{tracker} You can limit the possible choices for Modifier by using a drop-down prompt for the Roll Query : /gmroll 2d10 + ( ?{Modifier|0|1|2|3|4|5|6} ) + @{selected|AP} * 5 &amp;{tracker} To display Action Point totals, each Token linked to a Character should be set to show the AP Attribute in one of its three bars. Alternatively, you can create a Macro that will list all current Action Point totals for all Characters in the Text Chat, something like this (where Bob, John Smith, and Laura are all names of Characters; change to the Characters in your own game): Bob's APs: @{Bob|AP} John Smith's APs: @{John Smith|AP} Laura's APs: @{Laura|AP} Or you could go fancy and use a Roll Template for this: &amp;{template:default} {{name=Action Points}} {{Bob=@{Bob|AP}}} {{John Smith=@{John Smith|AP}}} {{Laura=@{Laura|AP}}}
1539282376
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
David T. said: I don't think an Ability or Macro can update the Turn Tracker without also sending text to the Text Chat. You can minimize the amount of space that goes to the Text Chat, though, by using Inline Rolls instead of the /roll command. Here's an example that sends only one line: Initiative: [[ 2d10 + ( ?{Modifier|0} ) + @{selected|AP} * 5 &amp;{tracker} ]] Well, actually, you can simply make it an API command. Won't actually trigger an API script, but it will update the tracker: ! [[1d20 + 5 &amp;{tracker}]]
Ah. I tried that with a /roll command, and it didn't work, but I didn't consider combining an API command and an inline roll.