Page 1 of 1
Negative damage
Posted: 02 Jul 2007, 19:01
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
Posted: 02 Jul 2007, 21:31
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.
Posted: 02 Jul 2007, 22:35
by Neddie
Crash, no stack trace?
Posted: 03 Jul 2007, 16:41
by rattle
9001/9000.
Posted: 03 Jul 2007, 17:29
by KDR_11k
IIRC TA allowed negative damage and yes, it could exceed the max HP.
Posted: 03 Jul 2007, 18:05
by Snipawolf
Just run something that says it can't go above max armor.. Like repairing.
Posted: 03 Jul 2007, 23:20
by rattle
Well yes, but this has to be added to about every unit type or weapon type and that makes it tedious.
Posted: 04 Jul 2007, 00:49
by j5mello
not to mention wouldn't you have to change the targeting/aiming code to allow you to fire at ur own units????
Posted: 17 Jul 2007, 22:25
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.
Posted: 17 Jul 2007, 22:32
by jK
lua?
Posted: 17 Jul 2007, 23:31
by Peet
Lurker's patch will make this work btw
Posted: 07 Sep 2007, 03:38
by Caydr
Details?
Posted: 07 Sep 2007, 12:13
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.
Posted: 07 Sep 2007, 14:57
by KDR_11k
Quantum, how did you guys get accurate values for the hit direction?
Posted: 07 Sep 2007, 19:13
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)
Posted: 07 Sep 2007, 19:32
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.
Posted: 07 Sep 2007, 19:42
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.
Posted: 07 Sep 2007, 20:53
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

Posted: 09 Sep 2007, 05:01
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...
Posted: 19 Oct 2007, 18:24
by Caydr
Was this patch ever added? I just tested negative damage values and they don't seem to work.