The Dink Network

Attacking sprites

February 13th 2003, 01:09 PM
pq_frog.gif
Ric
Peasant They/Them Canada
 
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 ?
February 14th 2003, 11:15 AM
pq_frog.gif
Ric
Peasant They/Them Canada
 
February 14th 2003, 11:25 AM
fish.gif
Simeon
Peasant He/Him Netherlands
Any fool can use a computer. Many do. 
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
February 14th 2003, 11:50 AM
custom_odd.gif
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..
February 14th 2003, 11:51 AM
sob_scorpy.gif
Tyrsis
Peasant She/Her Russia
 
Yes, the attack seq is a must.
February 14th 2003, 12:06 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
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!
February 14th 2003, 02:14 PM
pq_frog.gif
Ric
Peasant They/Them Canada
 
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.)
February 14th 2003, 04:33 PM
custom_odd.gif
dang redink, that was smooth, if you came up with that on the spot, i'm impressed.