Problem with hitting
I borrowed the Dink boss script from Cloud Castle 2 and changed it into Dark Dink. I also changed the sword into plain fist. After some fiddling, it's working almost perfectly. However, whenever Dark Dink tries to punch me, he always misses. He might punch around a hundred times and should definitely hit me, but however, he never does, and I can't figure out why. No sound, no blood, no damage, absolutely nothing happens when he punches around. Can anybody help me with this, cause I can't see what's wrong with it. Here's the script:
// Dark Dink void main( void ) { screenlock(1); playmidi("4.mid"); int &mcounter; int &junk; sp_base_walk(¤t_sprite, 940); sp_brain(¤t_sprite, 9); sp_timing(¤t_sprite, 1); sp_speed(¤t_sprite, 2); sp_hitpoints(¤t_sprite, 2000); sp_touch_damage(¤t_sprite, 10); sp_strength(¤t_sprite, 15); SP_DEFENSE(¤t_sprite, 5); sp_base_attack(¤t_sprite, 950); sp_distance(¤t_sprite, 70); sp_range(¤t_sprite, 60); sp_target(¤t_sprite, 1); sp_exp(¤t_sprite, 0); int &dinkx; int &dinky; int &knitx; int &knity; int &diff; int &delay = 8000; loop: wait(100); &delay -= 100; if (&delay > 0) goto loop; &delay = 8000; &junk = random(500, 500); wait(&junk); if (&life < 1) goto loop; &dinkx = sp_x(¤t_sprite, -1); &dinky = sp_y(¤t_sprite, -1); &knitx = sp_x(1, -1); &knity = sp_y(1, -1); &junk = 0; &diff = &dinky; &diff -= &knity; if (&diff < 0) &diff *= -1; if (&diff < 50) { if (&knitx > &dinkx> { freeze(¤t_sprite); sp_seq(¤t_sprite, 966); sp_frame(¤t_sprite, 1); sp_kill_wait(¤t_sprite); sp_nocontrol(¤t_sprite, 1); wait(100); unfreeze(¤t_sprite); &dinkx += 30; &junk = create_sprite(&dinkx, &dinky, 11, 516, 1); sp_seq(&junk, 506); sp_dir(&junk, 6); } else { freeze(¤t_sprite); sp_seq(¤t_sprite, 964); sp_frame(¤t_sprite, 1); sp_kill_wait(¤t_sprite); sp_nocontrol(¤t_sprite, 1); wait(100); unfreeze(¤t_sprite); &dinkx -= 30; &junk = create_sprite(&dinkx, &dinky, 11, 514, 1); sp_seq(&junk, 504); sp_dir(&junk, 4); } } if (&junk < 1) { &diff = &dinkx; &diff -= &knitx; if (&diff < 0) &diff *= -1; if (&diff < 50) { if (&knity > &dinky> { freeze(¤t_sprite); sp_seq(¤t_sprite, 962); sp_frame(¤t_sprite, 1); sp_kill_wait(¤t_sprite); sp_nocontrol(¤t_sprite, 1); wait(100); unfreeze(¤t_sprite); &junk = create_sprite(&dinkx, &dinky, 11, 512, 1); sp_seq(&junk, 502); sp_dir(&junk, 2); } else { freeze(¤t_sprite); sp_seq(¤t_sprite, 968); sp_frame(¤t_sprite, 1); sp_kill_wait(¤t_sprite); sp_nocontrol(¤t_sprite, 1); wait(100); unfreeze(¤t_sprite); &junk = create_sprite(&dinkx, &dinky, 11, 518, 1); sp_seq(&junk, 508); sp_dir(&junk, 8); } } } if (&junk > 0) { playsound(17, 8000, 0, &junk ,0); sp_timing(&junk, 0); sp_speed(&junk, 6); sp_strength(&junk, 20); sp_flying(&junk, 1); sp_range(&junk, 20); sp_script(&junk, "dam-sfb"); &mshadow = create_sprite(&mholdx, &mholdy, 15, 432, 3); sp_brain_parm(&mshadow, &junk); sp_que(&mshadow, -500); sp_nohit(&mshadow, 1); sp_brain_parm(&junk, ¤t_sprite); wait(500); } goto loop; } void hit( void ) { oneloop: int &klife = sp_hitpoints (¤t_sprite, -1); if (&klife < 1401) { freeze(1); freeze(¤t_sprite); sp_touch_damage(¤t_sprite, -1); move_stop(¤t_sprite, 8, 150, 1); move_stop(¤t_sprite, 2, 150, 1); move_stop(¤t_sprite, 4, 170, 1); move_stop(¤t_sprite, 6, 170, 1); sp_dir(¤t_sprite, 6); say_stop("`%This isn't over!", ¤t_sprite); wait(500); int &flame = create_sprite(170, 150, 7, 167, 1); sp_seq(&flame, 167); playsound(24, 22052, 0, 0, 0); int &flame = create_sprite(170, 150, 7, 167, 1); sp_seq(&flame, 167); playsound(24, 22052, 0, 0, 0); //remove rocks hardness and sprite sp_hard(¤t_sprite, 1); draw_hard_map(¤t_sprite); sp_active(¤t_sprite, 0); int &hold = sp_editor_num(¤t_sprite); if (&hold != 0) { //this was placed by the editor, lets make it not come back editor_type(&hold, 1); //kill food forever } //remove the cracks as well, as they would look silly now sp_dir(1, 2); say_stop("You can bet it ain't!", 1); wait(1500); say_stop("What was that all about?", 1); wait(1500); say_stop("Anyway, I gotta get to those blue knights and rescue Libby!", 1); wait(500); say_stop("I hope the word has spread about me rescuing the girls", 1); say_stop("so that the guard will let me see the king.", 1); &events = 4; &exp += 200; say("`%200 EXP GAINED", 1); screenlock(0); unfreeze(1); } else { playmidi("4.mid"); goto mainloop; } } void attack( void ) { playsound(8, 8000, 0, 0, 0); &mcounter = random(4000,0); sp_attack_wait(¤t_sprite, &mcounter); goto loop; }
You need to add some lines in the dink.ini file otherwise it will not work.
set_frame_special x y z
I think it is
set_frame_special x y z
I think it is
Sounds like you didn't specify an attack frame in the Dink.ini file
EDIT: I was beaten to it

