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

[Shadowrun Anarchy] Need some help to activate skill from tokens

Hi guys i want to realize a roll20 macro for Shafowrun Anarchy NPC. The purpose of the macro is to select a NPC token and click on an action button who offer a list of skills where i can choose the appropriate skill and that launch the dice for me in the chat. So far I have done this but it doesn't work (the skill is in french but i think the wording before the " , " is not important) : /em @{selected|character_name} ?{Jet de Compétences | Acrobatie,/roll 1d6 +@{escape_artist}+@{agility}| Armes à feu,/roll 1d6 +@{firearms}+@{agility}| Armes lourdes,/roll 1d6 +@{heavy_weapons}+@{agility}| Armes à projectiles,/roll 1d6 +@{projectile_weapons}+@{agility}| Armes de véhicules,/roll 1d6 +@{vehicle_weapons}+@{agility}| Athlétisme,/roll 1d6 +@{athletics}+@{agility}| Biotech,/roll 1d6 +@{biotech}+@{logic}| Combat astral,/roll 1d6 +@{astral_combat}+@{willpower}| Comédie,/roll 1d6 +@{con}+@{charisma}| Conjuration,/roll 1d6 +@{conjuring}+@{willpower}| Corps à corps,/roll 1d6 +@{close_combat}+@{strength}| Electronique,/roll 1d6 +@{electronics}+@{logic}| Etiquette,/roll 1d6 +@{disguise}+@{charisma}| Furtivité,/roll 1d6 +@{stealth}+@{agility}| Hacking,/roll 1d6 +@{hacking}+@{logic}| Ingénierie,/roll 1d6 +@{engineering}+@{logic}| Intimidation,/roll 1d6 +@{intimidation}+@{charisma}| Négociation,/roll 1d6 +@{negociation}+@{charisma}| Pilotage véhicules divers,/roll 1d6 +@{piloting_other}+@{agility}| Pilotage véhicules terrestres,/roll 1d6 +@{piloting_ground}+@{agility}| Pistage,/roll 1d6 +@{tracking}+@{agility}| Sorcellerie,/roll 1d6 +@{sorcery}+@{willpower}| Survie,/roll 1d6 +@{survival}+@{logic}| Technomancie,/roll 1d6 +@{tasking}+@{logic}} Please can you help me everyone to resolve this ?
1625050853
Finderski
Plus
Sheet Author
Compendium Curator
I believe you'll need to put selected| in each of your attribute calls.  For example... Acrobatie,/roll 1d6 +@{selected|escape_artist}+@{selected|agility}|
1625052932

Edited 1625067149
GiGs
Pro
Sheet Author
API Scripter
You can also move some of your code outside the query to streamline it a bit, like /roll 1d6 +?{Jet de Compétences | Acrobatie,@{selected|escape_artist}+@{selected|agility}| Armes à feu,@{selected|firearms}+@{selected|agility}| Armes lourdes,@{selected|heavy_weapons}+@{selected|agility}| Armes à projectiles,@{selected|projectile_weapons}+@{selected|agility}| Armes de véhicules,@{selected|vehicle_weapons}+@{selected|agility}| Athlétisme,@{selected|athletics}+@{selected|agility}| Biotech,@{selected|biotech}+@{selected|logic}| Combat astral,@{selected|astral_combat}+@{selected|willpower}| Comédie,@{selected|con}+@{selected|charisma}| Conjuration,@{selected|conjuring}+@{selected|willpower}| Corps à corps,@{selected|close_combat}+@{selected|strength}| Electronique,@{selected|electronics}+@{selected|logic}| Etiquette,@{selected|disguise}+@{selected|charisma}| Furtivité,@{selected|stealth}+@{selected|agility}| Hacking,@{selected|hacking}+@{selected|logic}| Ingénierie,@{selected|engineering}+@{selected|logic}| Intimidation,@{selected|intimidation}+@{selected|charisma}| Négociation,@{selected|negotiation}+@{selected|charisma}| Pilotage véhicules divers,@{selected|piloting_other}+@{selected|agility}| Pilotage véhicules terrestres,@{selected|piloting_ground}+@{selected|agility}| Pistage,@{selected|tracking}+@{selected|agility}| Sorcellerie,@{selected|sorcery}+@{selected|willpower}| Survie,@{selected|survival}+@{selected|logic}| Technomancie,@{selected|tasking}+@{selected|logic}}
1625067131
GiGs
Pro
Sheet Author
API Scripter
unrelated to this issue, I noticed the roll buttons in the sheet were improperly named, and there were a lot of duplicate names, which meant they cant be dragged to the macro bar or used in chat menus. I've just submitted a fix for that, so when that goes live you can use those properly.
1625075973

