Hi mates,
I am currently working on a mod, which just adds a few new ships into the game.(I personally call it a ship pack)
I want to make each ship different, if not unique, by having there own build-in weapons and hullmods.
Now I am facing a problem and come here to seek for help, as my coding ability is really poor.
All I want to do is to create a hullmod which,
when the hull(not the shield) is hit and damaged, the ship gains flux equal to the damage it received. The effect is quite simple, but however, I find it really hard to do because I don't know how to get the value of damage the ship is taken, and when it is taken.
Anyone has an idea for this? I'm not expecting anyone can provide me the codes for it(of course it will be a great help if one can do that), but just seek for some idea of how to get the value of damage taken by a ship.
Any discuss and help regarding for this topic is much appreciated.
UPDATE:
Spoiler
Well, actually I have achieved my object, but it's in a different way, without knowing how to get damage value.
What I did is to store the current HP of a ship for each frame. and then I can get the difference in HP between two frame, which is supposed to be the damage. This is not accurate(for example, when you have lv.10 damage control and is recovering hull, your "damage" is actually lower than it should be as some of them is recovered.), but at least it works, well, roughly.
If anyone can come up with a better idea, I would like to try it.