The Dink Network

Complicated Dink C

June 13th 2006, 02:17 PM
wizard.gif
Davidi
Peasant They/Them
 
Hello. I am working on a complicated D-mod(See my blog for details)

I want to have it set so when you arm a certain sword, it creates elemental magic skills. I already know how to do everything except one thing: Say, I want to create a flame on an enemy that I just hit with my sword. Would there be a variable, like, &hit_sprite, or something like that? And also, I want to make certain bombs be able to explode certain objects, like a power bomb explode a special rock. For the rock's hit, how would it detect if the damaging sprite is the power bomb?

Thanks.
June 13th 2006, 02:28 PM
slimeb.gif
DaVince
Peasant He/Him Netherlands
Olde Time Dinkere 
You startled me with that nickname!

Uh, haven't looked through Dink scripts in a while, so that's all I can say, sorry.
June 13th 2006, 03:12 PM
goblinm.gif
You need to learn how to use brain 17. Brain 17 is a missile brain which cycles once (IIRC). So you would do something like:

void use( void )
{
int &my_x=sp_x(1, -1);
int &my_y=sp_y(1, -1);
int &my_dir = sp_dir(1, -1);
if (&my_dir == 2)
{
&my_y += 30;
//^If dink is facing down, we will make an explosion sprite below him on the screen.
}
...
...
...
int &junk = create_sprite(&my_x, &my_y, 17, 70, 1);
//^I think 70 is the correct sequence, but it's been a while...
sp_script(&junk, "explosio");
}

More to come...
June 13th 2006, 03:19 PM
goblinm.gif
So what makes missile brains special is that they have a damage procedure. This means that we can do:

//explosio.c
void main( void )
{
//set sequences and such
sp_seq(&current_sprite, 70);
...
...
...
sp_brain_parm(&current_sprite, 1);
//^this means it can't hit Dink
sp_nodraw(&current_sprite, 1);
//make it invisible, most of the time
}

void damage( void )
{
int &my_brain = sp_brain(&missile_target, -1);
//missile_target is the thing hit by the missile, IIRC
if (&my_brain == 9)
{
int &get_x = sp_x(&missile_target, -1);
int &get_y = sp_y(&missile_target, -1);
sp_x(&current_sprite, &get_x);
sp_y(&current_sprite, &get_y);
//^Center it on target if target has monster brain
sp_nodraw(&current_sprite, 0);
//^Make it visible if target has monster brain
}
}
June 13th 2006, 03:26 PM
goblinm.gif
Looking through the source for A Very Dink Christmas, it looks like I did a similar effect in a different way for the lightning sword, based on redink's fire sword. Unfortunately, neither is very well commented.

Edit: If you need any help, feel free to ask.
June 21st 2006, 12:02 PM
wizard.gif
Davidi
Peasant They/Them
 
Thanks. Why didn't I think of that before?

But I'd also need it to be able to freeze the enemy with an ice sword...eh, I guess I can forget about that...
June 28th 2006, 01:17 PM
goblinm.gif
Ok, I think I'll try to put out a source pack for elemental swords... some time this weekend maybe.
June 28th 2006, 04:23 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
Elemental swords could use an update, but what's the point of having two separate files floating around that belong together? I'm thinking maybe there can be an upgrade in which the files are renamed, scripts are provided, and maybe even a little test mod with everything implemented into the game and instructions are provided. Just an idea.
June 29th 2006, 07:55 AM
custom_fish.png
SabreTrout
Noble He/Him United Kingdom
Tigertigertiger. 
An upgrade of that sort would be very well received, I'm sure. The Elemental Swords haven't been used in many d-mods, probably due to the lack of .INI lines and scripts.

If somebody was to mkae a new file, with those included, I think it would go down very well indeed.

June 29th 2006, 11:09 AM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
I've done a little 'research' and have noticed that none of Bruce Harrison's graphics packs have ini lines or scripts (for the ones that could use them). Maybe I could look into upgrading them if I find the time. I don't have much though, I've been stalled on Dressup Dan. I haven't worked on it for about a week. I have summer school to deal with, my fiance to keep happy and give all my time to, and she's coming up here July, 10th, so I have to clean up and get ready for her. Maybe someone? I could rename the files to make them fit in the game though.

Thought: I was reading into his old posts and such and came across something. He said something about adding more spells and a different explosion for his Lightning Spells graphics pack. I realize that the posts are years old, but what happened? It seems like he had a lot of good projects going that never got finished or released.
June 29th 2006, 12:49 PM
bonca.gif
Erwin
Peasant He/Him Netherlands
Friendship is magic 
Uhh.. Then maybe your birth was ment to replace him.
July 3rd 2006, 07:43 PM
goblinm.gif
Ok, I've gotten three scripts done so far (2 for earth, 1 for fire.) I'm planning to put out 12 (3 for each element.) Or maybe 13, I don't know. Progress is slow because I have been busy (moving, buying furniture, etc.) but I should be finished in another couple weeks.
July 24th 2006, 09:28 PM
goblinm.gif
Ok, I really need to start doing things I say I'm going to do. Anyhow, I have all six earth and fire done, and Sephiroth's graphics for the firesword look good, although sometimes the after-effect starts before the final frame of the attack animation, which is annoying.

Anyways, I'm not sure what effects I should have for ice and lightning. I'm thinking about maybe using Sephiroth's other graphics pack for the lightning effects, but ice is tricky. Obviously, there should be a freeze effect, but what else?