missle_source - v1.08 change?
Dink is buggier than I remember
As a reminder, &missle_source is a special global variable that holds the value of the last missile_brain to hit something.
However, it is only set one place in the code (when a missle checks to see if it hit something), and is never cleared.
I created a test to confirm my fears...
While a bomb is blowing up, I punch a rock with a standard missle_source check to disappear. The rock disappears, even though it isn't anywhere near the bomb, because it picks up the current missle source.
What would be the best way to fix this?
One idea is to make missle_source reflect the attacking sprite for every kind of attack, not just missiles.
Can anyone think of any possible side-effects that might result from that?

As a reminder, &missle_source is a special global variable that holds the value of the last missile_brain to hit something.
However, it is only set one place in the code (when a missle checks to see if it hit something), and is never cleared.
I created a test to confirm my fears...
While a bomb is blowing up, I punch a rock with a standard missle_source check to disappear. The rock disappears, even though it isn't anywhere near the bomb, because it picks up the current missle source.
What would be the best way to fix this?
One idea is to make missle_source reflect the attacking sprite for every kind of attack, not just missiles.
Can anyone think of any possible side-effects that might result from that?
Can't think of any. Execpt if someone was counting on the wierd way it used to work, but that seems unlikely.
And it would have the addde benifit of finally making it easy to check if Dink is hitting something with a weapon. (Or a specific weapon, whencombined with with compare_magic)...
Speaking of which, did compare_magic() ever get fixed?
And it would have the addde benifit of finally making it easy to check if Dink is hitting something with a weapon. (Or a specific weapon, whencombined with with compare_magic)...
Speaking of which, did compare_magic() ever get fixed?
Yeah... I can't imagine someone was using it in a weird way. You can't count on it to be empty to see if it wasn't hit by a missile, for instance.
And I just fixed compare_magic today. Turns out it was checking against the regular item inventory instead of the magic inventory, but it used the correct index.
So, say you had a fireball (magic slot 1) armed, and you had your fist in inventory slot 1.
compare_magic("item-fst"); would return true, even if the fist wasn't armed.
I also added the fabled get_next_sprite_with_this_brain... well, basically. It works just like get_sprite_with_this_brain, but you pass it an additional sprite number to start searching from. Works better than that sp_brain trick
And I just fixed compare_magic today. Turns out it was checking against the regular item inventory instead of the magic inventory, but it used the correct index.
So, say you had a fireball (magic slot 1) armed, and you had your fist in inventory slot 1.
compare_magic("item-fst"); would return true, even if the fist wasn't armed.
I also added the fabled get_next_sprite_with_this_brain... well, basically. It works just like get_sprite_with_this_brain, but you pass it an additional sprite number to start searching from. Works better than that sp_brain trick

July 6th 2005, 04:47 AM

Arik


Fixing the bomb trick will be cool - having to make a kludge solution for it in scarab was pretty annoying. Get_next_sprite_with_brain will also be extremely useful for the script I wrote for Sabre the other day. Nice!