I am running this code to dynamically give a specific missile weapon that does not reload, a 24 second reload cycle for 32 rounds:
for(WeaponAPI weapon : ship.getAllWeapons()) {
if(weapon.getType().compareTo(WeaponType.MISSILE) != 0) {
continue;
}
reloadData = BASE_VALUES.get(weapon.getId());
log.info("found missile " + weapon.getId());
if(reloadData != null) {
log.info("found *correct*! missile " + weapon.getId() + " | " + reloadData.ammopersec + " | " + reloadData.reloadSize);
weapon.getAmmoTracker().setAmmoPerSecond(reloadData.ammopersec);
weapon.getAmmoTracker().setReloadSize(reloadData.reloadSize);
log.info("check " + weapon.getId() + " | " + weapon.getAmmoTracker().getAmmoPerSecond() + " | " + weapon.getAmmoTracker().getReloadSize());
}
}
However, only the setReloadSize() command is working properly, as shown by the debug logs inserted in the code:
38215 [Thread-3] INFO data.scripts.hullmods.yrxp_engineering - found missile yrxp_aam_3
38215 [Thread-3] INFO data.scripts.hullmods.yrxp_engineering - found missile yrxp_aam_3
38215 [Thread-3] INFO data.scripts.hullmods.yrxp_engineering - found missile yrxp_sead_58
38215 [Thread-3] INFO data.scripts.hullmods.yrxp_engineering - found missile yrxp_PART_missile_frigate_b_srm_33
38215 [Thread-3] INFO data.scripts.hullmods.yrxp_engineering - found *correct*! missile yrxp_PART_missile_frigate_b_srm_33 | 1.3333334 | 32.0
38216 [Thread-3] INFO data.scripts.hullmods.yrxp_engineering - check yrxp_PART_missile_frigate_b_srm_33 | 0.0 | 32.0
Simulator testing also reveals that the missile weapon is still not reloading.