-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add environmental damage types for each kill type #1663
Add environmental damage types for each kill type #1663
Conversation
Draft PR because I'm not sure if I like the naming of the variables and I want to sleep on it. I welcome any comments or feedback, now or later. |
Looks good! Seems to be missing some reasons for death:
|
(if you'd rather see full code, this is more or less what I'm working with: BAR105...keelefi:spring:kill-unit-add-damage-types)
I'm planning to use
Thanks a lot, this I really don't understand what this is and how it happens. What should it be named?
Thanks, I did not know this. I'll change it to
Good point, thanks a lot. Btw I'm still lacking damage types for Line 959 in 2ef0794
spring/rts/Sim/Units/UnitHandler.cpp Line 279 in 2ef0794
|
9c7cefe
to
2391d5b
Compare
I think using a separate constant is good for two reasons:
I'd go with a specific "out of bounds" value with similar reasoning as above. For example maybe going out of bounds is more of an error case than just being killed in one of the other ways so the game may want to do something about it (idk, produce logs and send an error report?) and it's nice to be able to distinguish that this specifically happened.
It happens when the unit is set to turn itself into a feature on completion via the
A unit dies this way when health is directly set to less than 0 without any damage involved. Perhaps call it
Currently this is reachable only from Lua, so will pass along whatever weaponID Lua code decided the unit was killed by. It doesn't need its own value. |
2391d5b
to
64918de
Compare
Thank you greatly for all the very thorough explanations! I basically implemented all of your suggestions with the only exception that deaths from unit scripts are |
How these are thought to be used can be seen here: d1df939 |
One more minor thing (shouldn't cause conflicts in follow-up patches): keelefi#2 |
Prime candidates for Lua replacement.
Done. |
Looks to be included in aed398d#diff-85b82291d073a0f5bf8b0a4d29693156937cb4359544e2816acc61f3980a21e9R283 ? |
Yes, #1669 is based on this and wasn't really ready. I'll fix it up later. |
Yes. |
Closes #1638