The Dink Network

Make a better bow

December 23rd 2005, 11:40 AM
bonca.gif
Erwin
Peasant He/Him Netherlands
Friendship is magic 
Is it possible to make a script for the bow just like the one of the axe so Dink shoots immediatly instead of having to hold Ctrl so long?

edit: could someone also tell me how it works or just make such a script for me?
December 23rd 2005, 01:50 PM
dragon.gif
Actually I'd like to know how to do that as well.
December 23rd 2005, 02:42 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
this should work :

//item fastfire bow

void use( void )
{
&mypower = 100;
&mydir = sp_dir(1, -1);

playsound(44, 22050,0,0,0);

&basehit = sp_dir(1, -1);
&basehit += 100;

sp_seq(1, &basehit);
sp_frame(1, 1); //reset seq to 1st frame
sp_kill_wait(1); //make sure dink will punch right away
sp_nocontrol(1, 1); //dink can't move until anim is done!
&mholdx = sp_x(1, -1);
&mholdy = sp_y(1, -1);
freeze(1);

wait(250);

if (&mydir == 6)
{
&mholdx += 30;
&junk = create_sprite(&mholdx, &mholdy, 11, 25, 6);
sp_dir(&junk, 6);
}

if (&mydir == 4)
{
&mholdx -= 30;
&junk = create_sprite(&mholdx, &mholdy, 11, 25, 4);
sp_dir(&junk, 4);
}

if (&mydir == 2)
{
&junk = create_sprite(&mholdx, &mholdy, 11, 25, 2);
sp_dir(&junk, 2);
}

if (&mydir == 8)
{
&junk = create_sprite(&mholdx, &mholdy, 11, 25, 8);
sp_dir(&junk, 8);
}

if (&mydir == 9)
{
&junk = create_sprite(&mholdx, &mholdy, 11, 25, 5);
sp_dir(&junk, 9);
}
if (&mydir == 1)
{
&junk = create_sprite(&mholdx, &mholdy, 11, 25, 1);
sp_dir(&junk, 1);
}
if (&mydir == 7)
{
&junk = create_sprite(&mholdx, &mholdy, 11, 25, 7);
sp_dir(&junk, 7);
}

if (&mydir == 3)
{
&junk = create_sprite(&mholdx, &mholdy, 11, 25, 3);
sp_dir(&junk, 3);
}

}

&mypower / 100;
&temp = &strength;
&temp / 5;

if (&temp == 0)
{
&temp = 1;
}
&mypower * &temp;
sp_timing(&junk, 0);

if (&bowlore == 1)
{
&temp = random(3, 1);

if (&temp == 1)
{
//critical hit
&mypower * 3;
playsound(44, 14050,0,0,0);

say("`4* POWER SHOT *", 1);
}
}

//create fake shadow effect

sp_speed(&junk, 6);

sp_strength(&junk, &mypower);
sp_range(&junk, 10);
//this makes it easier to hit stuff
sp_flying(&junk, 1);
sp_script(&junk, "dam-a1");
//when the fireball hits something, it will look to this script, this way
//we can burn trees when appropriate
&mshadow = create_sprite(&mholdx, &mholdy, 15, 432, 3);
sp_brain_parm(&mshadow, &junk);
sp_que(&mshadow, -500);
sp_brain_parm(&junk, 1);
sp_brain_parm2(&junk, &mshadow);
sp_nohit(&mshadow, 1);
sp_nohit(1, 1);
wait(250);
unfreeze(1);
}

void disarm(void)
{
kill_this_task();
}

void arm(void)
{
init("load_sequence_now graphics\dink\bow\walk\d-bw1- 71 43 30 84 -14 -10 14 10");
init("load_sequence_now graphics\dink\bow\walk\d-bw2- 72 43 29 86 -21 -10 19 10");
init("load_sequence_now graphics\dink\bow\walk\d-bw3- 73 43 35 79 -13 -9 13 9");
init("load_sequence_now graphics\dink\bow\walk\d-bw4- 74 43 41 79 -18 -12 20 12");

init("load_sequence_now graphics\dink\bow\walk\d-bw6- 76 43 47 78 -23 -10 23 10");
init("load_sequence_now graphics\dink\bow\walk\d-bw7- 77 43 46 71 -20 -10 20 10");
init("load_sequence_now graphics\dink\bow\walk\d-bw8- 78 43 35 76 -15 -12 15 12");
init("load_sequence_now graphics\dink\bow\walk\d-bw9- 79 43 46 78 -13 -9 13 9");

init("load_sequence_now graphics\dink\bow\idle\d-bi2- 12 250 35 87 -17 -12 16 9");
init("load_sequence_now graphics\dink\bow\idle\d-bi4- 14 250 37 77 -11 -12 16 10");
init("load_sequence_now graphics\dink\bow\idle\d-bi6- 16 250 35 83 -15 -9 11 9");
init("load_sequence_now graphics\dink\bow\idle\d-bi8- 18 250 33 70 -15 -12 15 9");

init("load_sequence_now graphics\dink\bow\hit\d-ba2- 102 25 27 89 -23 -12 24 11");
init("load_sequence_now graphics\dink\bow\hit\d-ba4- 104 25 76 79 -23 -13 23 14");
init("load_sequence_now graphics\dink\bow\hit\d-ba6- 106 25 37 81 -14 -10 14 10");
init("load_sequence_now graphics\dink\bow\hit\d-ba8- 108 25 31 89 -17 -16 17 10");

//bow weapon diags

init("load_sequence_now graphics\dink\bow\hit\d-ba1- 101 25 57 84 -20 -12 20 12");
init("load_sequence_now graphics\dink\bow\hit\d-ba3- 103 25 33 86 -19 -13 19 13");
init("load_sequence_now graphics\dink\bow\hit\d-ba7- 107 25 54 82 -19 -11 19 11");
init("load_sequence_now graphics\dink\bow\hit\d-ba9- 109 25 37 78 -21 -10 21 10");
preload_seq(25);

Debug("Quickbow armed");

int &basehit;
int &mholdx;
int &mholdy;
int &junk;
int &mshadow;
int &mydir;
int &mypower;
int &temp;
}

