The Dink Network

Dealing with sprites...

June 11th 2003, 07:45 PM
farmer.gif
I've got a few questions about sprites. First off...how would i get a npc sprite to purposely attack another npc sprite? I'm sure I can find some code out there that would help me but i figured that coming to the board would be the fastest way to do that.
Second, how do I create depth dots and hardboxes on new sprites or view the depth dots on pre-existing sprites?
Third, why the hell are the sprites you're looking for in the most obscure places lol? For example, it always takes me an hour of searching before I remember that the fountain is in the log sequence, and that the signs are in the well one. Is there any way someone can come up with a new system for that? because i'm sure that i'm not the only one who is bugged by it.
June 11th 2003, 07:56 PM
knight.gif
Vortex
Peasant He/Him United States
It rubs the lotion on its skin... 
And the king is in with the food...but strangely that makes sence...go figure..
June 11th 2003, 08:55 PM
pq_frog.gif
Ric
Peasant They/Them Canada
 
Any sprite (with brain 9 ) can attack any other sprite if you know the sprite # or have a variable set to it. I used a script and a global variable just for that perpose. eg call the script "look.c". All it contains is;
void main ()
{
&look = &current_sprite;
}
Set look.c as the script of the victim sprite(or any sprite you want controlled by anothers' script).
Then in the attackers script, sp_attack(&current_sprite,&look);
Of course, if the sprite getting attacked already has a script, just set a global variable to &current_sprite within its script, so any other script can ID that sprite.

As for dot depth and hardboxes, I would refer to the tutorial on the dink.ini editing. For myself i once copied some graphics into the original, used its uber editor, then copied back the dink.ini changes, but don't use the uber editor in your project folder!.
And you are right about the graphics organising. Hey, re-arranging those might be a good idea in the seleton dmod. You could redo them in your own, but its a bit of work.
June 14th 2003, 11:06 PM
wizardg.gif
Paul
Peasant He/Him United States
 
1. Assuming both NPCs are already on the map, do something like this in NPC1's script.

int &mytarget = sp(##); //where is NPC2's editor number.
sp_target(&current_sprite, &mytarget);

EDIT TO ADD:
Also the attacking sprite will need an actually attack animation (eg, knights) because touch damage only works on Dink.


2. When viewing the frames in a seqence in DinkEdit press E. This will let you see the hard box and depth dot. You can also change them and press S to save the change to Dink.ini for that d-mod. I assume WinDinkedit can do this too, but I forget how if so. Another easy way to check the depth dot in DinkEdit is to just pick up a sprite and set it down again, the arrow will be pointing to the depth dot.

3. Just cause Seth grouped things however made sense at the time. Both of those for example make some sense when you look at the files names: gardn-## and landm-## so they're the garden sprites and the landmark sprites.

I don't know of any better sorting method. If someone wanted to just make a text file with an alphabetical list of objects and what sequence they're in, it might come in handy.