Burnin trees
Okay well after hours of banging my head on the desk, I decided to move on to something else in my d-mod because i couldn't figure out how to burn a tree...but, here's the way i want the tree to burn: when regular fireball hits the tree, the tree will be tickled so he'll say something like "HA! your puny magic can't hurt meh!", but when hellfire magic hits the tree, the tree will be burnt down. I jacked around with the scripts and ended up getting the fireball script to work, and the hellfire one sort of works. It disables the hardness of the tree without playing sequence 20. I made no changes to that script...Any suggestions?
You shouldn't have to modify the hellfire script (dam-sfb.c) at all, or give the trees special scripts to make them burnable. In fact, giving a script to a tree will make it so you can't burn it (and might cause your problem with hellfire killing the hardness and not playing the sequence). But you do have to change the fireball script (dam-fire.c) like so:
//dam-fire.c (normal fireball)
void main( void )
{
int &mcrap;
int &scrap;
int &junk;
}
void damage( void )
{
playsound(18, 8000,0,0,0);
&scrap = &current_sprite;
kill_shadow(&scrap);
sp_seq(&scrap, 70);
sp_pseq(&scrap, 70);
sp_frame(&scrap, 1);
sp_brain(&scrap, 7);
&mcrap = sp_y(&scrap, -1);
&mcrap -= 35;
sp_y(&scrap, &mcrap);
&mcrap = sp_pseq(&missile_target, -1);
&scrap = sp_pframe(&missile_target, -1);
if (&mcrap == 32)
{
if (&scrap == 1)
{
//they hit a tree, lets taunt the player
say("HA! Your puny magic can't hurt me!",&current_sprite);
}
}
}
//dam-fire.c (normal fireball)
void main( void )
{
int &mcrap;
int &scrap;
int &junk;
}
void damage( void )
{
playsound(18, 8000,0,0,0);
&scrap = &current_sprite;
kill_shadow(&scrap);
sp_seq(&scrap, 70);
sp_pseq(&scrap, 70);
sp_frame(&scrap, 1);
sp_brain(&scrap, 7);
&mcrap = sp_y(&scrap, -1);
&mcrap -= 35;
sp_y(&scrap, &mcrap);
&mcrap = sp_pseq(&missile_target, -1);
&scrap = sp_pframe(&missile_target, -1);
if (&mcrap == 32)
{
if (&scrap == 1)
{
//they hit a tree, lets taunt the player
say("HA! Your puny magic can't hurt me!",&current_sprite);
}
}
}
June 10th 2003, 10:21 AM

illusivefing


Okay, that's exactly what i did to the fireball script
but...there is one tree that i have a script attached to that makes it talk...what do i do about that?

Hmm... the original hellfire script has a bug in it. Replace this code:
//they hit a tree, lets burn the thing
int &hold = sp_editor_num(&missile_target);
sp_hard(&missile_target, 1);
draw_hard_sprite(&missile_target);
&junk = is_script_attached(&missile_target);
if (&junk > 0)
{
//Script is attached to this tree! Let's run it's die script
run_script_by_number(&junk, "DIE");
return;
}
With this:
//they hit a tree, lets burn the thing
int &hold = sp_editor_num(&missile_target);
&junk = is_script_attached(&missile_target);
if (&junk > 0)
{
//Script is attached to this tree! Let's run it's die script
run_script_by_number(&junk, "DIE");
return;
}
sp_hard(&missile_target, 1);
draw_hard_sprite(&missile_target);
//they hit a tree, lets burn the thing
int &hold = sp_editor_num(&missile_target);
sp_hard(&missile_target, 1);
draw_hard_sprite(&missile_target);
&junk = is_script_attached(&missile_target);
if (&junk > 0)
{
//Script is attached to this tree! Let's run it's die script
run_script_by_number(&junk, "DIE");
return;
}
With this:
//they hit a tree, lets burn the thing
int &hold = sp_editor_num(&missile_target);
&junk = is_script_attached(&missile_target);
if (&junk > 0)
{
//Script is attached to this tree! Let's run it's die script
run_script_by_number(&junk, "DIE");
return;
}
sp_hard(&missile_target, 1);
draw_hard_sprite(&missile_target);
June 10th 2003, 10:52 AM

illusivefing


Once again...i think that was a bug, but wasn't the problem...i looked at it more closely and wondered what would happen if i took out the code that checks to see if a script is attached...i commented all that mess out and it works just fine now, but thanks
//they hit a tree, lets burn the thing
int &hold = sp_editor_num(&missile_target);
// &junk = is_script_attached(&missile_target);
// if (&junk > 0)
// {
// //Script is attached to this tree! Let's run it's die script
// run_script_by_number(&junk, "DIE");
// return;
// }
sp_hard(&missile_target, 1)
draw_hard_sprite(&missile_target);
//they hit a tree, lets burn the thing
int &hold = sp_editor_num(&missile_target);
// &junk = is_script_attached(&missile_target);
// if (&junk > 0)
// {
// //Script is attached to this tree! Let's run it's die script
// run_script_by_number(&junk, "DIE");
// return;
// }
sp_hard(&missile_target, 1)
draw_hard_sprite(&missile_target);
Yes, because in Dink, he doesn't want to burn trees witha script, because they probably do something special. And if you have a script on it, you probably do want to do something special. What it does is checks for the script and runs a procedure if it does, so just add a proper procedure to the script of the tree, that is triggered by a fireball.