Shields that go DOWN.
Moderator: Moderators
Shields that go DOWN.
Er, that's it- I'd like to have Shields with a timer feature. If the Shield is reduced to 0 or fewer hitpoints, it'd stay OFF until the timer resets. I've been wanting this just about forever- it'd make certain types of gameplay practical.
No, he means like Halo, the shield won't recharge for a set amount of time after a hit (or only after it's drained?). A problem is that Spring's shields never drain totally, they can't block anything that does more damage than they have energy left so a shield that can't block anything at its current charge will still have a power > 0.
So basically, when a shield reaches 0 itll turn off, and after so long itll turn back on again? Thats what they do in supcom.
In supcom
Shield has a little yellow charge.
When hit charge goes down, charge slowly goes back up.
When charge reaches zero, shield falls, and shield recharges.
When shield reaches 100 charge it goes back up and process repeats. The timer here controls how long it takes to get to 100 charge after it fails.
In supcom
Shield has a little yellow charge.
When hit charge goes down, charge slowly goes back up.
When charge reaches zero, shield falls, and shield recharges.
When shield reaches 100 charge it goes back up and process repeats. The timer here controls how long it takes to get to 100 charge after it fails.
It wasn't possible in lua, but it is now. I've added:
enabled is a boolean
power is a number
You can use nil for either with SetUnitShieldState() to avoid setting it.
If a unit has more than one shield, then the largest shield is used.
Code: Select all
local enabled, power = Spring.GetUnitShieldState(unitID)
-- and --
Spring.SetUnitShieldPower([enabled], [power])
power is a number
You can use nil for either with SetUnitShieldState() to avoid setting it.
If a unit has more than one shield, then the largest shield is used.
Forget that, I've left Spring.GetUnitShieldState() as it is,
but removed the enabled parameter from Spring.SetUnitShieldState().
I've also added the following COB constant:
-1 is returned if the unit has no shield, otherwise, the shield's
current power is returned in scaled format (shield->curPower * COBSCALE).
The same scaled format is used to set the shield's power.
COB already controls the shield state via the "AimPrimary + weaponNum"
COB call-in (which is run about once a second, SlowUpdate()).
but removed the enabled parameter from Spring.SetUnitShieldState().
I've also added the following COB constant:
Code: Select all
#define SHIELD_POWER 95 // set or get
current power is returned in scaled format (shield->curPower * COBSCALE).
The same scaled format is used to set the shield's power.
COB already controls the shield state via the "AimPrimary + weaponNum"
COB call-in (which is run about once a second, SlowUpdate()).
You guys are overlooking a unit that already has this feature that you might be able to pull code from and use for the shield.
LVL-2 Radar jammers in all the AA/BA/CA mods, are set to turn off when they take damage.
Maybe you can pull that code and modify it to get a little closer than starting from scratch.
LVL-2 Radar jammers in all the AA/BA/CA mods, are set to turn off when they take damage.
Maybe you can pull that code and modify it to get a little closer than starting from scratch.
Controlling them via the AimPrimary returning or not (like currently in 74b3) gives us more freedom. Like, having several shields that goes down for different reasons, and having an activation that does something else. For instance, it's what allowed me to have two different shields of two colours in KP 1.3 ONS, with only one showing at once.