Migration for vehicle parts that are installed in vehicles #37635
Labels
[C++]
Changes (can be) made in C++. Previously named `Code`
<Enhancement / Feature>
New features, or enhancements on existing
stale
Closed for lack of activity, but still valid.
Is your feature request related to a problem? Please describe.
In my attempts to modernise blazemod code, I initially thought that I would be able to make it save-game compatible, albeit with some extensive migration and obsoletion code. However, while items and recipes seem to be able to be redacted without too much issue, and even vehicleparts as items, vehicle parts as they exist as part of an existing vehicle in the save resist transition.
Describe the solution you'd like
If at all possible, a json form to migrate vehicle parts existent on vehicles over to another part or even the ability to have removed would be excellent for keeping saves backwards compatible when a vehicle part becomes superseded or unnecessary in its current form.
Describe alternatives you've considered
Requiring a save-compatibility break every time a vehicle part is removed or noticeably changed in the code, as it stands.
Additional context
Testing: Start a new world, mechanics 3 skill. Save game and quit, add
"blazemod"
entry tomods.json
in the save, start up game, spawn a humvee vehicle and a TDI gun, remove the M240 from the turret and install the TDI as a blazemod turret. Save game, quit. Remove"blazemod"
frommods.json
, attempt to load the save, receive a seg fault which has this error in the debuglog:ERROR : src/veh_type.cpp:589 [static void vpart_info::check()] vehicle part turretframe uses undefined item turretframe
Same error occurs with or without migration code line:
I'm not sure if being able to separately migrate items and vehicleparts would help, though in this case the turretframe item and the turretframe vehiclepart share the same id.
The text was updated successfully, but these errors were encountered: