The Dink Network

The overlooked "base hit" sprite parameter

August 21st, 01:25 PM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
Oh, NOW YOU'VE DONE IT! 
I was looking through the engine recently when I noticed a sprite parameter called "base hit". I had long assumed that it was just another parameter pertaining to graphical sequences, similar to "base attack" and "base walk", however upon investigating its use more closely, this did not turn out to be the case at all.

As it turns out "base hit" is assignable to map sprites, and also is settable on all live sprites, including those created from scripts. In fact, there is a DinkC binding of sp_base_hit(sprite, value) which will assign it. Somehow, this binding, despite being present from the beginning, skipped being documented not just in BigTed's annotated reference, but also in dinkc.chm and also on the new web site.

You may assume at this point that "base hit", due to its lack of documentation, is completely and utterly useless, and to be fair, you would not be far off. It does have a use, however, but only for player sprite 1, in which setting base hit to 0 or below will make whichever equipped weapon inoperable. It has no use anywhere else, and setting the value on a map sprite won't do anything to it. The aforementioned binding does not allow for retrieval, however DinkLua does, in case you'd like to use it as an extra var for something, similar to gold.

The original intended purpose of base hit is difficult to discern, however the use for the player sprite may indicate it was supposed to be a physical complement to magic cost somehow, and that certain weapons might not work on certain sprites while attacking according to their base hit value.
August 22nd, 12:11 AM
goblins.gif
drone1400
Peasant He/Him Romania
C# nerd 
I remember looking into this back when I added extra fields for all the hidden sprite properties in WDED. Indeed it seemed you could write to it but not read from it, either way, WDED should allow you to set a value for it, even though DinkHD wouldn't be able to really do much with it (other than what you already mentioned).
I guess now with DinkLua in YeOldeDink it will be actually useful to be able to edit the value
August 22nd, 05:03 AM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
Oh, NOW YOU'VE DONE IT! 
It's also worth mentioning that the value for the player sprite gets saved in the save file, making it useful for persistent storage of an extra hidden stat etc as long as it never decrements too much. In terms of conventional purposes, it could be used for a superboss that inspires terror in the player, occasionally making them unable to attack.