Armor Plating

by VortiK

Adds armor plating equipment to increase vehicles hitpoints and improve their survivability. - Supports AAI Vehicles. - Supports Angel's Heavy Tank. - Has built in mod support.

Content
3 years ago
0.16 - 1.1
11.8K
Armor

g Incompatibility with Krastorio 2

4 years ago
(updated 4 years ago)

Hi VortiK,
I'm trying ur mod on Krastorio 2 and I look for make it compatible. Krastorio 2 apply grids on all vehicles (locomotives and wagons too) with many categories divisions, also add one new high tier tank vehicle.

Trying ur mod I see that don't work on the new tank and don't work on locomotives and wagons,
I have add "vtk-armor-plating" equipment category to resonable grids, the result is that ur script print:
entityid.." : Armor Plating bonus : "..bonus.." HP total."
But the bonus will be not applied, I don't understand why, also I found some strange things:

  • u have a list(table) of supported entities called "vehicles" in the control script, but seems to be never used
  • no one validation check before use LuaEntity table given by events (I suppose is because u use stdlib and maybe have some inner validation check but apperently seems that some code path can use LuaEntity without pass through stdlib)
  • a folder called "workbench" of 18MB that have no use (this make mod file size heavier of 30x! If is for showing the mod remove it from the mod folder and link a forum page)
4 years ago

Hello,

Thanks for your feedback !

To answer some of your points :
- Indeed the array at the begining of control.lua isn't used anymore in control.lua, I should clean it up :) It's used in data-updates.lua to add grid to explicitly supported mods.
- The check for valid entities is done by check if there is a corresponding bonus in a global array before doing its magic. I guess it could be optimized further but it seems to work okay so far as "car" entities taking damage is rather rare event in normal gameplay.
- About the workbench folder, this is a mistake, I'll remove it !

To add compatibility, you should simply add the mod's equipement grid category :

table.insert(data.raw["equipment-grid"][entity.equipment_grid].equipment_categories, "vtk-armor-plating")

The bonus is only printed and used to reduce incoming damage taken.

4 years ago

I have already simply add that. Ok I will trust that works. Thank u for ur time.

New response