The Dink Network

sp_flying through all hardness?

March 10th, 02:34 AM
custom_simon.gif
SimonK
Peasant He/Him Australia
 
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?
March 10th, 04:51 AM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
Oh, NOW YOU'VE DONE IT! 
March 10th, 07:56 PM
custom_simon.gif
SimonK
Peasant He/Him Australia
 
Not with missile brain based sprites, at least, not brain 11 as far as I can tell.
March 11th, 12:21 AM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
Oh, NOW YOU'VE DONE IT! 
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.
March 11th, 12:35 AM
custom_simon.gif
SimonK
Peasant He/Him Australia
 
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.
March 11th, 10:30 AM
custom_robj.png
Robj
Jester He/Him Australia
You feed the madness, and it feeds on you. 
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:

 sp_brain(&missile_target, -1);
 if (&return < 0)
 {
  sp_move_nohard(&current_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.
March 11th, 06:16 PM
custom_simon.gif
SimonK
Peasant He/Him Australia
 
Thanks, I will keep this up my sleeve... I found another way to achieve what I was after, but this will prove useful later!