Dr Lancer-X, on 25 February 2024 - 12:11 AM, said:
[
] for example, use code to follow the bullet's path, make sure it's still there. If the bullet disappears and the player is in the right location to be hit by it and the player's health is reduced in that same cycle, chances are very good your bullet hurt the player - but nothing is certain.
Basically this. Or, alternately, have the Robot "pay attention" for a few cycles to see what happens to the bullet. I recently made a "short-ranged bullet" engine for my game where a 'bot makes its won bullets disappear in 20 cycles through the use of "copy block". I'm sure the problems are apparent just from that statement alone, but it works for my purposes.
Anyway, if you don't have multiple 'bots on the same axes of the player, you could combine an "if "HORIZPLD"" or "if "VERTPLD"" statement with ":playerhit" or something. It's more prone to trigger false positives if there are multiple sources of damage on the same board, but it would probably be the simplest solution for what's needed. Maybe.
Quote
Another alternative is that you could simulate a bullet, using a sprite or overlay to draw it, and just reproduce in robotic all the usual bullet handling (what happens when it hits various creatures etc.), except for a special case when hitting the player. However other code potentially on the board, such as code checking for the presence of a bullet in a given location, or if any bullet etc. will not work.
That sounds absolutely headache-inducing. As someone who recently put code
into a Robot which, when activated, turned
it into a "fake bullet" (related to my "short-ranged bullets" thing above), I can imagine what a
pain creating an "overlay bullet" script would be. I don't even know how hit detection would work with that. I could probably figure it out and code something, but man, it just sounds daunting right now.
(Then again, I'm staying in the "bronze age" of v2.5x, so
)