void pickup(void)
{
Debug("Player now owns this item.");
kill_this_task();
}

void drop(void)
{
Debug("Item dropped.");
kill_this_task();
}

December 23rd 2005, 02:57 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
hope it works the way you want it too. i had fun making it, errr combining two scripts the wait may be a little too long (after the arrow is released), but that's easy to fix. i did that b/c at first he started walking before the arrow appeared. other than that, it works fine. and DD, you should put this in your next version of inventory
December 23rd 2005, 03:19 PM
bonca.gif
Erwin
Peasant He/Him Netherlands
Friendship is magic 
Wauw it works great! But you'd better not press Ctrl too fast over and over again because then Dink wont fire an arrow some times. You just need to wait half a second or something between firering. And the fun part is this only makes it more realistic because you would make mistakes too when you fire realy fast. And another funny thing is when you're in front of an ennemy you'll acutaly hit him because then you'll do the same dammage as your fists.

This bow works great for me you'll only need to get used to it. Thank you verry much rabidwolf9!
December 23rd 2005, 03:39 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
you could fix the damaging enemies thing by doing this in the arm part...

init("set_frame_special 102 3 0");
init("set_frame_special 104 3 0");
init("set_frame_special 106 3 0");
init("set_frame_special 108 3 0");

...but you'd have to set the last number back to 1 with any weapon you wanted to hit with. unless you could set it back in the disarm part that is; i don't think that works though(but i may be wrong)...
December 23rd 2005, 03:52 PM
bonca.gif
Erwin
Peasant He/Him Netherlands
Friendship is magic 
I just said that if you would shoot fast it could go wrong. But this also hapens when you shoot slowly. Silly me I didn't test it enough just yet. So Dink can just sometimes make a mistake when firering a bow interesting. It also makes a sound like a barrel is breaking when Dink makes a mistake. Lol. I don't know what causes this mistake but it doesn't realy bother me.
December 23rd 2005, 05:42 PM
dragon.gif
I intend to, along with the old one (in case someone wants it). In fact I'm putting it in my personal version now (I make minor updates to things sometimes, ones that aren't enough to bother with a release (like the spelling mistakes you noticed in Bestiary, which I've corrected in my version (1.01))) and put in the Credits file that you made it.

Oh, and thanks btw.
December 23rd 2005, 06:13 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
fixed some things in this one...dink doesn't attack when shooting, fixed damage so it's higher, added to strength (+3), i think this should also fix dink's misfire(i think it was from dink actually hitting the arrow?) but it might not...so, here is the newewer one:

//item fastfire bow

void use( void )
{
&mypower = 400;
&mydir = sp_dir(1, -1);

playsound(44, 22050,0,0,0);

&basehit = sp_dir(1, -1);
&basehit += 100;

sp_seq(1, &basehit);
sp_frame(1, 1); //reset seq to 1st frame
sp_kill_wait(1); //make sure dink will punch right away
sp_nocontrol(1, 1); //dink can't move until anim is done!
&mholdx = sp_x(1, -1);
&mholdy = sp_y(1, -1);
freeze(1);

wait(250);

if (&mydir == 6)
{
&mholdx += 30;
&junk = create_sprite(&mholdx, &mholdy, 11, 25, 6);
sp_dir(&junk, 6);
}

if (&mydir == 4)
{
&mholdx -= 30;
&junk = create_sprite(&mholdx, &mholdy, 11, 25, 4);
sp_dir(&junk, 4);
}

if (&mydir == 2)
{
&junk = create_sprite(&mholdx, &mholdy, 11, 25, 2);
sp_dir(&junk, 2);
}

if (&mydir == 8)
{
&junk = create_sprite(&mholdx, &mholdy, 11, 25, 8);
sp_dir(&junk, 8);
}

if (&mydir == 9)
{
&junk = create_sprite(&mholdx, &mholdy, 11, 25, 5);
sp_dir(&junk, 9);
}
if (&mydir == 1)
{
&junk = create_sprite(&mholdx, &mholdy, 11, 25, 1);
sp_dir(&junk, 1);
}
if (&mydir == 7)
{
&junk = create_sprite(&mholdx, &mholdy, 11, 25, 7);
sp_dir(&junk, 7);
}

if (&mydir == 3)
{
&junk = create_sprite(&mholdx, &mholdy, 11, 25, 3);
sp_dir(&junk, 3);
}

}

&mypower / 100;
&temp = &strength;
&temp / 5;

if (&temp == 0)
{
&temp = 1;
}
&mypower * &temp;
sp_timing(&junk, 0);

if (&bowlore == 1)
{
&temp = random(3, 1);

if (&temp == 1)
{
//critical hit
&mypower * 3;
playsound(44, 14050,0,0,0);

say("`4* POWER SHOT *", 1);
}
}

//create fake shadow effect
sp_speed(&junk, 6);
sp_strength(&junk, &mypower);
sp_range(&junk, 10);
//this makes it easier to hit stuff
sp_flying(&junk, 1);
sp_script(&junk, "dam-a1");
//when the fireball hits something, it will look to this script, this way
//we can burn trees when appropriate
&mshadow = create_sprite(&mholdx, &mholdy, 15, 432, 3);
sp_brain_parm(&mshadow, &junk);
sp_que(&mshadow, -500);
sp_brain_parm(&junk, 1);
sp_brain_parm2(&junk, &mshadow);
sp_nohit(&mshadow, 1);
sp_nohit(1, 1);
wait(250);
unfreeze(1);
}

