I’ve had some ideas for EMP weapons, but I’ve run into some barriers.
1) How do I edit the disabled ship time from say, 20 seconds to 4 seconds?
2) Can a ship have a disabled time of 0 seconds?
3) How can I edit what is or isn’t affected by the EMP in terms of ship stats/abilities/etc?
4) Does the EMP Shield regenerate during combat with or without delay, and how can I edit this?
5) Is there a way to edit a ship such that is is invulnerable until the ship is ‘disabled’?
6) Is there a way to have EMP damage linked to the energy bar of another ability such as the defense field?
My plans, or hopes at least, are to add a shielding system that can recharge during combat with ship armor only taking damage once the EMP shield is eliminated. The other idea I had involved use of an invisible EMP weapon coupled with any other weapon that can penetrate defense shields, while making normal weapons incapable of piercing through the shield. If the ship can translate EM damage to the defense field energy reserves, then a shield system will be in place.
Any thoughts or help? I haven’t found a good tutorial on the EMP system yet.
Also, it appears that the recharge time of the bar once disabled is fixed and the EMP damage overshoots. so if you take 100 emp damage and you have 20, it will have to repair from -80 before becoming active again, sustained EMP bombardment will continue to push the value more negative greatly increasing the disabled time.
Could there perhaps be a way to to make a custom lua for a ship in which all damage received would be dumped on a subsystem first before the actual ships armor?
Create data:scripts/lib/subsystem_shield.lua with the following contents:
SHIP_HEALTH = 170000 -- hgn_battlecruiser health
HP_HEALTH = 20000 -- Hiigaran Carrier/Battlecruiser module health
function Update_ShieldedShip(CustomGroup, playerIndex, shipID)
local ship_health_pct = SobGroup_HealthPercentage(CustomGroup)
local hp_health_pct = SobGroup_GetHardPointHealth(CustomGroup, "HardpointArmor")
if (hp_health_pct <= 0) then
return
end
local ship_damage = (1 - ship_health_pct) * SHIP_HEALTH
local hp_health = hp_health_pct * HP_HEALTH
local new_hp_health = hp_health - ship_damage
local new_ship_health = SHIP_HEALTH
if (new_hp_health < 0) then
-- add, because new_hp_health is negative, effectively subtracting
new_ship_health = new_ship_health + new_hp_health
new_hp_health = 0
end
if (hp_health > 0 and ship_health < 1) then
SobGroup_SetHealth(CustomGroup, new_ship_health / SHIP_HEALTH)
SobGroup_SetHardPointHealth(CustomGroup, "HardpointArmor", new_hp_health / HP_HEALTH)
end
end
Note: “HardpointArmor” is an arbitrary hardpoint name I came up with. You’ll have to replace it with the name of a hardpoint that actually exists on the ship.
I’m gonna put this into play in a few moment. Thanks for that note at the end, that answered my first question.
As far as your third bullet point, that was actually my plan all along. Upgrades for both the shield module and the ship armor are desired, though I don’t know how to add to this to make it happen.
One question though, will each ship have to have their own individual lua such as this due to the different hardpoint labels?