Reply to Re: platform dink trouble
If you don't have an account, just leave the password field blank.
Ok, here we go.
Open start-1.c and find the lines:
change them to:
But don't change anything else.
Now open your gravity.c and remove everything inside. Instead add this to the script script:
Now we have to make a new script for the fists so add a script with the name item-fst.c. Enter the following code in this script,:
Now you are ready to hit with your platform dink, but you still might want to replace the graphics, if you do make a dmod with this and can't make graphics yourself I might do it for you, just send me an email.
Open start-1.c and find the lines:
//add_item("item-fst",438, 1); //&cur_weapon = 1; //arm_weapon();
change them to:
add_item("item-fst",438, 1); &cur_weapon = 1; arm_weapon();
But don't change anything else.
Now open your gravity.c and remove everything inside. Instead add this to the script script:
void main(void) { sp_dir(1, 6); &jump = 0; sp_nodraw(¤t_sprite, 1); int &crap; gravity: &crap = sp_y(1, -1); &crap += 8; sp_y(1, &crap); &crap = sp_y(1, -1); If(&crap > 390) { say("Ahhhh", 1); dink_can_walk_off_screen(1); &life = 0; } wait(10); goto gravity; }
Now we have to make a new script for the fists so add a script with the name item-fst.c. Enter the following code in this script,:
//item fists void use( void ) { //disallow diagonal punches &basehit = sp_dir(1, -1); if (&basehit == 1) &basehit = 4; if (&basehit == 2) &basehit = 6; if (&basehit == 3) &basehit = 6; if (&basehit == 7) &basehit = 4; if (&basehit == 8) &basehit = 4; if (&basehit == 9) &basehit = 6; sp_dir(1, &basehit); &basehit += 100; //100 is the 'base' for the hit animations, we just add say &basehit //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(1); playsound(8, 8000,0,0,0); &basehit -= 100; } void disarm(void) { debug("Killed fists"); kill_this_task(); } void arm(void) { sp_attack_hit_sound(1, 0); debug("fists armed"); int &basehit; } void pickup(void) { Debug("Player now owns this item."); kill_this_task(); } void drop(void) { Debug("Item dropped."); kill_this_task(); }
Now you are ready to hit with your platform dink, but you still might want to replace the graphics, if you do make a dmod with this and can't make graphics yourself I might do it for you, just send me an email.