Shields that go DOWN.

Shields that go DOWN.

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Shields that go DOWN.

Post by Argh »

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.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Like supcom?

Where shields use energy to recharge then stop at 100%, consumign a set amount fo energy and falling if the nergy isnt there, and the shield takes a battering till it reaches 0% where it falls and it starts charging again?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

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.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

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.
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Post by Neddie »

No, no, when a shield is under fire, it does not charge.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

like supcom?
User avatar
Zpock
Posts: 1218
Joined: 16 Sep 2004, 23:20

Post by Zpock »

It would be nice if this is simply controlled by the COB script. What we need is something like:

get/set shieldstate
get/set shieldstrength

And I guess the actual answer is: go LUA it!
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Yes this is perfectly possible in lua, have you not seen trepan meddling with shields in lua to make stealth shields?
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

This is more useful as set/get in COB to be honest.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Post by imbaczek »

With LuaCOB it doesn't matter where it is, as long as it's either in BOS or Lua.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Well, it's cleaner if certain things are done in certain ways. Like everything else got a get/set event while shields need LUA.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

It wasn't possible in lua, but it is now. I've added:

Code: Select all

local enabled, power = Spring.GetUnitShieldState(unitID)
-- and --
Spring.SetUnitShieldPower([enabled], [power])
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.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

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:

Code: Select all

#define SHIELD_POWER 95 // set or get
-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()).
User avatar
MR.D
Posts: 1527
Joined: 06 Aug 2005, 13:15

Post by MR.D »

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.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

Shields aren't controlled by activation though.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

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.
Post Reply

Return to “Feature Requests”