sprite motion help!!!
I'm having a problem with my windinkedit or so i believe. the sprites that i add, say an enemy knight that is supposed to say something, screenlock, and start attacking me only plays the walking sequence and stays in his place! this goes for any other sprite i try to put, they look like they're walking but they're not moving from their place. do u know what seems to be the problem?
It's easy...First give him Base_Walk(If you have a plus version press Auto) then give him Brain 16 and finally a script.
It's possible that you have the hardness set to 0. Set it to 1.
I've got that kind of script. Just make this a script:
====
void main(void)
{
int &knight = create_sprite(640, 0, 0, 290, 1);
freeze(&knight);
sp_dir(&knight, 1);
sp_base_walk(&knight, 290);
sp_speed(&knight, 2);
sp_target(&knight, 1);
wait(200);
say_stop("`7Bla bla bla bla bla bla bla.", &knight);
wait(200);
stopmidi();
playmidi("(mid).mid");
sp_script(&knight, "knight");
screenlock(1);
unfreeze(1);
unfreeze(&knight);
}
====
Then attach it to some inanimate object. You won't need the knight sprite(heh, rhymes!) for this script. Then you put this in the knight script:
====
/Normal soldier(quite easy)
void main( void )
{
screenlock(1);
int &mcounter;
sp_brain(¤t_sprite, 9);
sp_speed(¤t_sprite, 2);
sp_distance(¤t_sprite, 40);
sp_timing(¤t_sprite, 33);
sp_exp(¤t_sprite, 60);
sp_base_walk(¤t_sprite, 290);
sp_base_attack(¤t_sprite, 720);
sp_defense(¤t_sprite, 1);
sp_strength(¤t_sprite, 8);
sp_touch_damage(¤t_sprite, 2);
sp_hitpoints(¤t_sprite, 40);
sp_target(¤t_sprite, 1);
preload_seq(291);
preload_seq(293);
preload_seq(295);
preload_seq(297);
preload_seq(299);
preload_seq(722);
preload_seq(724);
preload_seq(726);
preload_seq(728);
}
void hit( void )
{
say("`7Why you little...", ¤t_sprite);
sp_target(¤t_sprite, &enemy_sprite);
//lock on to the guy who just hit us
//playsound
}
void die( void )
{
int &hold = sp_editor_num(¤t_sprite);
if (&hold != 0)
editor_type(&hold, 6);
&save_x = sp_x(¤t_sprite, -1);
&save_y = sp_y(¤t_sprite, -1);
external("emake","medium");
if (get_sprite_with_this_brain(9, ¤t_sprite) == 0)
{
screenlock(0);
}
}
void attack( void )
{
playsound(8,8000,0,¤t_sprite,0);
say("`7DIE!!", ¤t_sprite);
&mcounter = random(4000,0);
sp_attack_wait(¤t_sprite, &mcounter);
}
====
You can customise it a bit if you want.
====
void main(void)
{
int &knight = create_sprite(640, 0, 0, 290, 1);
freeze(&knight);
sp_dir(&knight, 1);
sp_base_walk(&knight, 290);
sp_speed(&knight, 2);
sp_target(&knight, 1);
wait(200);
say_stop("`7Bla bla bla bla bla bla bla.", &knight);
wait(200);
stopmidi();
playmidi("(mid).mid");
sp_script(&knight, "knight");
screenlock(1);
unfreeze(1);
unfreeze(&knight);
}
====
Then attach it to some inanimate object. You won't need the knight sprite(heh, rhymes!) for this script. Then you put this in the knight script:
====
/Normal soldier(quite easy)
void main( void )
{
screenlock(1);
int &mcounter;
sp_brain(¤t_sprite, 9);
sp_speed(¤t_sprite, 2);
sp_distance(¤t_sprite, 40);
sp_timing(¤t_sprite, 33);
sp_exp(¤t_sprite, 60);
sp_base_walk(¤t_sprite, 290);
sp_base_attack(¤t_sprite, 720);
sp_defense(¤t_sprite, 1);
sp_strength(¤t_sprite, 8);
sp_touch_damage(¤t_sprite, 2);
sp_hitpoints(¤t_sprite, 40);
sp_target(¤t_sprite, 1);
preload_seq(291);
preload_seq(293);
preload_seq(295);
preload_seq(297);
preload_seq(299);
preload_seq(722);
preload_seq(724);
preload_seq(726);
preload_seq(728);
}
void hit( void )
{
say("`7Why you little...", ¤t_sprite);
sp_target(¤t_sprite, &enemy_sprite);
//lock on to the guy who just hit us
//playsound
}
void die( void )
{
int &hold = sp_editor_num(¤t_sprite);
if (&hold != 0)
editor_type(&hold, 6);
&save_x = sp_x(¤t_sprite, -1);
&save_y = sp_y(¤t_sprite, -1);
external("emake","medium");
if (get_sprite_with_this_brain(9, ¤t_sprite) == 0)
{
screenlock(0);
}
}
void attack( void )
{
playsound(8,8000,0,¤t_sprite,0);
say("`7DIE!!", ¤t_sprite);
&mcounter = random(4000,0);
sp_attack_wait(¤t_sprite, &mcounter);
}
====
You can customise it a bit if you want.
The important question is: Has the knight got a speed value higher than 0? It needs at least a value of 1 to move.










