Reply to Problems with two scripts
If you don't have an account, just leave the password field blank.
I've been struggling with these two scripts for a while now, and I just can't seem to get to my head what is wrong with them, I've tried everything. The problems are probably very simple, which I've just fail to notice.
In this first script, when &story is over 31, I go and talk to the character. It works fine, but after the conversation the script either jumps into the part after result 2, or the part which I've marked. Here's the script:
The other problem I have is with a knight enemy script. I've tried everything, but always when the knight dies, instead of showing the death graphic, the sprite just disappears. Here's the whole script:
Can anybody help me with these. I'm totally lost.
In this first script, when &story is over 31, I go and talk to the character. It works fine, but after the conversation the script either jumps into the part after result 2, or the part which I've marked. Here's the script:
void talk(void) { if (&story > 31) { //dialog } if (&story < 31) { //dialog plus options } if (&result == 1) { //dialog } if (&result == 2) { //dialog, this is where it sometimes jumps } //dialog, sometimes it jumps here }
The other problem I have is with a knight enemy script. I've tried everything, but always when the knight dies, instead of showing the death graphic, the sprite just disappears. Here's the whole script:
void main( void ) { screenlock(1); int &mcounter; sp_brain(¤t_sprite, 9); sp_speed(¤t_sprite, 4); sp_exp(¤t_sprite, 0); sp_distance(¤t_sprite, 50); sp_range(¤t_sprite, 35); sp_defense(¤t_sprite, 5); sp_strength(¤t_sprite, 17); sp_touch_damage(¤t_sprite, 15); sp_hitpoints(¤t_sprite, 50); sp_target(¤t_sprite, 1); sp_base_death(¤t_sprite, 295); sp_base_attack(¤t_sprite, 730); sp_base_walk(¤t_sprite, 280); preload_seq(742); preload_seq(744); preload_seq(746); preload_seq(748); preload_seq(301); preload_seq(303); preload_seq(307); preload_seq(309); //preload_seq(349); playmidi("40.mid"); } void hit( void ) { //playsound(29, 22050,0,¤t_sprite, 0); sp_target(¤t_sprite, 1); } void die( void ) { int &hold = sp_editor_num(¤t_sprite); if (&hold != 0) editor_type(&hold, 1); &save_x = sp_x(¤t_sprite, -1); &save_y = sp_y(¤t_sprite, -1); if (get_sprite_with_this_brain(9, ¤t_sprite) == 0) { //no more brain 9 monsters here, lets unlock the screen screenlock(0); stopmidi("40.mid"); spawn("s4-afterto"); } void attack( void ) { playsound(8, 5050,0,¤t_sprite, 0); &mcounter = random(4000,0); sp_attack_wait(¤t_sprite, &mcounter); }
Can anybody help me with these. I'm totally lost.
