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

MgT Macro

1591567327

Edited 1591568360
Does anyone know how to set a macro for a skill specialty on the Mongoose Traveller 2e sheet? The Formula for a  base skill works with %{selected|"skillname"}, but the specialties are in a subtab of the skill.  Working example %{selected|pilot} Not working example %{selected|pilot_spacecraft}
1591573297
GiGs
Pro
Sheet Author
API Scripter
That is a repeating section. You'll need to access it by its repeating section, which will be %{selected|repeating_Pilotspec_$0_Pilotspec} The first row uses $0; the second row uses $1. Scanning the sheet, it looks like the rest of the specialties use the same name format.  repeating_SKILLNAMEspec_$0_SKILLNAMEspec Replace SKILLNAME with the relevant skill.
I just attempted that and it resulted in no ability found
For some reason, hovering over the name doesn't give the roll address. And recalling the roll text after using the sheet to roll just pulls the template info. &{template:skill-general} {{skill= Pilot }} {{spec= Spacecraft }} {{character= @{Tenebris Draconais|character_name} }} {{roll= [[(2d6 + [[3]] + ?{Modifier|0}[MOD])]] }} {{bb=[[(1d6)]]}} For the base Pilot skill I can use %{selected|pilot} and it will result in the correct roll, and recalling that text shows the same template format. &{template:skill-general} {{skill= Pilot }} {{character= @{Tenebris Draconais|character_name} }} {{roll= [[(2d6 + [[@{Tenebris Draconais|skilltotal-Pilot}]] + ?{Modifier|0}[MOD])]] }} {{bb=[[(1d6)]]}}
1591576428
Oosh
Sheet Author
API Scripter
I'm not familiar with the sheet, but maybe it's just an Attribute and not an Ability. Is there any Attribute listed as spacecraft or pilot_spacecraft or similar?
I have attempted to call it as a attribute and ability under every combination of pilot and spacecraft, as well as the previously suggested repeating pilotspec, but nothing as of yet has worked. I am assuming that it is an ability given % works to call the base pilot skill.
1591579901
GiGs
Pro
Sheet Author
API Scripter
I looked at the character sheet code, and this definitely should be the code for getting the button for the first row in the section: %{selected|repeating_Pilotspec_$0_Pilotspec} The problem is there's an error in the sheet code. It's used an uppercase letter here:  repeating_ P ilotspec . There's an obscure bug in roll20, that if you have any upper case letters in the repeating section name, then you cant call that button in macros.  To fix it, the repeating section name has to be all lower case. The sheet needs to be edited so that the button code is %{selected|repeating_ p ilotspec_$0_Pilotspec} (The second Pilotspec can be upper case.)
So I just change Spacecraft to spacecraft? Or are you talking about in the code itself?
1591580319
GiGs
Pro
Sheet Author
API Scripter
I've just submitted a fix for this, so it should go live early this week.
1591580360
GiGs
Pro
Sheet Author
API Scripter
Draconais said: So I just change Spacecraft to spacecraft? Or are you talking about in the code itself? You cant fix it. It's an error in the sheet and needs to be fixed at the source. I just submitted a fix for it.
Thanks
1591586755

Edited 1591586826
Oosh
Sheet Author
API Scripter
I have a workaround if it's any good to you while you wait: &{template:skill-general} {{skill= Pilot }} {{spec= @{repeating_Pilotspec_$0_skillSpeciality-Pilotspec} }} {{character= @{character_name} }} {{roll= [[(2d6 + [[@{repeating_Pilotspec_$0_skilltotal-Pilotspec}]] + ?{Modifier|0}[MOD])]] }} {{bb=[[(1d6)]]}} This is the code the sheet uses for the roll button with the repeating field reference thrown in - the bug GiGs is talking about doesn't stop you calling the Attributes. If you save this as an Ability macro called pilot_spacecraft on your character sheet you will be able to call it with the code in your very first post: %{selected|pilot_spacecraft} This can easily be modified for each use you need it for, example if you wanted the second specialty under Profession you would replace all instances of Pilotspec with Professionspec, and change all instances of $0 to $1. If you'd like to make it universal instead, it will just need @{selected| at the front of all the Attribute calls. Hope it helps! No idea how long a sheet fix takes!
1591588700
GiGs
Pro
Sheet Author
API Scripter
The fix usually goes up Tuesday or Wednesday, so not long to wait - but that's a good suggestion regardless.
I will wait until later in the week and see if the fix works. If not, I'll definitely use Oosh's workaround, thanks.
GiGs said: The fix usually goes up Tuesday or Wednesday, so not long to wait - but that's a good suggestion regardless. The fix worked, thanks.
1592024516
GiGs
Pro
Sheet Author
API Scripter
Great :)
Hopefully this allowed on this same thread, But I have another question regarding the MgT macros. For the attack/weapon section, it appears to be another repeating section, but I cannot figure out the actual verbage. I have tried %{selected|repeating_attack_$0_attack} and %{selected|repeating_weapon_$0_weapon} as well as %{selected|attack}, %{selected|attack1}, %{selected|weapon}, %{selected|weapon1} all to no result. Any suggestions?
1592170289
GiGs
Pro
Sheet Author
API Scripter
The easiest way to get the button name. Make sure your Macro Bar is switched on (Macros sidebar = check "Use Macro bar" or something like that). Then simply drag the button down to your macro bar, and it will have the name. It'll have a very long string of numbers and letters in place of the $0, but you can ignore that.
I figured it out. It was %{selected|weapon-1}
1592171425
GiGs
Pro
Sheet Author
API Scripter
great :)