Anyone tried this build-in Shield before?

For EMP there is a shield added in .ship files as follows:
addShield(NewShipType, “EMP”, 10000, 20)

But there’s also another shield type as follows:
addShield(NewShipType, “Bullet”, 10000, 20)

If you add this into .ship file, the ship seems to have a shield. You just can’t see the healthbar so you don’t konw how much energy it left, but it actually works because the ship starts to take damage until it has been attacked for a period of time.

Now I just need to make the shield healthbar show itself :thinking:.


Wow, that’s interesting. I assumed the shield was only valid with “EMP”…

That’s what I was thinking for years, until I took a look at HomeworldRM.exe

Are there other values, out just “EMP” and “bullet”?

Didn’t find others.

Is there any visible effect?
Does it only negate damage from “bullets”?

No visible effect, I think the EMP/Bullet here and Disable/DamageHealth in AddWeaponResult are homologous.


Have you tried changing the “healthbarstyle” property to see if a different value shows the bullet shield?

Were you able to find a way to display the shield value in the end out of interest?

It seem 0 just shrinks the health bar + 1 and 2 looks the same


very happy noises

Still need to work out a way to display the shields health - if that’s even possible. To work out if the shield goes down I’m just checking if the HP starts dropping. I tried checking if the ship’s HP goes above 1 - but it doesn’t :frowning:

function ssc_ShieldRule(tShip, tShipSOB)
  if (tShip.iShieldStatus == 1) then -- if shield is online
    if (SobGroup_HealthPercentage(tShipSOB) < tShip.fLastShieldHP) then -- shield going offline
      SobGroup_SetMadState(tShipSOB, "HyperspaceGateDeActivate") -- do shield offline animation
      tShip.iShieldStatus = 0
  else -- if shields are offline
    --handle this lol

  tShip.fLastShieldHP = SobGroup_HealthPercentage(tShipSOB)

The ship has

addShield(NewShipType, "Bullet", 50000, 20)

The weapon looks like (still need to set it up for different penetrations):

StartWeaponConfig(NewWeaponType, "AnimatedTurret", "InstantHit", "asgard_plasmabeam", "Special Attack", 0, 6000, 0, 1.5, 0, 0, 5, 1, 0, 3.4, 0, 0, 1, 1, 60, 60, 0, "Normal", 1, 0, 300)

AddWeaponResult(NewWeaponType, "Hit", "DamageHealth", "Target", 1000, 1000, "")

setAccuracy(NewWeaponType, 1)
setAngles(NewWeaponType, 0, -80, 80, -25, 85)
setPenetration(NewWeaponType, 0, 0,
  {LightArmour = 0},
  {MediumArmour = 0},
  {HeavyArmour = 1},
  {ShieldArmour = 0},
  {SubSystemArmour = 0},
  {Unarmoured = 0},
  {PlanetKillerArmour = 0}