Attacking Knights
Does anyone know where some good scripts for the knights from the main game are? Ones that get them to attack?
The source scripts for the game are in source.zip in the develop directory. I dunno the names but the knights near King Daniel's castle attack you when you hit them, and his castle is somewhere in the middle of the map, so if you check that mapscreen in the editor, you've got the scriptnames and as such, the scripts
Yeah, but I want ones that act like enemies by default, not just when you attack them, but I'll look into it to see if I can edit them to act as such. I should of thought of that myself actually. I've already taken end edited quite a few scripts from the source for the game.
i have a sample script for an enemy knight in my dev file rabidwolf9's dev toychest
Okay, thanks, I'll look into that too. I hope it's too my liking.
you'll have to change the base_walk and base_hit though
270 - red walk
280 - blue walk
290 - silver walk
300 - gold walk
710 - red attack
720 - silver attack
730 - blue attack
740 - gold attack
270 - red walk
280 - blue walk
290 - silver walk
300 - gold walk
710 - red attack
720 - silver attack
730 - blue attack
740 - gold attack
I just looked into it and it's not really what I'm looking for. It's mainly that I don't like the colour of the knights.
You realise you can easily fix that by changing the preload_seq, sp_base_walk and sp_base_attack to the values rabidwolf9 listed in the post you answered to?
this should work for a red knight from dink(if you wanted a different color, all you have to do is change a couple of numbers):
void main( void )
{
int &mcounter;
sp_brain(¤t_sprite, 9);
sp_speed(¤t_sprite, 2);
sp_distance(¤t_sprite, 60);
sp_timing(¤t_sprite, 33);
sp_exp(¤t_sprite, 30);
sp_base_walk(¤t_sprite, 270);
sp_base_death(¤t_sprite, -1);
sp_base_attack(¤t_sprite, 710);
sp_defense(¤t_sprite, 10);
sp_strength(¤t_sprite, 10);
sp_touch_damage(¤t_sprite, 1);
sp_hitpoints(¤t_sprite, 100);
preload_seq(271);
preload_seq(273);
preload_seq(275);
preload_seq(277);
preload_seq(279);
preload_seq(712);
preload_seq(714);
preload_seq(716);
preload_seq(718);
}
void hit( void )
{
playsound(29, 22050,0,¤t_sprite, 0);
sp_target(¤t_sprite, &enemy_sprite);
}
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");
}
void attack( void )
{
playsound(36, 22050,0,¤t_sprite, 0);
&mcounter = random(4000,0);
sp_attack_wait(¤t_sprite, &mcounter);
}
void main( void )
{
int &mcounter;
sp_brain(¤t_sprite, 9);
sp_speed(¤t_sprite, 2);
sp_distance(¤t_sprite, 60);
sp_timing(¤t_sprite, 33);
sp_exp(¤t_sprite, 30);
sp_base_walk(¤t_sprite, 270);
sp_base_death(¤t_sprite, -1);
sp_base_attack(¤t_sprite, 710);
sp_defense(¤t_sprite, 10);
sp_strength(¤t_sprite, 10);
sp_touch_damage(¤t_sprite, 1);
sp_hitpoints(¤t_sprite, 100);
preload_seq(271);
preload_seq(273);
preload_seq(275);
preload_seq(277);
preload_seq(279);
preload_seq(712);
preload_seq(714);
preload_seq(716);
preload_seq(718);
}
void hit( void )
{
playsound(29, 22050,0,¤t_sprite, 0);
sp_target(¤t_sprite, &enemy_sprite);
}
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");
}
void attack( void )
{
playsound(36, 22050,0,¤t_sprite, 0);
&mcounter = random(4000,0);
sp_attack_wait(¤t_sprite, &mcounter);
}
Ok, thankyou, I'll use an edited version of that (one with the stats as I want them to be). You've saved me a lot of hassle. Thankyou.