sp_flying through all hardness?
Is there an easy way to get a missile sprite to fly through any hardness?
Or is move_stop set to 1 the only real way?
Or is move_stop set to 1 the only real way?
Not with missile brain based sprites, at least, not brain 11 as far as I can tell.
A brief glance at the missile brain source suggests that it should allow it to fly over any sort of tile once move_nohard is on, however the missile-brained sprite will still attempt to damage sprites that aren't set to nohit or notouch.
It probably is my messy scripting, but when I use it the missile brain 11 sprite gets stuck on tile yellow hardness. And yeah the attribute of smashing through things that can be hit is not what I want.
Shame brain 6 doesn't support the sp_mx, and sp_my commands.
Shame brain 6 doesn't support the sp_mx, and sp_my commands.
The problem you're experiencing is that the sp_move_nohard value resets on any wait or callback, so it has to be set at the time of the damage proc to work. You can also make it so the entire damage procedure is ignored at the start of the damage proc should the missile encounter yellow hardness as well, this will result in what I think you're trying to achieve; the missile will fly over yellow hardness and not trigger any of the damage procedure of the missile on contact.
Add this to the beginning of the damage proc, I tested and it works for fireball so it should work for any other missiles you're cooking up for your dmod:
Basically what this will do is, when the missile tries to run the damage proc on hardness it will check the brain. Hardness doesn't have a brain so it actually returns the value "-1", rather than check for that specifically I just checked for <= 0 which works. Then it assures move_nohard is set to 1, and "return;" is run, preventing any of the actual damage proc from running.
This works for sp_mx/my and ordinary sp_dir/speed missiles as well.
Add this to the beginning of the damage proc, I tested and it works for fireball so it should work for any other missiles you're cooking up for your dmod:
sp_brain(&missile_target, -1); if (&return < 0) { sp_move_nohard(¤t_sprite, 1); return; }
Basically what this will do is, when the missile tries to run the damage proc on hardness it will check the brain. Hardness doesn't have a brain so it actually returns the value "-1", rather than check for that specifically I just checked for <= 0 which works. Then it assures move_nohard is set to 1, and "return;" is run, preventing any of the actual damage proc from running.
This works for sp_mx/my and ordinary sp_dir/speed missiles as well.