Attacking sprites
Im making the spike sprite fight for dink. I got it chasing other sprites having brain 9, but it does no damage;
sp_brain(&current_sprite,9);
sp_strength(&current_sprite,7);
sp_nohit(&current_sprite, 0);
sp_distance(&current_sprite, 40);
sp_speed(&current_sprite,1);
sp_touch_damage(&current_sprite,7);
int &mtarget = get_sprite_with_this_brain(9, &current_sprite);
if (&mtarget > 0)
{
sp_target(&current_sprite, &mtarget);
}
// I'm not even sure what sp_nohit does, but it didn't work with or without it. Any clues how to make it damage other sprites? Does it need an attack seq ?
sp_brain(&current_sprite,9);
sp_strength(&current_sprite,7);
sp_nohit(&current_sprite, 0);
sp_distance(&current_sprite, 40);
sp_speed(&current_sprite,1);
sp_touch_damage(&current_sprite,7);
int &mtarget = get_sprite_with_this_brain(9, &current_sprite);
if (&mtarget > 0)
{
sp_target(&current_sprite, &mtarget);
}
// I'm not even sure what sp_nohit does, but it didn't work with or without it. Any clues how to make it damage other sprites? Does it need an attack seq ?
How about letting the spike follow the enemy, using sp_follow(); ? It could then 'attack' with his touch_damage
Edit: Ah, I see you got it chasing the enemy already... mm, makes my post pretty useless, I guess

Edit: Ah, I see you got it chasing the enemy already... mm, makes my post pretty useless, I guess

No, touch damage only affects dink.
You simply have to use:
sp_target(&current_sprite, &othersprite);
or whatever, but you'll also need to give it an attack sequence then...you could make the attack the same as the walk, but that would look kinda funny...too bad the spike doesn't come with one..
You simply have to use:
sp_target(&current_sprite, &othersprite);
or whatever, but you'll also need to give it an attack sequence then...you could make the attack the same as the walk, but that would look kinda funny...too bad the spike doesn't come with one..
Hrm... you could make a seperate set of sequences for Dink's spike (as opposed to the regular enemy spike). Or if there isn't going to be an enemy spike in your D-Mod, you can do it with just one. Then you wouldn't need to specify an attack sequence; it would just do it automatically.
Anyway, lets say the spike has its sequences in the 880's (so 881 is going lower-left, and so on).
Then add 2 lines like this for each sequence in the dink.ini:
set_frame_special 881 4 1
set_frame_special 881 8 1
Tada, it will now 'hit' any sprite whenever its frame is 4 or 8... if it hits too much, just choose one frame.
Unfortunatly, there isn't much you can do so Dink won't be attacked... though you could try this:
sp_brain_parm(&current_sprite, 1);
but I think it only works for missile brains, not enemies.
Good luck!
Anyway, lets say the spike has its sequences in the 880's (so 881 is going lower-left, and so on).
Then add 2 lines like this for each sequence in the dink.ini:
set_frame_special 881 4 1
set_frame_special 881 8 1
Tada, it will now 'hit' any sprite whenever its frame is 4 or 8... if it hits too much, just choose one frame.
Unfortunatly, there isn't much you can do so Dink won't be attacked... though you could try this:
sp_brain_parm(&current_sprite, 1);
but I think it only works for missile brains, not enemies.
Good luck!
I tried sp_base_attack(&current_sprite,840);
no luck.( Also duplicated some .ini lines and tried the new seq # for base attack...nope.)
but redinks' idea worked perfect.
I'm not worried about dink being vulnerable, the spike looks like something to stay out of the way of. I'll just use sp_target to control what is getting hit. I now have the spawn spike spell! Thanks everyone. (esp. redink.)
no luck.( Also duplicated some .ini lines and tried the new seq # for base attack...nope.)
but redinks' idea worked perfect.
I'm not worried about dink being vulnerable, the spike looks like something to stay out of the way of. I'll just use sp_target to control what is getting hit. I now have the spawn spike spell! Thanks everyone. (esp. redink.)

dang redink, that was smooth, if you came up with that on the spot, i'm impressed.