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

Updating A Character Sheet

1721335294

Edited 1721339652
I could not find a Battletech third edition sheet on roll20, but I did find someone that made a battletech sheet and I was trying to update it to third. However, my knowledge of HTML is a bit on the low side. The sheet was made with the Gunnery skill and I was trying to break it into Ballistic, Energy, and Missile. In the weapon entry section, each weapon has a drop down menu where you chose the type. <span class="sheet-weapons-label">Equipment Type</span><br> <select class="sheet-rw-select" type="number" name="attr_type"> <option value="0" >Other</option> <option value="@{warrior1_energy}">Energy</option> <option value="@{warrior1_ballistic}">Ballistic</option> <option value=@{warrior1_missile}"">Missile</option> </select> I'm betting I probably coded this section wrong. But, for the attack roll button, I'm not sure how to pull the actual skill over. The code for the attack is: <button type="roll" value="&{template:battletech} {{background=[[@{color}]] }}{{header=@{character_name} }} {{text-one=@{name} }} {{text-two=To Hit: [[ [[@{pilotgunnery}]] [Gunnery Skill] + [[?{Movement|Stationary,0|Walked,1|Ran,2|Jumped,3|VTOL,1}]] [Movement] + [[ @{heat_modifier} ]] [Heat] + [[?{Range|Short,0|Medium,2|Long,4|Extreme,8|Minimum,1|Minimum -1 Hex,2|Minimum -2 Hex,3|Minimum -3 Hex,4|Minimum -4 Hex,5|Minimum -5 Hex,6|Minimum -6 Hex,7}]] [Range] + [[?{Terrain Modifiers|None,0|+1,1|+2,2|+3,3|+4,4|+5,5+6,6|+7,7|+8,8|+9,9}]] [Terrain] + [[?{Target Movement|0-2 Hexes,0|3-4 Hexes,1|5-6 Hexes,2|7-9 Hexes,3|10-13 Hexes,4|14-18 Hexes,5|19-24 Hexes,6|25+ Hexes,7}]] [Target Movement] + ( [[?{Additional Modifiers|0}]] ) [Additional Modifiers] ]]+ }} {{rollname=Attack: }} {{roll=[[2d6]] }} {{Damage:= @{damage} }} {{Heat:= @{heatgenerated} }} {{footer=@{location} - @{name} }}" name="roll_attack" title="%{selected|repeating_weapons_$0_attack}" /> Fire Weapon</button> Can anyone help with this?
1721345620

Edited 1721345703
vÍnce
Pro
Sheet Author
So do you want to use @{type} in your roll? (assuming there are values for  warrior1_energy,  warrior1_ ballistic ,  warrior1_missile ) Maybe this [[@{pilotgunnery}]] [Gunnery Skill] should be [[@{type}]] [Skill] ? Also looks like there is a typo in your select on this line; <option value=@{warrior1_missile}"">Missile</option> should be <option value="@{warrior1_missile}">Missile</option> and in the macro; ( [[?{Additional Modifiers|0}]] ) [Additional Modifiers] ]]+ }} should probably be ( [[?{Additional Modifiers|0}]] ) [Additional Modifiers] ]]}}
Yeah, the pilotgunnery section needs to be changed to something. So what should it be with [[@{type}]] [Skill]? How do I identify the missile, ballistic, and energy as skills? The first typo is definitely a mistake, thanks. The macro worked fine. That was the original text. But I will test it again to see.
1721424761

Edited 1721424791
vÍnce
Pro
Sheet Author
I'm not familiar with the system, so you will have to explain how the attack works (ie what should be included).  Should "type" be added to pilotgunnery?  Are you also wanting to see what "type" is active? as-in include some text stating the current selected type?
each weapon entry on the sheet has a type section and an attack button. I want the button to detect what type is set for that weapon. I would give you a link to the original sheet, but it looks like I forgot to bookmark it.
1721431517

Edited 1721431637
vÍnce
Pro
Sheet Author
Having an example of the original code as a comparison to your code above may help.  I want the button to detect what type is set for that weapon. How does the attack roll/button actually change depending on the type selected?  If the only thing that changes is type(it looks like it uses another attribute's value, but are these just a bonus or...?), then you should be able to simply include that in your attack macro and as you change the @{type} selector on the sheet, the attack roll will change as well. If there is a completely different macro needed for each attack type selected, then you might need to either create unique rolls for each type (using css, these could be hidden by default and only display the button/roll that matches the attack type selector).  Another option is to use sheetworkers(javascript) that triggers off the type selected, which will auto-fill the appropriate macro for the attack button. 
Each weapon type has a different bonus to the attack roll. How do I change the @{type}? What is the actual code to use to replace [[@{pilotgunnery}]]?
1721443652
vÍnce
Pro
Sheet Author
I don't see why you couldn't just replace [[@{pilotgunnery}]] with [[@{type}]] in your attack macro.  Have you tried that yet?
I can try that, but how does the code know to pull that number from the weapon type?
I don't understand it, but it seems to work now.
1721488466
vÍnce
Pro
Sheet Author
You have a dropdown selector that has 4 options <select class="sheet-rw-select" type="number" name="attr_type"> <option value="0" >Other</option> <option value="@{warrior1_energy}">Energy</option> <option value="@{warrior1_ballistic}">Ballistic</option> <option value=@{warrior1_missile}"">Missile</option> </select> Anywhere you use @{type} will substitute a value of whichever option is currently selected.  Think of it as a conduit directly to the selected attribute. Without more code and/or explanation about the actual value of those options (ie their attribute values) it's difficult to know how they apply to the attack.  That said, it sounds like you've got it working.  Awesome.