The Dink Network

Pine Tree Script please

July 26th 2004, 01:09 PM
duckdie.gif
Hi.

I need a script which will allow me to burn pine trees.

I also want to be able to talk to them when I hit space.

I also want them to talk when hit.

Here is the script I have been using:

**********************
void hit(void)
{
say("`3Mushrooms like that more than I.", &current_sprite);
}

void talk(void)
{
say("Looks like a dead tree.",1);
wait(500);

say("`3Looks are decieving.", &current_sprite);
}**************************

I would prefer not to stop dink during these allowing him to continue moving.

Please to fix my script for me to allow the trees to burn.

Thank you.
July 26th 2004, 03:20 PM
anon.gif
MiloBones
Ghost They/Them
 
Method 1. If you don't have any trees that do something special when burned, just open the file named dam-fire.c (you can find it in the source) and comment (put // before) the following line:

return;

Then save it into your story folder.

Method two: Try adding some "tree burning" lines as your tree's die() proc. You can probably find these lines in the above mention dam-fire.c. Something like:

void die( void )
{
int &hold = sp_editor_num(&current_sprite);
sp_hard(&current_sprite, 1);//why???
draw_hard_sprite(&current_sprite);
if (&hold != 0)
{
editor_type(&hold, 4);
editor_seq(&hold, 20);
editor_frame(&hold, 29);
}
sp_pseq(&current_sprite, 20);
sp_pframe(&current_sprite, 29);
sp_hard(&current_sprite, 0);
draw_hard_sprite(&current_sprite);
sp_seq(&current_sprite, 20);
playsound(6, 8000,0,&current_sprite,0);
}

Someone else might explain this better or more correctly...
July 26th 2004, 07:05 PM
duckdie.gif
My dam-fre starts off with:

//script for individual fireball

So this is for trees?

July 27th 2004, 07:33 AM
slayer.gif
MadStalker
Peasant He/Him Finland
tag line 
No, don't attach the dam-fire to the tree. The dam-fire script is attached to the fireball when you cast the fireball spell.
July 27th 2004, 04:02 PM
duckdie.gif
So Dam fire is not for trees?

Then what am I suppose to do with dam fire?

July 28th 2004, 05:50 AM
slayer.gif
MadStalker
Peasant He/Him Finland
tag line 
This causes the pine tree to burn even if it has a script attached to it. So don't attach this to the tree. Actually don't attach this to anything because the game does it automatically, as I said it attaches this script to the flying fireballs. I'm not actually 100% sure will this modification of the script work, though.

Just save this script into your D-Mod's story folder and name it dam-fire:

{
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);
int &hold = sp_editor_num(&missile_target);

if (&mcrap == 32)
{
if (&scrap == 1)
{
//they hit a tree, lets burn the thing
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;
// }

if (&hold != 0)
{
//this was placed by the editor, lets make the tree stay burned
editor_type(&hold, 4);
editor_seq(&hold, 20);
editor_frame(&hold, 29);
//type means show this seq/frame combo as background in the future
}

sp_pseq(&missile_target, 20);
sp_pframe(&missile_target, 29);
sp_hard(&missile_target, 0);
draw_hard_sprite(&missile_target);
sp_seq(&missile_target, 20);
playsound(6, 8000,0,&missile_target,0);

}
}

}

EDIT: dang, I just hate it when this gets fudgeed up when I post this.
July 30th 2004, 09:00 AM
duckdie.gif
No, Dam-fire script there will let the tree burn - as long as I do not have a script attached to it.

My conversation script:

****************************************

void hit(void)
{
say("`2Back off buddy!".", &current_sprite);
}

void talk(void)
{
say("Nice tree.",1);
wait(500);

say("`2Why thank you 'uman.", &current_sprite);
}

************************************

I could just not let the trees talk, or have the talking pines be unburnable - hm. That would give me another angle to approach my story from, a minor flaw turned into an asset?

July 31st 2004, 04:42 AM
slayer.gif
MadStalker
Peasant He/Him Finland
tag line 
Uh, the modification of the dam-fire I posted (supposedly, I haven't tested) burns the trees even if they have a script attached.
July 31st 2004, 10:01 PM
duckdie.gif
Hm, Well I'll try copying and pasting it in my Dam file again.