Suppose a B17 calls up ammo, an ME109 and a Flak react to it, and there is a nearby B24 and FW190 that don't react (say the 190 already expended its reactions)
targetDRM = {} is a table of the unit that is actually being targeted by the reactive defense, correct? In other words, the unit that calls up ammo to start the reaction?
targetDRM[unitAliases.Flak.id]
Gives how the damage roll for flak attacking the B17 is modified. So, if the result is 3, then the flak is 1/3 as likely to do damage as default. The table can't vary this per 'victim' type (in this case the B17), but that functionality can be included if you want it.
areaReactDRM = {} is a table of the units that might be near the targeted unit (so "splash damage" where flak can damage a few B-17s for example when one calls up ammo. Correct?
areaReactDRM[unitAliases.Flak.id]
Gives how the damage roll against the ME109 is modified. (i.e. both the Flak and the ME109 are trying to attack the same B17, so the flak might hit the 109 by mistake) Clouds applies if the ME109 is in the clouds, not the B17.
areaBystanderDRM = {} is a table of friendly units that might be hit by friendly fire "splash damage"? Correct? I don't think we ever implemented this so I'd probably just leave this table blank.
areaBystanderDRM[unitAliases.Flak.id]
Gives how the damage roll against the B24 and FW190 is modified (these units are nearby, and so are at risk, but aren't in the direct line of fire). Clouds applies if the B24 or FW190 is in clouds. I didn't split this in such a way as to separate the effect for friendly bystanders and enemy bystanders, but that could be done if we really want to. The flak units do deal with this. I should have checked that we only have 3 flak units that do area damage, and so could handle these directly in a function without a table. Maybe you have a tech that increases accuracy agains the primary target, and as a consequence reduces the general risk to bystanders (or even other reacting units).
Then as I understand it you've provided me with a default standard:
Code:
dTM = {clouds = 1.5, cloudsTech1=nil, cloudsTech1Mod = 1, cloudsTech2=nil, cloudsTech2Mod=1, tech1=nil, tech1Mod=nil, tech2=nil, tech2Mod=1, enemyTech1=nil, enemyTech1Mod=1, enemyTech2=nil,enemyTech2Mod=1,counterToEnemyTech1=nil, counterToEnemyTech1Mod=1,counterToEnemyTech2 = nil, counterToEnemyTech2Mod=1,}
But, if I wanted to have, say, Lancasters take less damage in clouds then
directly underneath the above, I'd write:
lancasterTM = {clouds =
3, cloudsTech1=nil, cloudsTech1Mod = 1, cloudsTech2=nil, cloudsTech2Mod=1, tech1=nil, tech1Mod=nil, tech2=nil, tech2Mod=1, enemyTech1=nil, enemyTech1Mod=1, enemyTech2=nil,enemyTech2Mod=1,counterToEnemyTech1=nil, counterToEnemyTech1Mod=1,counterToEnemyTech2 = nil, counterToEnemyTech2Mod=1,}
And then in the lancaster line in the table, I'd change to:
No, these are tables for the unit dealing the damage. So Flak can be good or bad at attacking units in clouds, but Lancasters can't be good or bad at evading fire while in a cloud. If you want that kind of functionality, I can do it, but the way it is set up depends on the reactingUnit (the one 'attacking' the munition generating unit), not the 'victim' (the munition generating unit, or some other nearby unit).
If targetDRM[unitAliases.lancaster.id]={clouds = 3 ...}
That means the lancaster is bad at damaging units calling up munitions from a cloud.
If you want that, then, given lancasterTM that you defined, you would put
targetDRM[unitAliases.lancaster.id]=lancasterTM
Or, just change clouds = 3 in the table I provided for the lancaster. In that case, it would rely on defaults for other entries.
Changing dTM.something (or dARTM or dABTM) changes the value for all units where something=dTM.something. If
targetDRM[unitAliases.lancaster.id]={something =12, somethingElse=dTM.somethingElse}, then 12 is used instead of dTM.something for the lancaster, but the lancaster still uses the dTM entry for somethingElse.
And then in the lancaster line in the table, I'd change to:
targetDRM[unitAliases.Lancaster.id]={clouds =lancasterTM.clouds, cloudsTech1=dTM.cloudsTech1, cloudsTech1Mod =dTM.cloudsTech1Mod, cloudsTech2=dTM.cloudsTech2, cloudsTech2Mod=dTM.cloudsTech2Mod, tech1=dTM.tech1, tech1Mod=dTM.tech1Mod, tech2=dTM.tech2, tech2Mod=dTM.tech2Mod, enemyTech1=dTM.enemyTech1, enemyTech1Mod=dTM.enemyTech1Mod, enemyTech2=dTM.enemyTech2,enemyTech2Mod=dTM.enemyTech2Mod,counterToEnemyTech1=dTM.counterToEnemyTech1, counterToEnemyTech1Mod=dTM.counterToEnemyTech1Mod, counterToEnemyTech2Mod=dTM.counterToEnemyTech2Mod,}
This is correct. You can have clouds=lancasterTM.clouds, but there really wasn't much point to writing the entire lancasterTM table.
You might have nightBomberTM = {clouds=3,...}, and then for the lancaster set clouds=nightBomberTM.clouds, so the lancaster uses the night bomber default for some things, and the regular default for others.
I didn't provide too much functionality here. Basically, units become better or worse at shooting depending on whether the unit they're shooting is in the clouds or not, and on the availability of certain technology. If you want other functionality (like having some units become more 'invisible' than other units in clouds) or to check something other than technologies, please say so, and I'll make the change before you spend time doing the tables.
Also, if you want the tables pre filled in some way, let me know, since I might be able to do it quickly (as I mentioned before, I changed text editors to Vim, which can do some automation). Unfortunately, I'm not familiar enough with the WWII airplanes to know what are the diffrent kinds (especially on the German side), so I can't easily differentiate fighters/bombers/bomber destroyers from their name.