Edited 1625077401
Yep but no problem with the help of Finderski and one onther dude, i got this and that works perfectly : @{selected|token_name} /roll ?{Jet de Compétences| Acrobatie,(@{selected|escape_artist}+@{selected|agility}+@{selected|wounds})d6>5| Armes à feu,(@{selected|firearms}+@{selected|agility}+@{selected|wounds})d6>5| Armes lourdes,(@{selected|heavy_weapons}+@{selected|agility}+@{selected|wounds})d6>5| Armes à projectiles,(@{selected|projectile_weapons}+@{selected|agility}+@{selected|wounds})d6>5| Armes de véhicules,(@{selected|vehicle_weapons}+@{selected|agility}+@{selected|wounds})d6>5| Athlétisme,(@{selected|athletics}+@{selected|agility}+@{selected|wounds})d6>5| Biotech,(@{selected|biotech}+@{selected|logic}+@{selected|wounds})d6>5| Combat astral,(@{selected|astral_combat}+@{selected|willpower}+@{selected|wounds})d6>5| Comédie,(@{selected|con}+@{selected|charisma}+@{selected|wounds})d6>5| Conjuration,(@{selected|conjuring}+@{selected|willpower}+@{selected|wounds})d6>5| Corps à corps,(@{selected|close_combat}+@{selected|agility}+@{selected|wounds})d6>5| Electronique,(@{selected|electronics}+@{selected|logic}+@{selected|wounds})d6>5| Etiquette,(@{selected|disguise}+@{selected|charisma}+@{selected|wounds})d6>5| Furtivité,(@{selected|stealth}+@{selected|agility}+@{selected|wounds})d6>5| Hacking,(@{selected|hacking}+@{selected|logic}+@{selected|wounds})d6>5| Ingénierie,(@{selected|engineering}+@{selected|logic}+@{selected|wounds})d6>5| Intimidation,(@{selected|intimidation}+@{selected|charisma}+@{selected|wounds})d6>5| Négociation,(@{selected|negotiation}+@{selected|charisma}+@{selected|wounds})d6>5| Pilotage véhicules divers,(@{selected|piloting_other}+@{selected|agility}+@{selected|wounds})d6>5| Pilotage véhicules terrestres,(@{selected|piloting_ground}+@{selected|agility}+@{selected|wounds})d6>5| Pistage,(@{selected|firearms}+@{selected|tracking}+@{selected|wounds})d6>5| Sorcellerie,(@{selected|sorcery}+@{selected|willpower}+@{selected|wounds})d6>5| Survie,(@{selected|survival}+@{selected|logic}+@{selected|wounds})d6>5| Technomancie,(@{selected|tasking}+@{selected|logic}+@{selected|wounds})d6>5} The NPC sheet works perfectly with this macro but i need to add attribute for the skill in the PC sheet but it's essentially for the players. Now i just need to understand how is possible to roll the dice again when the dice come with failure and with a special shadow amp you can roll the dice again and add new success to the previous result. Maybe you know how to do this ?
1625080858
GiGs
Pro
Sheet Author
API Scripter
What do you mean by this? with a special shadow amp you can roll the dice again and add new success to the previous result The ro<4 modifier can be used to reroll dice once if you get 1-4.That would look like d6>5ro<4 However, this is done for every individual die. So if you rolled 6 dice and got 1 success, it would reroll the 5 failed dice to see if any of them succeeded. If you want to reroll based on total number of initial successes, I don't think you can.
1625119728

