Problems with two scripts
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.

In the first one, it looks like you may have a stray } after "dialog plus options".
In the second one, try removing the sp_base_death line. Sprites should automatically use base_walk+5 for a death graphic if no other is specified. Unfortunately the blue knight is missing a death graphic in some versions of Dink. It looks like you were trying to compensate for that, but a better way would be to add this your d-mods's dink.ini file:
In the second one, try removing the sp_base_death line. Sprites should automatically use base_walk+5 for a death graphic if no other is specified. Unfortunately the blue knight is missing a death graphic in some versions of Dink. It looks like you were trying to compensate for that, but a better way would be to add this your d-mods's dink.ini file:
load_sequence graphics\people\knight\silver\death- 285 100 58 84 -27 -11 27 11