The Dink Network

A question

April 8th 2012, 09:26 AM
custom_skull.gif
Skull
Peasant He/Him Finland bloop
A Disembodied Sod 
I want to make a certain sword able to burn trees when I hit them with it. How can I make this happen?
April 8th 2012, 10:27 AM
custom_iplaydink.gif
Iplaydink
Peasant He/Him Sweden
Hmm.. 
First thing that comes to mind is to check ehich is equipped In the tree-scrpts void hit and then make sure it's the sword. Then check if dink is the source of the damage ( not some kind of spell that shouldn't burn trees)
April 8th 2012, 12:40 PM
pillbug.gif
Pillbug
Peasant He/Him United States
Love! True love! 
IPD's method is probably the easiest, but it would suck to have to attach a script to every tree, especially going back and making sure *every* tree has the script. However, all the methods of figuring out if you hit a tree without the tree's script are overly complicated (at least all the ones I can think of). My best suggestion would probably be to go with IPD's idea, or to add a little explosion effect that has a similar script to dam-fire.c, as it sounds cool and you wouldn't have to script all the trees.
April 8th 2012, 02:12 PM
wizardg.gif
Paul
Peasant He/Him United States
 
I'd go with the mini-explosion myself. I assume this is a flaming sword or something, so perhaps you can even turn it into a suitable special effect. Otherwise an invisible sprite would do fine.
April 8th 2012, 04:47 PM
custom_skull.gif
Skull
Peasant He/Him Finland bloop
A Disembodied Sod 
Hmmm... it seems there isn't an actual script for tree burning. That really sucks.
April 8th 2012, 05:10 PM
pillbug.gif
Pillbug
Peasant He/Him United States
Love! True love! 
What do you mean? The part where the tree actually burns and stays burned can be found in dam-fire.c, if that's what you mean.
April 8th 2012, 05:14 PM
custom_skull.gif
Skull
Peasant He/Him Finland bloop
A Disembodied Sod 
Wait... nevermind. That fails, anyway.

EDIT: It's weird, cause I'm trying to find the reason why a fireball, for example, burns a tree. But I can't find the reason. I thought maybe there's something in the fireball script, which I could copy to my sword script, but apparently the whole burning process is controlled from the dam-fire.c script.
April 8th 2012, 07:29 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
The tree burning happens within dam-fire, specifically the damage procedure. The script checks to see if the hit object has the sequence and frame of the proper tree. If the target is in fact the correct tree sprite, then it causes the tree to burn and sets the editor info of the tree to stay burned.

I think Pillbug has the right idea. Within your weapon script use procedure, create a stationary missile in front of Dink with a modified version of the dam-fire script to burn the tree.
April 9th 2012, 04:39 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
Since Dink v1.08 the variable &missile_target also works for swords. So really you could do exactly the same thing as dam_fire.c does: Check if the thing you're hitting is a tree by checking its frame and sequence number and then burning it down. You could do that in the void_use(){} procedure of your sword's script. I think putting the check after a wait() command would be best as the sword only hits something after a number of frames...
April 9th 2012, 04:51 AM
custom_skull.gif
Skull
Peasant He/Him Finland bloop
A Disembodied Sod 
Um... sorry to ask, Meta, but can you bother to create the script for me? I don't really get what you're saying, cause I'm an idiot, so perhaps showing me would be the best way.
April 9th 2012, 05:52 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
Sorry, but I'm really busy today, and probably tomorrow too. Maybe on wednesday, not before that.

If you can wait, I would like the challenge I think...
April 9th 2012, 06:52 AM
spike.gif
Sounds kind of unreliable. Waits = . If there is a good method to get the right &missile_target, though, that would be ideal.
April 9th 2012, 12:11 PM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
No, I believe the only viable ways to do this are to either make the sword create a small "missile" like an explosion and check for the tree in that explosion script (same way as the fireball works) or attach a script to all the trees that checks for being hit by that specific sword. If you choose for the second option, then you can easily use the Sprite Replacer tool to attach the same script to every instance of the tree. I would personally go for the first method if you want cool looks and maybe some extra gameplay to go with it or the second method if it needs to be quick and easy
April 9th 2012, 06:27 PM
pq_knight.gif
ExDeathEvn
Peasant He/Him New Zealand rumble
"Skinny Legend" 
Didn't Dinkdude95 have a sword that burns the trees? I remember somebody had one anyway, shown in a sword showcase file somewhere (coulda been a beta of some sort though).
April 9th 2012, 10:10 PM
wizardb.gif
Mrgantoe
Peasant He/Him Cuba
I'm simply a distraction. 
Oil and lots of it
April 10th 2012, 03:40 PM
anon.gif
shevek
Ghost They/Them
 
Didn't Dinkdude95 have a sword that burns the trees?

Yes, there's one in Trials of a Boy: Enter the Iceland. I'm pretty sure this works with an explosion. And it's not invisible.
April 10th 2012, 03:46 PM
custom_skull.gif
Skull
Peasant He/Him Finland bloop
A Disembodied Sod 
Thanks to Kyle, I now have an excellent sword which burns trees.

Although I am facing another problem. I'm trying to make it so when I punch a pillar (&current_sprite), a rock (&temp6hold) falls and hurts the enemy (&temphold). Well, to a certain point, it works perfectly, but after the rock has moved down, the script just completely stops working. Weird thing is, if I remove the move_stop -line, it works perfectly again. Here's the script:

void main( void )
{
freeze(&current_sprite);
sp_hitpoints(&current_sprite, 300);
sp_brain(&current_sprite, 9);
}
void talk(void)
{
say("This pillar looks weak.", 1);
}
void hit(void)
{
playmidi("45.mid");
}
void die(void)
{
sp_hard(&current_sprite, 1);
sp_nohit(&current_sprite, 1);
int &hold = sp_editor_num(&current_sprite);
if (&hold != 0)
editor_type(&hold, 1);

&save_x = sp_x(&current_sprite, -1);
&save_y = sp_y(&current_sprite, -1);
&pillars += 1;

sp_speed(&temp6hold, 6);
freeze(&temp6hold);
sp_que(&temp6hold, 800);
sp_nodraw(&temp6hold, 0);
move_stop(&temp6hold, 2, 268, 1);

hurt(&temphold, 300);
wait(300);
sp_nodraw(&temp6hold, 1);
move_stop(&temp6hold, 8, 12, 1);
}
April 10th 2012, 05:12 PM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
You're doing that stuff in void die(), which means it won't completely run. Move_stop will pause that script, but it will die in the meanwhile. You can solve this easily by changing the sprite's brain to 0 at the start of the die() procedure

And if that's not enough, put all that stuff in an external().
April 11th 2012, 04:23 PM
custom_skull.gif
Skull
Peasant He/Him Finland bloop
A Disembodied Sod 
Oh, I fixed this. But completely forgot to post in this thread. That's what D-Modding causes you. It makes you forget things. So whenever you create a D-Mod, remember to use amnesia-condoms!