EDIT: I was beaten to it


I've added all the lines that needed in dink.ini. Well, all that I can think of that are needed. It would help me if you told me what exact lines were you thinking of.
set_frame_special 542 5 1 set_frame_special 544 5 1 set_frame_special 546 5 1 set_frame_special 548 5 1
These are the lines for the bonca attack frames. They specify that frame 5 is the frame that deals damage.
Another strange thing is that:
goto mainloop;
and there is no label mainloop, but a oneloop label.
goto mainloop;
and there is no label mainloop, but a oneloop label.
I wish I could've helped

One more thing. You have a loop in your main procedure with a wait in it, which will be terminated once the sprite is hit by Dink. To circumvent this, use the code inside another script and reference it with external().
Great, it works now. Thanks guys.
Kyle, that was part of the script that I borrowed from CC2, so I didn't bother to change it. Plus, it works perectly, so I'm not gonna screw with the script any more cause, quite frankly, I had helluva lot of problems with it.
Kyle, that was part of the script that I borrowed from CC2, so I didn't bother to change it. Plus, it works perectly, so I'm not gonna screw with the script any more cause, quite frankly, I had helluva lot of problems with it.
Is this sprite supposed to shoot stuff? Try hitting the sprite and see if it stops shooting.
The last part in void hit() should probably be goto loop, instead of goto mainloop... The dude will indeed stop shooting as soon as Dink hits him otherwise. (However, he starts shooting again after void attack() runs, because that procedure correctly has it as goto loop.
)