void disarm(void)
{
init("set_frame_special 102 3 1");
init("set_frame_special 104 3 1");
init("set_frame_special 106 3 1");
init("set_frame_special 108 3 1");

&strength -= 3;
kill_this_task();
}

void armmovie(void)
{
init("set_frame_special 102 3 0");
init("set_frame_special 104 3 0");
init("set_frame_special 106 3 0");
init("set_frame_special 108 3 0");
}

void arm(void)
{
init("load_sequence_now graphics\dink\bow\walk\d-bw1- 71 43 30 84 -14 -10 14 10");
init("load_sequence_now graphics\dink\bow\walk\d-bw2- 72 43 29 86 -21 -10 19 10");
init("load_sequence_now graphics\dink\bow\walk\d-bw3- 73 43 35 79 -13 -9 13 9");
init("load_sequence_now graphics\dink\bow\walk\d-bw4- 74 43 41 79 -18 -12 20 12");

init("load_sequence_now graphics\dink\bow\walk\d-bw6- 76 43 47 78 -23 -10 23 10");
init("load_sequence_now graphics\dink\bow\walk\d-bw7- 77 43 46 71 -20 -10 20 10");
init("load_sequence_now graphics\dink\bow\walk\d-bw8- 78 43 35 76 -15 -12 15 12");
init("load_sequence_now graphics\dink\bow\walk\d-bw9- 79 43 46 78 -13 -9 13 9");

init("load_sequence_now graphics\dink\bow\idle\d-bi2- 12 250 35 87 -17 -12 16 9");
init("load_sequence_now graphics\dink\bow\idle\d-bi4- 14 250 37 77 -11 -12 16 10");
init("load_sequence_now graphics\dink\bow\idle\d-bi6- 16 250 35 83 -15 -9 11 9");
init("load_sequence_now graphics\dink\bow\idle\d-bi8- 18 250 33 70 -15 -12 15 9");

init("load_sequence_now graphics\dink\bow\hit\d-ba2- 102 25 27 89 -23 -12 24 11");
init("load_sequence_now graphics\dink\bow\hit\d-ba4- 104 25 76 79 -23 -13 23 14");
init("load_sequence_now graphics\dink\bow\hit\d-ba6- 106 25 37 81 -14 -10 14 10");
init("load_sequence_now graphics\dink\bow\hit\d-ba8- 108 25 31 89 -17 -16 17 10");

//bow weapon diags

init("load_sequence_now graphics\dink\bow\hit\d-ba1- 101 25 57 84 -20 -12 20 12");
init("load_sequence_now graphics\dink\bow\hit\d-ba3- 103 25 33 86 -19 -13 19 13");
init("load_sequence_now graphics\dink\bow\hit\d-ba7- 107 25 54 82 -19 -11 19 11");
init("load_sequence_now graphics\dink\bow\hit\d-ba9- 109 25 37 78 -21 -10 21 10");
preload_seq(25);

Debug("Quickbow armed");

int &basehit;
int &mholdx;
int &mholdy;
int &junk;
int &mshadow;
int &mydir;
int &mypower;
int &temp;
&strength += 3;
}

void pickup(void)
{
Debug("Player now owns this item.");
kill_this_task();
}

void drop(void)
{
Debug("Item dropped.");
kill_this_task();
}
December 23rd 2005, 06:24 PM
dragon.gif
Ok, I'll change the script I made to use this version.
December 24th 2005, 05:31 AM
bonca.gif
Erwin
Peasant He/Him Netherlands
Friendship is magic 
It works great now. Could you also tell me how to change the power of the bow so I can make my own ones?
December 24th 2005, 01:33 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
change the numbers where it adds/subtracts to strength when armed/disarmed. you could also change &mypower.