Edited 1625120457
Hi, my point is to reroll only two misses for exemple but i can't with something like that {d6>5}ro2d6<4 but i'm not sure where to place bracket or parenthesis
1625137694
GiGs
Pro
Sheet Author
API Scripter
There's no way to do that without the API, a pro user subscription. The dice roll system available to free and pro users has some inbuilt limitations. The best you can do is sort the dice, so you can see if there are two dice to reroll and then manually reroll them. Something like d6>5sa
So sad ? Seriously no way to do that ? I don't know how work API, with html/css or is an other language ? (I need to learn html/css after). I'm a guy fill of hope and a little stubborn, i'm thinking to find a solution even if i need to rewrite hundred times the macro with maybe a other syntaxe for the basic formula.
1625150009
GiGs
Pro
Sheet Author
API Scripter
Unfortunately, yes - no way. One of the hardest things to accept is that there are some things you can not do , especially if it's just someone on a forum telling you that. But trust me, I know the roll20 limits. There is no way to the roll you want without the API. If you want to use the API, you need a pro subscription. It uses javascript, and can be very tricky to write custom scripts. But there are a lot of scripts already written - many of which have their own syntax to learn. There's a script called ScriptCards which will probably be able to do the roll you want.
Ok i trust you Gigs sadly but thank you for the advice ! Ok i need to learn html/css and javascript now, that does lot of work for my summer ah ah
1625156424
GiGs
Pro
Sheet Author
API Scripter
If you're planning on upgrading to Pro, and use Scriptcards, you don't need to learn any of them - just learn how to use that script. Most pro users who use scripts don't do any coding. They use scripts that other people have made.
1625236630

