I've tried to change the html like you said : <h2>Arme de tir</h2>
<fieldset class="repeating_weapons">
<select name="attr_weaponname" >
<option value="aucune" selected>(Choisir)</option>
<option value="bolter" selected>Bolter</option>
<option value="bolter_lourd " selected>Bolter Lourd </option>
<option value="canon_grav" selected>Canon Grav</option>
<option value="canon_laser" selected>Canon Laser</option>
<option value="canon_plasma" selected>Canon Plasma</option>
<option value="carabine_laser" selected>Carabine Laser</option>
<option value="fusil_pompe" selected>Fusil à pompe</option>
<option value="fusil_pompe_automatique" selected>Fusil à pompe automatique</option>
<option value="fusil_grav" selected>Fusil Grav</option>
<option value="fusil_melta" selected>Fusil Melta</option>
<option value="fusil_plasma" selected>Fusil Plasma</option>
<option value="grenade_fragmentation" selected>Grenade à fragmentation</option>
<option value="grenade_flash" selected>Grenade Flash</option>
<option value="grenade_melta" selected>Grenade Melta</option>
<option value="Lance_flammes" selected>Lance-flammes</option>
<option value="lance_flammes_lourd" selected>Lance-flammes lourd</option>
<option value="lance_missile" selected>Lance-missile</option>
<option value="multi_melta" selected>Multi-Melta</option>
<option value="pistolet_bolter" selected>Pistolet Bolter</option>
<option value="pistolet_grav" selected>Pistolet Grav</option>
<option value="pistolet_laser" selected>Pistolet Laser</option>
<option value="pistolet_melta" selected>Pistolet Melta</option>
<option value="pistolet_plasma" selected>Pistolet Plasma</option>
<option value="pistolet_stubber" selected>Pistolet Stubber</option>
<option value="sniper_laser" selected>Sniper Laser</option>
<option value="stubber" selected>Stubber</option>
<option value="stubber_lourd" selected>Stubber Lourd</option>
<button type='roll' name='roll_wound_level' value='&{template:default} {{name=@{character_name} tir avec @{weaponname} }} {{Niveau de la blessure =[[ @{INJ} + ?{Marge de succès?|0} - @{target|combined_personal_defense} ]] }}'></button><span class='dee'></span>
</select>
<h5>INJ:</h5> <input name="attr_INJ" value="-" readonly />
<h5>Recharge:</h5> <input name="attr_Recharge" value="-" readonly />
<h5>Chargeur:</h5> <input type="hidden" name="attr_chargeurfull" value="" />
<button type='roll' name='roll_recharge' value='!ammo @{character_id} @{chargeurfull} [[-1*?{Recharge?|1d3|1d4|1d6|1d8|1d10}<1]]'></button><span class='dee'></span>
</fieldset>
<script type="text/worker">
const weapons = {
aucune: {repeating_weapons_INJ: "", repeating_weapons_Recharge: "", repeating_weapons_Chargeur: ""},
bolter: {repeating_weapons_INJ: 3, repeating_weapons_Recharge: "1D6", repeating_weapons_Chargeur: 4},
bolter_lourd : {repeating_weapons_INJ: 4, repeating_weapons_Recharge: "1D6", repeating_weapons_Chargeur: 3},
canon_grav: {repeating_weapons_INJ: 2, repeating_weapons_Recharge: "1D3", repeating_weapons_Chargeur: 2},
canon_laser: {repeating_weapons_INJ: 9, repeating_weapons_Recharge: "1D3", repeating_weapons_Chargeur: 2},
canon_plasma: {repeating_weapons_INJ: 6, repeating_weapons_Recharge: "1D3", repeating_weapons_Chargeur: 3},
carabine_laser: {repeating_weapons_INJ: 1, repeating_weapons_Recharge: "1D10", repeating_weapons_Chargeur: 5},
fusil_pompe: {repeating_weapons_INJ: 1, repeating_weapons_Recharge: "1D6", repeating_weapons_Chargeur: 5},
fusil_pompe_automatique: {repeating_weapons_INJ: 2, repeating_weapons_Recharge: "1D3", repeating_weapons_Chargeur: 4},
fusil_grav: {repeating_weapons_INJ: 1, repeating_weapons_Recharge: "1D4", repeating_weapons_Chargeur: 3},
fusil_melta: {repeating_weapons_INJ: 6, repeating_weapons_Recharge: "1D4", repeating_weapons_Chargeur: 3},
fusil_plasma: {repeating_weapons_INJ: 5, repeating_weapons_Recharge: "1D6", repeating_weapons_Chargeur: 4},
grenade_fragmentation: {repeating_weapons_INJ: 2, repeating_weapons_Recharge: "N/A", repeating_weapons_Chargeur: 1},
grenade_flash: {repeating_weapons_INJ: 0, repeating_weapons_Recharge: "N/A", repeating_weapons_Chargeur: 3},
grenade_melta: {repeating_weapons_INJ: 5, repeating_weapons_Recharge: "N/A", repeating_weapons_Chargeur: 1},
Lance_flammes: {repeating_weapons_INJ: 1, repeating_weapons_Recharge: "1D3", repeating_weapons_Chargeur: 3},
lance_flammes_lourd: {repeating_weapons_INJ: 2, repeating_weapons_Recharge: "1D4", repeating_weapons_Chargeur: 2},
lance_missile: {repeating_weapons_INJ: 8, repeating_weapons_Recharge: "N/A", repeating_weapons_Chargeur: 5},
multi_melta: {repeating_weapons_INJ: 10, repeating_weapons_Recharge: "1D4", repeating_weapons_Chargeur: 3},
pistolet_bolter: {repeating_weapons_INJ: 2, repeating_weapons_Recharge: "1D8", repeating_weapons_Chargeur: 5},
pistolet_grav: {repeating_weapons_INJ: 0, repeating_weapons_Recharge: "1D6", repeating_weapons_Chargeur: 4},
pistolet_laser: {repeating_weapons_INJ: 1, repeating_weapons_Recharge: "1D10", repeating_weapons_Chargeur: 5},
pistolet_melta: {repeating_weapons_INJ: 4, repeating_weapons_Recharge: "1D3", repeating_weapons_Chargeur: 4},
pistolet_plasma: {repeating_weapons_INJ: 4, repeating_weapons_Recharge: "1D6", repeating_weapons_Chargeur: 4},
pistolet_stubber: {repeating_weapons_INJ: 0, repeating_weapons_Recharge: "1D10", repeating_weapons_Chargeur: 5},
sniper_laser: {repeating_weapons_INJ: 3, repeating_weapons_Recharge: "1D4", repeating_weapons_Chargeur: 3},
stubber: {repeating_weapons_INJ: 1, repeating_weapons_Recharge: "1D8", repeating_weapons_Chargeur: 4},
stubber_lourd: {repeating_weapons_INJ: 2, repeating_weapons_Recharge: "1D8", repeating_weapons_Chargeur: 3},
};
on("change:repeating_weapons:weaponname sheet:opened", function () {
getAttrs(["repeating_weapons_weaponname"], function (values) {
const output = weapons[values.repeating_weapons_weaponname] || weapons['Aucune'];
setAttrs(output);
});
});
on("change:repeating_weapons:chargeur", function(eventInfo) {
setAttrs({
repeating_weapons_chargeurfull: eventInfo.sourceAttribute
});
});
I've also tried to change the information in canon_grav: {repeating_weapons_INJ: 2, repeating_weapons_Recharge: "1D3", repeating_weapons_Chargeur: 2}, to canon_grav: {repeating_weapons_INJ: 2, repeating_weapons_Recharge: "1D3", repeating_weapons_chargeurfull: 2}, but it didn't work. I know that the input is read though cause the chat windows give me this : (From Ammo): Attribute [2] was not found. Please verify that you have the right name.