KnightHawk75
Posts: 1450
Joined: 11/15/2018 Status: offline
|
So ScenEdit_SetUnitDamage() allows setting the unit's .damage.dp amount via the {...DP=X} parameter pos or negative change. The problem: When the DP value is parsed in, it's converted to an integer before later being converted to float when it's used to do the work, this removes (at times) critically needed precision from the user input. Request: Please change this to parse it as a float initially, or single or double or decimal, anything but int please. When does this come up: This is a problem when trying to repair something accurately, or when trying to do damage in small increments in many cases, where it can be kind of worked around involves way more code than it should. For example in the special cases where startdp < 2 indicating special handling and one is trying to say negate a current dp of 0.3012456789 (indicating 70% current damage), one can not do it accurately (one can work around it with lots of if-then-elses and some math to ensure it ends up above 1.0 and < 2, but it's a pita even though it seems to work, and you can never get it to 0.0 or 1.0 etc. BUT even the workarounds only works for restoring a unit fully. If one was trying to simulate a slow, very incremental repair one can not at the fidelity one may want. Take the non-special case of a hanger with 600dp.. it gets damaged, dp shows 501.12456 left. I want to decrease it by 1.1% (6.6dp) an hour till I hit the 600 max. Can't really do it 'nicely', I can creatively hack around the problem and get it to 601.x in full integer increments only though, and yes thankfully the underlying system allows it to work but in the cases of one where it's 'special' and non sensor based ie do tracked from 1.0 down to 0.0, I simply can't do incremental even in-artfully.
< Message edited by KnightHawk75 -- 6/20/2021 2:22:41 AM >
|