Negative damage

Negative damage

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Negative damage

Post by Caydr »

I've tried setting a weapon's default damage to a negative value, it doesn't seem to work. Can this be fixed? I can think of quite a few uses. If you can do it, just be sure to make sure the "damage" caused can't exceed a unit's health.

Thanks
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

I want true zero damage weapons. :P

Anyway, both don't work for the very same reason: if (Anything <= 0) max(Anything, 1). Should be fairly easy to patch this in.

Hmm... I can imagine what happens when you heal a unit beyond max health, though.
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Post by Neddie »

Crash, no stack trace?
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

9001/9000.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

IIRC TA allowed negative damage and yes, it could exceed the max HP.
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

Just run something that says it can't go above max armor.. Like repairing.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Well yes, but this has to be added to about every unit type or weapon type and that makes it tedious.
j5mello
Posts: 1189
Joined: 26 Aug 2005, 05:40

Post by j5mello »

not to mention wouldn't you have to change the targeting/aiming code to allow you to fire at ur own units????
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Post by Caydr »

j5mello wrote:not to mention wouldn't you have to change the targeting/aiming code to allow you to fire at ur own units????
Depends on the implementation. Suppose you made a nuke launcher which fires a "nano bomb". Fire it at an area, it repairs everything. Nukes and certain other units aren't subject to the "no firing at friendlies" rule.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Post by jK »

lua?
User avatar
Peet
Malcontent
Posts: 4384
Joined: 27 Feb 2006, 22:04

Post by Peet »

Lurker's patch will make this work btw
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Post by Caydr »

Details?
User avatar
quantum
Posts: 590
Joined: 19 Sep 2006, 22:48

Post by quantum »

You can use the UnitDamaged call-in, then apply an arbitrary damage with the SetUnitHealth call out. The unit_dir_dmg gadget in CA does something like that to achieve armor zones. You can see it, without having to download CA, here.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Quantum, how did you guys get accurate values for the hit direction?
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Post by lurker »

;_;
The reason my patch isn't in yet is that armorzones hate me.
They are getting removed.
I will have my patch done in a couple of days.
It has negative damage that can't exceed max HP.

The current spring limits damage to a unit to always be positive. I remove that, put in checks for max health, and make experience work properly, specifically by giving it a multiplier to give units .1 * what the experience would be for doing that much damage (note that paralysis weapons get 0.1x experience, so I copied that)
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Post by Caydr »

Awesome, please post details on usage (if applicable) when it's in. Much appreciated. This is going to be a really neat feature.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Post by lurker »

Caydr wrote:Awesome, please post details on usage (if applicable) when it's in. Much appreciated. This is going to be a really neat feature.
Nah, nothing needed. You can already set base damage to be negative, btw, and it will charge shields and such. But it's in the final subtraction of damage from hp that it's limited right now, so it should work exactly as expected with my patch.
User avatar
quantum
Posts: 590
Joined: 19 Sep 2006, 22:48

Post by quantum »

KDR_11k wrote:Quantum, how did you guys get accurate values for the hit direction?
We didn't. The script just uses the attacker direction. It's confined to our sandbox because of that, and we don't plan to use it. Besides, lurker's patch will make that piece of code worthless :-)
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Post by REVENGE »

Can launchers stockpile more than one weapon type? Or are there any plans to make this happen?

If so, we could make Juno even more useful by giving it an area repair weapon...
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Post by Caydr »

Was this patch ever added? I just tested negative damage values and they don't seem to work.
Post Reply

Return to “Feature Requests”