Old code does not work with new format of research results.
So we need discuss how research code should work.
I'm still believe better is use functions than store all logic in json-objects.
Per's variant
Code: Select all
"results": [
{
"Damage": 25,
"weaponSubClass": "MACHINE GUN"
}
],
Stored array of results, to be able to store multiple results.
Stored name of function.
Parameters of function stored as fields "weaponSubClass", "modifier"
Code: Select all
"results": [
{
[
"function": "UpgradeWeaponDamage",
"weaponSubClass": "MACHINE GUN"
"modifier": 25,
],
}
],
Stored array of results, to be able to store multiplie results.
Stored name of function.
Stored each field which we want to change
Code: Select all
"results": [
{
[
"function": "UpgradeWeapon",
"weaponSubClass": "MACHINE GUN",
upgrade_fields:
{
damage: 25,
radisuDamage: 25,
periodicallDamage: 25,
},
],
}
],
Stored array of results, to be able to store multiplie results.
Stored name of upgraded component type.
Stored each field which we want to change.
Stored list of filters.
Code: Select all
"results": [
{
[
component_type: "Weapons",
filters:
{
"weaponSubClass": "MACHINE GUN",
designable: 1,
},
upgrade_fields
{
damage: 25,
radisuDamage: 25,
periodicallDamage: 25,
},
],
}
],
Code: Select all
filters:
{
weaponSubClass: "== 'MACHINE GUN'",
designable: "== 1",
},
],
I prever variant 2
I'm afraid my ideas is not clear. Please ask if something not clear in my examples above.
Again.
We need a flexible and accurate form of results of research.
I suggest to use research frunctions (js). Because it makes less problems but in this case you need to open research.js to be able to read details of "what was upgraded actually"