Edited 1625246353
Andreas J.
Forum Champion
Sheet Author
Translator
GiGs said: Most pro users who use scripts don't do any coding. They use scripts that other people have made. Well, some of the APIs like ScriptCards or MetaToolbox have so deep-going features & options, that if you start really delving into it, I'd basically consider it coding. Like, when the MetaToolbox was announced some months back, the thing looked so large & multifaceted that I was more inclined to start learning a new programming language, than to learn the syntax for a great Roll20 API.
1625241369
GiGs
Pro
Sheet Author
API Scripter
Andreas J. said: GiGs said: Most pro users who use scripts don't do any coding. They use scripts that other people have made. Well, some of the APIs like ScriptCards or MetaToolbox have so deep-going features & options, that if you start really delving into it, I'd basically consider it coding. Like, when the MetaToolbox was announced some months back, the thing looked so large & multifaceted that I was more inclined to start learning a new programming language than to learn the syntax for a great Roll20 API. It's true there are very complex scripts, but for the most part for those you can just post, "I want to do this, help" and people will tell you how to do it. Having to build a script from scratch yourself, even if you ask for help, will not be anywhere near as straightforward and will involve getting to grips with coding.
GiGs said: Unfortunately, yes - no way. One of the hardest things to accept is that there are some things you can not do , especially if it's just someone on a forum telling you that. But trust me, I know the roll20 limits. There is no way to the roll you want without the API. If you want to use the API, you need a pro subscription. It uses javascript, and can be very tricky to write custom scripts. But there are a lot of scripts already written - many of which have their own syntax to learn. There's a script called ScriptCards which will probably be able to do the roll you want. Hello, with one of my players we are thinking of simulating the re-roll of 2d6 on a first roll of 8d6 by comparing the number of successes and that if all the dice are not successes, to be able to add +2d6 to the roll, do you think it can work or is it still impossible to do?
1625314676
GiGs
Pro
Sheet Author
API Scripter
You cant do any conditional things with macros. If what you're trying to do contains an IF you cant do it. So, "if all the dice are not successes" cannot be done. What you can do is display the first total, and always roll the second and display it, and manually add them together when needed. So you could do something like @{selected|token_name} /roll ?{Jet de Compétences| Acrobatie,(@{selected|escape_artist}+@{selected|agility}+@{selected|wounds})d6&gt;5| Armes à feu,(@{selected|firearms}+@{selected|agility}+@{selected|wounds})d6&gt;5| Armes lourdes,(@{selected|heavy_weapons}+@{selected|agility}+@{selected|wounds})d6&gt;5| Armes à projectiles,(@{selected|projectile_weapons}+@{selected|agility}+@{selected|wounds})d6&gt;5| Armes de véhicules,(@{selected|vehicle_weapons}+@{selected|agility}+@{selected|wounds})d6&gt;5| Athlétisme,(@{selected|athletics}+@{selected|agility}+@{selected|wounds})d6&gt;5| Biotech,(@{selected|biotech}+@{selected|logic}+@{selected|wounds})d6&gt;5| Combat astral,(@{selected|astral_combat}+@{selected|willpower}+@{selected|wounds})d6&gt;5| Comédie,(@{selected|con}+@{selected|charisma}+@{selected|wounds})d6&gt;5| Conjuration,(@{selected|conjuring}+@{selected|willpower}+@{selected|wounds})d6&gt;5| Corps à corps,(@{selected|close_combat}+@{selected|agility}+@{selected|wounds})d6&gt;5| Electronique,(@{selected|electronics}+@{selected|logic}+@{selected|wounds})d6&gt;5| Etiquette,(@{selected|disguise}+@{selected|charisma}+@{selected|wounds})d6&gt;5| Furtivité,(@{selected|stealth}+@{selected|agility}+@{selected|wounds})d6&gt;5| Hacking,(@{selected|hacking}+@{selected|logic}+@{selected|wounds})d6&gt;5| Ingénierie,(@{selected|engineering}+@{selected|logic}+@{selected|wounds})d6&gt;5| Intimidation,(@{selected|intimidation}+@{selected|charisma}+@{selected|wounds})d6&gt;5| Négociation,(@{selected|negotiation}+@{selected|charisma}+@{selected|wounds})d6&gt;5| Pilotage véhicules divers,(@{selected|piloting_other}+@{selected|agility}+@{selected|wounds})d6&gt;5| Pilotage véhicules terrestres,(@{selected|piloting_ground}+@{selected|agility}+@{selected|wounds})d6&gt;5| Pistage,(@{selected|firearms}+@{selected|tracking}+@{selected|wounds})d6&gt;5| Sorcellerie,(@{selected|sorcery}+@{selected|willpower}+@{selected|wounds})d6&gt;5| Survie,(@{selected|survival}+@{selected|logic}+@{selected|wounds})d6&gt;5| Technomancie,(@{selected|tasking}+@{selected|logic}+@{selected|wounds})d6&gt;5} **REROLL If Needed** /roll 2d6&gt;5 ============================== Or if you wanted to get fancy and conserve chat space, something like &amp;{template:default} {{name=@{selected|token_name}}} {{roll=[[(?{Jet de Compétences | Acrobatie,@{selected|escape_artist}+@{selected|agility}| Armes à feu,@{selected|firearms}+@{selected|agility}| Armes lourdes,@{selected|heavy_weapons}+@{selected|agility}| Armes à projectiles,@{selected|projectile_weapons}+@{selected|agility}| Armes de véhicules,@{selected|vehicle_weapons}+@{selected|agility}| Athlétisme,@{selected|athletics}+@{selected|agility}| Biotech,@{selected|biotech}+@{selected|logic}| Combat astral,@{selected|astral_combat}+@{selected|willpower}| Comédie,@{selected|con}+@{selected|charisma}| Conjuration,@{selected|conjuring}+@{selected|willpower}| Corps à corps,@{selected|close_combat}+@{selected|strength}| Electronique,@{selected|electronics}+@{selected|logic}| Etiquette,@{selected|disguise}+@{selected|charisma}| Furtivité,@{selected|stealth}+@{selected|agility}| Hacking,@{selected|hacking}+@{selected|logic}| Ingénierie,@{selected|engineering}+@{selected|logic}| Intimidation,@{selected|intimidation}+@{selected|charisma}| Négociation,@{selected|negotiation}+@{selected|charisma}| Pilotage véhicules divers,@{selected|piloting_other}+@{selected|agility}| Pilotage véhicules terrestres,@{selected|piloting_ground}+@{selected|agility}| Pistage,@{selected|tracking}+@{selected|agility}| Sorcellerie,@{selected|sorcery}+@{selected|willpower}| Survie,@{selected|survival}+@{selected|logic}| Technomancie,@{selected|tasking}+@{selected|logic}&amp;#125;)d6&gt;5]] }} {{reroll=[[2d6&gt;5]]}} You can see the problem with rolls getting more complicated with that &amp;#125; on the last line. When you nest rolltemplated like this inside a query, you have to start using HTML entities to make it work, as described here: <a href="https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries</a>
1625394078

