Hits draining resources - Possible?
Moderator: Moderators
- Guessmyname
- Posts: 3301
- Joined: 28 Apr 2005, 21:07
Hits draining resources - Possible?
See title. One of the things I hope to attempt (as a gameplay mechanic) is that hits drain res. So if you hit an enemy, a bit of his resources are drained (note: Not given to you, just drained from his supplies). I was wondering if there was a way to do this in the dev version, ie a MetalDrain tag (for example) or even better a script-based thing (SET/GET MetalUse or something) that I can use in the HitByWeapon() script (or any other script for that matter)
- Guessmyname
- Posts: 3301
- Joined: 28 Apr 2005, 21:07
Cadyr, how did the old shields work? Didn't they charge up at a set e/sec rate? Could you hack the max chage, charge rate etc so that all units had an invisible shield with like 0.00001 repulse factor but a high to-charge energy cost, but low max charge or something very hacky like this long runon sentance?
- Guessmyname
- Posts: 3301
- Joined: 28 Apr 2005, 21:07
-
- Posts: 854
- Joined: 28 Jan 2005, 18:15
If you give a unit a shield the size of its hitsphere + a few pixels, the shield will (in theory) get hit by whatever projectile, but the unit will still get hit by the weapons aoe (as long as its big enough). You'd then use a shield of the type that drains energy per hit and destroys the projectile. However: it could only work with energy; it would be up to you to make sure all weapons had a big enough aoe to work and hit the unit with max or near max damage; it would not work with beamlasers unless they fixed the not draining/using energy when they hit shields.
And a potential problem (why I said 'in theory'), I am unsure if shields suffer from the hit detection problems that units do, or perhaps different even more complicated one.
And a potential problem (why I said 'in theory'), I am unsure if shields suffer from the hit detection problems that units do, or perhaps different even more complicated one.
The hit detection isn't the problem, firing a beam laser at a shield that has ShieldEnergyUse set doesn't drain any energy.
Shield impacts happen at discrete locations so a projectile being fired into a shield that only slightly larger than its owner would hit the shield (drain energy) but the explosion would happen a pseudorandom distance behind the shield surface which means the full blast hits the unit.
Shield impacts happen at discrete locations so a projectile being fired into a shield that only slightly larger than its owner would hit the shield (drain energy) but the explosion would happen a pseudorandom distance behind the shield surface which means the full blast hits the unit.
- Guessmyname
- Posts: 3301
- Joined: 28 Apr 2005, 21:07
-
- Posts: 854
- Joined: 28 Jan 2005, 18:15
-
- Posts: 197
- Joined: 04 Nov 2004, 00:33