Reply to sp_brain and sp_distance/sp_range
If you don't have an account, just leave the password field blank.
Alright, so my earth spike spell, it just won't be perfect, no matter what I do.
Right now, the script is as follows:
if (&spell_level-earth < 5)
{
sp_hard(¤t_sprite, 0);
draw_hard_sprite(¤t_sprite);
sp_seq(¤t_sprite, 36);
sp_brain(¤t_sprite, 7);
playsound(6, 22050, 0,0,0);
int &str = 5;
&str * &spell_level-earth;
sp_strength(¤t_sprite, &str);
return;
}
if (&spell_level-earth < 10)
{
sp_hard(¤t_sprite, 0);
draw_hard_sprite(¤t_sprite);
sp_seq(¤t_sprite, 37);
sp_brain(¤t_sprite, 7);
playsound(6, 22050, 0,0,0);
int &str = 3;
&str * &spell_level-earth;
sp_strength(¤t_sprite, &str);
return;
}
Now this all works fine
The problem is, at level 5, the earth spike does this split, so it comes up, doing the damage, then it does another animation, doing another frame of damage. This almost works. With the brain as it is, and making the right frames special in the dink.ini, it hits with the frames I want only. However, the size of the hit is only the size of the first frame. The second hit I want to be bigger. In dink.ini, I've made the hardbox for that frame bigger. It looks bigger when I check in dinkedit. It still doesn't hit bigger, though.
What I've tried:
-sp_distance, it just doesn't seem to work.
-changing the brain to 17, using sp_range. now this almost works, I can change the size of the hit, but with that brain, it's just weird. I have to use void damage and if it doesn't hit anything (as I have it just come up at a random location if there is no enemy) it keeps looping, as the brain intends. Also, the first two frames hit for some odd reason. so this brain is just out.
I really can't think of any good meathods, except maybe waiting til after the first hit, changing the hardbox size of all the frames (or just setting them all to large except the first and hitting one) and having a wait and then redraw the sp hardbox... but I only want the middle part of the spike to actually be hard (as in you can't walk thru it)
Bah! So my real question: what are the specifications under which brains sp_distance and sp_range work, and can anyone think of a better meathod of doing this? I'll post the full spell scripts here, also:
mag-ear1.c
//magic earth
void use( void )
{ if (&mana_current < 1) { say("Not enough mana.", 1); return; }
int &10 = get_rand_sprite_with_this_brain(10, ¤t_sprite);
if (&10 > 0) { // freeze(&10); int &x = sp_x(&9, -1); int &y = sp_y(&9, -1); int &junk;
&y += 15;
&junk = create_sprite(&x, &y, 0, 36, 1); sp_script(&junk, "dam-earth");
} if (&10 == 0) { int &9 = get_rand_sprite_with_this_brain(9, ¤t_sprite);
if (&9 > 0) { //freeze(&9); int &x = sp_x(&9, -1); int &y = sp_y(&9, -1); int &junk;
&y += 15; &junk = create_sprite(&x, &y, 0, 36, 1); sp_script(&junk, "dam-earth");
} }
if (&10 == 0) { if (&9 == 0) { int &3 = get_rand_sprite_with_this_brain(3, ¤t_sprite);
if (&3 > 0) { //freeze(&3); int &x = sp_x(&3, -1); int &y = sp_y(&3, -1); int &junk;
&y += 15; &junk = create_sprite(&x, &y, 0, 36, 1); sp_script(&junk, "dam-earth");
} } }
if (&10 == 0) {
if (&9 == 0) {
if (&3 == 0) { int &4 = get_rand_sprite_with_this_brain(4, ¤t_sprite);
if (&4 > 0) { //freeze(&4); int &x = sp_x(&4, -1); int &y = sp_y(&4, -1); int &junk;
&y += 15; &junk = create_sprite(&x, &y, 0, 36, 1); sp_script(&junk, "dam-earth");
} } } } if (&10 == 0) {
if (&9 == 0) {
if (&3 == 0) {
if (&4 == 0)
{ int &16 = get_rand_sprite_with_this_brain(16, ¤t_sprite);
if (&16 > 0) { //freeze(&16); int &junk;
&y += 15; &junk = create_sprite(&x, &y, 0, 36, 1); sp_script(&junk, "dam-earth");
} } } } }
if (&10 == 0)
{
if (&9 == 0)
{
if (&3 == 0)
{
If (&4 == 0)
{
if (&16 == 0)
{
int &rand;
int &other; &rand = random(500, 1); &other = random(500, 1);
int &junk; &junk = create_sprite(&rand, &other, 0, 36, 1); sp_script(&junk, "dam-earth");
}
}
}
}
}
&mana_current -= 1;
&bleh = 25;
&bleh * &magic;
&magic_cost = &bleh;
&magic_level = 0;
draw_status();
wait(1355);
if(&spell_level-earth > 4)
{
wait(1085);
}
sp_hard(&junk, 1);
draw_hard_sprite(&junk);
//unfreeze(&10);
sp_target(&10, 1);
//unfreeze(&9);
sp_target(&9, 1);
//unfreeze(&3);
sp_target(&3, 1);
//unfreeze(&4);
sp_target(&4, 1);
//unfreeze(&16);
sp_target(&16, 1);
return;
}
void disarm(void)
{
kill_this_task();
}
void arm(void)
{
int &bleh = 25;
&bleh * &magic;
&magic_cost = &bleh;
&magic_level = 0;
}
void pickup(void)
{
}
void drop(void)
{
draw_status();
kill_this_task();
}
dam-earth.c
void main(void )
{
if (&spell_level-earth < 5)
{
sp_hard(¤t_sprite, 0);
draw_hard_sprite(¤t_sprite);
sp_seq(¤t_sprite, 36);
sp_brain(¤t_sprite, 7);
playsound(6, 22050, 0,0,0);
int &str = 5;
&str * &spell_level-earth;
sp_strength(¤t_sprite, &str);
return;
}
if (&spell_level-earth < 10)
{
sp_hard(¤t_sprite, 0);
draw_hard_sprite(¤t_sprite);
sp_seq(¤t_sprite, 37);
sp_brain(¤t_sprite, 7);
playsound(6, 22050, 0,0,0);
int &str = 3;
&str * &spell_level-earth;
sp_strength(¤t_sprite, &str);
return;
}
sp_hard(¤t_sprite, 0);
draw_hard_sprite(¤t_sprite);
sp_seq(¤t_sprite, 37);
sp_brain(¤t_sprite, 7);
playsound(6, 22050, 0,0,0);
int &str = 5;
&str * &spell_level-earth;
sp_strength(¤t_sprite, &str);
return;
}
Right now, the script is as follows:
if (&spell_level-earth < 5)
{
sp_hard(¤t_sprite, 0);
draw_hard_sprite(¤t_sprite);
sp_seq(¤t_sprite, 36);
sp_brain(¤t_sprite, 7);
playsound(6, 22050, 0,0,0);
int &str = 5;
&str * &spell_level-earth;
sp_strength(¤t_sprite, &str);
return;
}
if (&spell_level-earth < 10)
{
sp_hard(¤t_sprite, 0);
draw_hard_sprite(¤t_sprite);
sp_seq(¤t_sprite, 37);
sp_brain(¤t_sprite, 7);
playsound(6, 22050, 0,0,0);
int &str = 3;
&str * &spell_level-earth;
sp_strength(¤t_sprite, &str);
return;
}
Now this all works fine
The problem is, at level 5, the earth spike does this split, so it comes up, doing the damage, then it does another animation, doing another frame of damage. This almost works. With the brain as it is, and making the right frames special in the dink.ini, it hits with the frames I want only. However, the size of the hit is only the size of the first frame. The second hit I want to be bigger. In dink.ini, I've made the hardbox for that frame bigger. It looks bigger when I check in dinkedit. It still doesn't hit bigger, though.
What I've tried:
-sp_distance, it just doesn't seem to work.
-changing the brain to 17, using sp_range. now this almost works, I can change the size of the hit, but with that brain, it's just weird. I have to use void damage and if it doesn't hit anything (as I have it just come up at a random location if there is no enemy) it keeps looping, as the brain intends. Also, the first two frames hit for some odd reason. so this brain is just out.
I really can't think of any good meathods, except maybe waiting til after the first hit, changing the hardbox size of all the frames (or just setting them all to large except the first and hitting one) and having a wait and then redraw the sp hardbox... but I only want the middle part of the spike to actually be hard (as in you can't walk thru it)
Bah! So my real question: what are the specifications under which brains sp_distance and sp_range work, and can anyone think of a better meathod of doing this? I'll post the full spell scripts here, also:
mag-ear1.c
//magic earth
void use( void )
{ if (&mana_current < 1) { say("Not enough mana.", 1); return; }
int &10 = get_rand_sprite_with_this_brain(10, ¤t_sprite);
if (&10 > 0) { // freeze(&10); int &x = sp_x(&9, -1); int &y = sp_y(&9, -1); int &junk;
&y += 15;
&junk = create_sprite(&x, &y, 0, 36, 1); sp_script(&junk, "dam-earth");
} if (&10 == 0) { int &9 = get_rand_sprite_with_this_brain(9, ¤t_sprite);
if (&9 > 0) { //freeze(&9); int &x = sp_x(&9, -1); int &y = sp_y(&9, -1); int &junk;
&y += 15; &junk = create_sprite(&x, &y, 0, 36, 1); sp_script(&junk, "dam-earth");
} }
if (&10 == 0) { if (&9 == 0) { int &3 = get_rand_sprite_with_this_brain(3, ¤t_sprite);
if (&3 > 0) { //freeze(&3); int &x = sp_x(&3, -1); int &y = sp_y(&3, -1); int &junk;
&y += 15; &junk = create_sprite(&x, &y, 0, 36, 1); sp_script(&junk, "dam-earth");
} } }
if (&10 == 0) {
if (&9 == 0) {
if (&3 == 0) { int &4 = get_rand_sprite_with_this_brain(4, ¤t_sprite);
if (&4 > 0) { //freeze(&4); int &x = sp_x(&4, -1); int &y = sp_y(&4, -1); int &junk;
&y += 15; &junk = create_sprite(&x, &y, 0, 36, 1); sp_script(&junk, "dam-earth");
} } } } if (&10 == 0) {
if (&9 == 0) {
if (&3 == 0) {
if (&4 == 0)
{ int &16 = get_rand_sprite_with_this_brain(16, ¤t_sprite);
if (&16 > 0) { //freeze(&16); int &junk;
&y += 15; &junk = create_sprite(&x, &y, 0, 36, 1); sp_script(&junk, "dam-earth");
} } } } }
if (&10 == 0)
{
if (&9 == 0)
{
if (&3 == 0)
{
If (&4 == 0)
{
if (&16 == 0)
{
int &rand;
int &other; &rand = random(500, 1); &other = random(500, 1);
int &junk; &junk = create_sprite(&rand, &other, 0, 36, 1); sp_script(&junk, "dam-earth");
}
}
}
}
}
&mana_current -= 1;
&bleh = 25;
&bleh * &magic;
&magic_cost = &bleh;
&magic_level = 0;
draw_status();
wait(1355);
if(&spell_level-earth > 4)
{
wait(1085);
}
sp_hard(&junk, 1);
draw_hard_sprite(&junk);
//unfreeze(&10);
sp_target(&10, 1);
//unfreeze(&9);
sp_target(&9, 1);
//unfreeze(&3);
sp_target(&3, 1);
//unfreeze(&4);
sp_target(&4, 1);
//unfreeze(&16);
sp_target(&16, 1);
return;
}
void disarm(void)
{
kill_this_task();
}
void arm(void)
{
int &bleh = 25;
&bleh * &magic;
&magic_cost = &bleh;
&magic_level = 0;
}
void pickup(void)
{
}
void drop(void)
{
draw_status();
kill_this_task();
}
dam-earth.c
void main(void )
{
if (&spell_level-earth < 5)
{
sp_hard(¤t_sprite, 0);
draw_hard_sprite(¤t_sprite);
sp_seq(¤t_sprite, 36);
sp_brain(¤t_sprite, 7);
playsound(6, 22050, 0,0,0);
int &str = 5;
&str * &spell_level-earth;
sp_strength(¤t_sprite, &str);
return;
}
if (&spell_level-earth < 10)
{
sp_hard(¤t_sprite, 0);
draw_hard_sprite(¤t_sprite);
sp_seq(¤t_sprite, 37);
sp_brain(¤t_sprite, 7);
playsound(6, 22050, 0,0,0);
int &str = 3;
&str * &spell_level-earth;
sp_strength(¤t_sprite, &str);
return;
}
sp_hard(¤t_sprite, 0);
draw_hard_sprite(¤t_sprite);
sp_seq(¤t_sprite, 37);
sp_brain(¤t_sprite, 7);
playsound(6, 22050, 0,0,0);
int &str = 5;
&str * &spell_level-earth;
sp_strength(¤t_sprite, &str);
return;
}