Edited 1625394711
I understand, and thank you that's better than nothing. I think we can pay attention when on a roll of 4d6 we have 5 -5 - 6 - 4 for exemple . In this particular case, macro reroll 2 dices, juste one or zero ? PS : I'm not familiar for the moment with CSS/HTML and i search to call stuff like Defense or Perception in my macros but i dont know how to do this or what attribute to call on the character sheet : <a href="https://github.com/Roll20/roll20-character-sheets/tree/master/Shadowrun-Anarchy" rel="nofollow">https://github.com/Roll20/roll20-character-sheets/tree/master/Shadowrun-Anarchy</a> Do you have an idea ? Anyway you're sol helpful for me and for this : a big thank you to you !
1625403940
GiGs
Pro
Sheet Author
API Scripter
If you change the d6&gt;5 to d6sa&gt;5 It'll sort the dice in order, which makes it easier to see successes and fails. Are you sure that's the sheet you're using? There's another shadowrun anarchy sheet: <a href="https://github.com/Roll20/roll20-character-sheets/tree/master/ShadowrunAnarchy" rel="nofollow">https://github.com/Roll20/roll20-character-sheets/tree/master/ShadowrunAnarchy</a> That's the one I thought you were using when I posted about fixing the roll buttons earlier. I don't see defense and perception defined as attributes in there. There are roll buttons, which you can trigger with %{selected|defense} or&nbsp; %{selected|perception} - there's a button for every skill, too, I think.
Hi i think the second link is the right link but didn't worked with&nbsp; %{selected|defense} but not problem because i find a other way to do this with @{agility}+@{logic}. But now i'm wondering how put the name of the skill when i roll dices with the macro ?&nbsp;
1625664861

