Reply to Custom procedures
If you don't have an account, just leave the password field blank.
Looking at these and getting my head around such things as local variables scope is excluded in custom procedures unless variable is defined in that exact procedure, plus the availability of &arg1 thru to &arg9 as parameters that can be passed to a custom procedure - you can only return a single integer value, right?
And if you use set_callback_random("procedure", xxx, yyyy); on a custom procedure you have to activate its own callback at the end of the procedure code, if you want it called again after the last call.
Although is "void target (void)" as used in the original en-drag.c a custom or a Dink Engine predefined procedure? As this doesn't call on itself at the end.
And if you use set_callback_random("procedure", xxx, yyyy); on a custom procedure you have to activate its own callback at the end of the procedure code, if you want it called again after the last call.
Although is "void target (void)" as used in the original en-drag.c a custom or a Dink Engine predefined procedure? As this doesn't call on itself at the end.
void main( void ) { int &fsave_x; int &kcrap; int &fsave_y; int &resist; int &mcounter; int &mtarget; screenlock(1); sp_brain(¤t_sprite, 10); sp_timing(¤t_sprite, 66); sp_speed(¤t_sprite, 1); sp_nohit(¤t_sprite, 0); sp_exp(¤t_sprite, 400); sp_base_walk(¤t_sprite, 200); sp_base_death(¤t_sprite, 210); sp_touch_damage(¤t_sprite, 10); sp_hitpoints(¤t_sprite, 80); sp_defense(¤t_sprite, 8); preload_seq(202); preload_seq(204); preload_seq(206); preload_seq(208); preload_Seq(70); preload_Seq(166); set_callback_random("target",500,2000); } void target( void ) { //get new target &kcrap = random(9, 1); if (&life < 1) &kcrap = 2; if (&kcrap == 1) { sp_target(¤t_sprite, 1); return; } &mtarget = get_sprite_with_this_brain(16, ¤t_sprite); if (&mtarget > 0) { &mtarget = get_rand_sprite_with_this_brain(16, ¤t_sprite); sp_target(¤t_sprite, &mtarget); } }