Miner Pick Problem!
//Pick void use( void ) { //disallow diagonal punches if (sp_dir(1, -1) == 1) sp_dir(1, 2); if (sp_dir(1, -1) == 3) sp_dir(1, 2); if (sp_dir(1, -1) == 7) sp_dir(1, 8); if (sp_dir(1, -1) == 9) sp_dir(1, 8); &basehit = sp_dir(1, -1); &basehit += 100; //100 is the 'base' for the hit animations, we just add //the direction 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! wait(200); playsound(8, 8000,0,0,0); } void disarm(void) { sp_attack_hit_sound(1, 0); &strength -= 2; if (&picktr == 1) { &strength -= 7; } sp_distance(1, 0); sp_range(1, 0); kill_this_task(); } void arm(void) { set_dink_speed(3); //sword range sp_distance(1, 60); sp_range(1, 40); //strength added &strength += 3; if (&picktr == 1) { &strength += 7; } sp_attack_hit_sound(1, 10); sp_attack_hit_sound_speed(1, 8000); } void pickup(void) { Debug("Player now owns this item."); kill_this_task(); } void drop(void) { Debug("Item dropped."); kill_this_task(); }
When i try to punch with it, it crashes!
Did you replace the sound effect? I've been having a million problems with those lately including crashes. If it's a new one, try replacing it with an existing one to see if that's what's causing the problem.
Also, nowhere have you initialized &basehit. It's usually done in the arm() procedure, but you forgot to add that. That might also be what's causing you trouble.
Also, nowhere have you initialized &basehit. It's usually done in the arm() procedure, but you forgot to add that. That might also be what's causing you trouble.