That fireball's pretty, but...
Okay, I'm an absolute beginner at this, as in three days ago I didn't even know what a sprite is.
Well, I've figured that one out, but now I'm stuck on the stupid fireball.
What script should I attach to it to make it actually do something? I tried copying the one from the actual game, but that just makes it crash when I try to use it.
Well, I've figured that one out, but now I'm stuck on the stupid fireball.
What script should I attach to it to make it actually do something? I tried copying the one from the actual game, but that just makes it crash when I try to use it.
You'd have to copy all the graphics, and scripts from it. Or it is 100% gonna crash!
**EDIT** are you sure that you have copyed it all? See the Dink source code in DinkC, and try copying that.

**EDIT** are you sure that you have copyed it all? See the Dink source code in DinkC, and try copying that.
Actually, Kory... I think you're wrong on this one.
You most certainly do *NOT* have to copy the original game folders into your dmod. How do you mean a fireball? The spell is simple... you just do add_item("item-fb", 437, 1); and when that line is run, the fireball spell will appear in your inventory.
If you mean a static fireball (for a torch or something), just give it brain 6. Hope that helps.
You most certainly do *NOT* have to copy the original game folders into your dmod. How do you mean a fireball? The spell is simple... you just do add_item("item-fb", 437, 1); and when that line is run, the fireball spell will appear in your inventory.
If you mean a static fireball (for a torch or something), just give it brain 6. Hope that helps.
Don't have to copy that either.
Edit: unless you mean to edit it.
Edit: unless you mean to edit it.
umm, wait till I memorize.
item-fb.c
dam-fire.c
and possibly there are some others..... browse through those scripts and look for externals, and whenever you find one copy the scipt inside the ""'s to your own dmod.
item-fb.c
dam-fire.c
and possibly there are some others..... browse through those scripts and look for externals, and whenever you find one copy the scipt inside the ""'s to your own dmod.
I still can't get it to do anything. It just crashes out whenever I try to use it.
I copied item-fb.d and dam-fire.d into my story directory but it was no use.
Is there something I need in my main.d file to get it to run? Some sort of global variable I might be missing?
I copied item-fb.d and dam-fire.d into my story directory but it was no use.
Is there something I need in my main.d file to get it to run? Some sort of global variable I might be missing?
Oh...I found the problem.
Main.d was missing a variable. How did that happen?
It works fine now.
Thanks.
Main.d was missing a variable. How did that happen?
It works fine now.
Thanks.
lol, I don't know. That's happened to me a few times as well...
Okay, new question.
Is it possible to use something like
void hit(void) to give a reaction only when you use the fireball on it?
Alternatively, and even better, how can I use
void main(void) to make Dink automatically use a fireball?
Is it possible to use something like
void hit(void) to give a reaction only when you use the fireball on it?
Alternatively, and even better, how can I use
void main(void) to make Dink automatically use a fireball?
I'm not sure that I want to answer either of those questions, heh.
Anyhow, for your first question, you can add some code like this to you dam-fire.c
int &script_of_target = is_script_attached(&missle_target);
if (&script_of_target != 0)
{
run_script_by_number(&script_of_target, "hit_by_fireball");
}
then when the fireball hits something, it will run whatever is in the void hit_by_fireball( void ) of the thing's script.
I haven't tried this myself, so I have no idea if it will work.
Anyhow, for your first question, you can add some code like this to you dam-fire.c
int &script_of_target = is_script_attached(&missle_target);
if (&script_of_target != 0)
{
run_script_by_number(&script_of_target, "hit_by_fireball");
}
then when the fireball hits something, it will run whatever is in the void hit_by_fireball( void ) of the thing's script.
I haven't tried this myself, so I have no idea if it will work.
Another thing you DO have to copy is a certain block of make_global_int commands in main.c (It says these are required at the top). If some of those are missing, that could well result in a crash.
Hmm.
I tried adding it to my dam-fire:
int &script_of_target = is_script_attached(&missle_target);
if (&script_of_target != 0)
{
run_script_by_number(&script_of_target, "hit_by_fireball");
}
Then I wrote added this to my character's script:
void hit_by_fireball(void)
{
if(&story == 5)
{
say_stop("`6Hahaha! You think that puny thing can hurt me?", ¤t_sprite);
}
}
It appears to do nothing. Any suggestions?
I tried adding it to my dam-fire:
int &script_of_target = is_script_attached(&missle_target);
if (&script_of_target != 0)
{
run_script_by_number(&script_of_target, "hit_by_fireball");
}
Then I wrote added this to my character's script:
void hit_by_fireball(void)
{
if(&story == 5)
{
say_stop("`6Hahaha! You think that puny thing can hurt me?", ¤t_sprite);
}
}
It appears to do nothing. Any suggestions?
I've no ideas at all. Stair-hiding-pine-trees work in a similar way, but with them dam-fire runs the target's die(). Frankly, I've found run_script_by_number to be annoyingly buggy. My suspicion is that ¤t_sprite is somehow not reset, although that is blatantly impossible... in other words, I have no idea what's going on.