Edited 1625665008
GiGs
Pro
Sheet Author
API Scripter
M.JOHNSON said: Hi i think the second link is the right link but didn't worked with&nbsp; %{selected|defense} but not problem because i find a other way to do this with @{agility}+@{logic}. If you are creating abilities, you dont need selected| so you can just use %{defense} But now i'm wondering how put the name of the skill when i roll dices with the macro ? So, the trick is you can include multiple lines of text in each row of a query dropdown. You can do this: ?{multi-line query example| single line,This outputs a single line| two lines,This outputs two lines like this| three lines,You can go further this outputs three lines like this} Copy that and try it in a campaign. The key thing to understand is that you aren't limited to a single stat or word in a query. You can do this: @{selected|token_name} rolls ?{Jet de Compétences| Acrobatie,**Acrobatie** /roll (@{selected|escape_artist}+@{selected|agility}+@{selected|wounds})d6&gt;5| Armes à feu,**Armes à feu** /roll (@{selected|firearms}+@{selected|agility}+@{selected|wounds})d6&gt;5| Armes lourdes,**Armes lourdes** /roll (@{selected|heavy_weapons}+@{selected|agility}+@{selected|wounds})d6&gt;5| Armes à projectiles,(@{selected|projectile_weapons}+@{selected|agility}+@{selected|wounds})d6&gt;5| Armes de véhicules,(@{selected|vehicle_weapons}+@{selected|agility}+@{selected|wounds})d6&gt;5| Athlétisme,(@{selected|athletics}+@{selected|agility}+@{selected|wounds})d6&gt;5| Biotech,(@{selected|biotech}+@{selected|logic}+@{selected|wounds})d6&gt;5| Combat astral,(@{selected|astral_combat}+@{selected|willpower}+@{selected|wounds})d6&gt;5| Comédie,(@{selected|con}+@{selected|charisma}+@{selected|wounds})d6&gt;5| Conjuration,(@{selected|conjuring}+@{selected|willpower}+@{selected|wounds})d6&gt;5| Corps à corps,(@{selected|close_combat}+@{selected|agility}+@{selected|wounds})d6&gt;5| Electronique,(@{selected|electronics}+@{selected|logic}+@{selected|wounds})d6&gt;5| Etiquette,(@{selected|disguise}+@{selected|charisma}+@{selected|wounds})d6&gt;5| Furtivité,(@{selected|stealth}+@{selected|agility}+@{selected|wounds})d6&gt;5| Hacking,(@{selected|hacking}+@{selected|logic}+@{selected|wounds})d6&gt;5| Ingénierie,(@{selected|engineering}+@{selected|logic}+@{selected|wounds})d6&gt;5| Intimidation,(@{selected|intimidation}+@{selected|charisma}+@{selected|wounds})d6&gt;5| Négociation,(@{selected|negotiation}+@{selected|charisma}+@{selected|wounds})d6&gt;5| Pilotage véhicules divers,(@{selected|piloting_other}+@{selected|agility}+@{selected|wounds})d6&gt;5| Pilotage véhicules terrestres,(@{selected|piloting_ground}+@{selected|agility}+@{selected|wounds})d6&gt;5| Pistage,(@{selected|firearms}+@{selected|tracking}+@{selected|wounds})d6&gt;5| Sorcellerie,(@{selected|sorcery}+@{selected|willpower}+@{selected|wounds})d6&gt;5| Survie,(@{selected|survival}+@{selected|logic}+@{selected|wounds})d6&gt;5| Technomancie,(@{selected|tasking}+@{selected|logic}+@{selected|wounds})d6&gt;5} **REROLL If Needed** /roll 2d6&gt;5 ============================== In the above macro, I've altered the first 3 lines you can see the skill name on output, and its bold. Basically, a row ends when a | is found (as long as it's not inside an attribute call, like @{selectedZdefense} - the | there is ignored). And a query (the ?{something} does not have to be on a separate line. It can be part of text, as I've done here. If you want to do it with the rolltemplate approach, it;s a lot trickier, the only way to do that requires nested queries and HTML entity substitution. The problem is described here: <a href="https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries</a> , so I wont go into detail on that here unless you need it.
1625730768

Edited 1625732597
Ok thank you, i've tried to put skill name in the chatbox with your second exemple ("Or if you wanted to get fancy and conserve chat space, something like").&nbsp;&nbsp;I spent an hour on this with not result. In my opinion, i'm confused between the use of [ and (.&nbsp; In wich case you use one or either ? And in wich case we use simple [ and ( or [[ or ((. And how i can insert skill name in your second macro T.T and maybe how player can add modifier too.&nbsp;