monster
when i kill this monster, it is supposed to play a new midi, and unlock the screen. It doesn't. What am I doing wrong?
void main( void )
{
int &mcounter;
sp_brain(¤t_sprite, 9);
sp_speed(¤t_sprite, 1);
sp_distance(¤t_sprite, 60);
sp_range(¤t_sprite, 45);
sp_frame_delay(¤t_sprite, 45);
sp_timing(¤t_sprite, 0);
sp_exp(¤t_sprite, 200);
sp_base_walk(¤t_sprite, 640);
//sp_base_death(¤t_sprite, 680);
sp_base_attack(¤t_sprite, 630);
sp_defense(¤t_sprite, 5);
sp_strength(¤t_sprite, 20);
sp_touch_damage(¤t_sprite, 10);
sp_hitpoints(¤t_sprite, 100);
preload_seq(632);
preload_seq(634);
preload_seq(636);
preload_seq(638);
preload_seq(641);
preload_seq(643);
preload_seq(647);
preload_seq(649);
sp_target(¤t_sprite, 1);
screenlock(1);
}
void die( void )
{ screenlock(1); playmidi("20.mid"); 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","xlarge");
}
void attack( void )
{
playsound(27, 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, 1);
sp_distance(¤t_sprite, 60);
sp_range(¤t_sprite, 45);
sp_frame_delay(¤t_sprite, 45);
sp_timing(¤t_sprite, 0);
sp_exp(¤t_sprite, 200);
sp_base_walk(¤t_sprite, 640);
//sp_base_death(¤t_sprite, 680);
sp_base_attack(¤t_sprite, 630);
sp_defense(¤t_sprite, 5);
sp_strength(¤t_sprite, 20);
sp_touch_damage(¤t_sprite, 10);
sp_hitpoints(¤t_sprite, 100);
preload_seq(632);
preload_seq(634);
preload_seq(636);
preload_seq(638);
preload_seq(641);
preload_seq(643);
preload_seq(647);
preload_seq(649);
sp_target(¤t_sprite, 1);
screenlock(1);
}
void die( void )
{ screenlock(1); playmidi("20.mid"); 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","xlarge");
}
void attack( void )
{
playsound(27, 22050,0,¤t_sprite, 0);
&mcounter = random(4000,0);
sp_attack_wait(¤t_sprite, &mcounter);
}
you didn't put "screenlock(0);" anywhere
but it doesn't play the midi
void die( void )
{
screenlock(0);
playmidi("20.mid");
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","xlarge");
}
void die( void )
{
screenlock(0);
playmidi("20.mid");
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","xlarge");
}
Does the enemy leave an item behind afterwards? Because that is what external("emake","xlarge"); normally does. If it doesn't, the sprite dies before it can execute the full die() procedure. To solve this, make a new script, put all the stuff that is in this void die() in it (but in a void main), and then put external("that_script"); as the only command in this die procedure.
external("that_script","main");
or just spawn("that_script");
in the second case, make sure the main() procedure ends with kill_this_task();
or just spawn("that_script");
in the second case, make sure the main() procedure ends with kill_this_task();
Oh yeah, I forgot "main" there.
Also note that you put the filename of that external file in the place of that_script, of course.
![](/images/emoticons/blank.gif)
Also note that you put the filename of that external file in the place of that_script, of course.
Just as a note, I find it helpful to simply steal the boss scripts from the source code and rework them to be whatever monster you want. The play_midi function should work correctly if the _die procedure is done correctly...
As noted, there is no screenlock (0); in this script... may I safely conclude that the screenlock command is attached to the actual screen then? If so, make sure that it is scripted correctly... I just cannot think of anything worse than a permanent screenlock in the middle of a D-Mod... drives me nuts when I try to play through them... Try Beginning of Evil- if you need proof of the importance of unlocking screens...
As noted, there is no screenlock (0); in this script... may I safely conclude that the screenlock command is attached to the actual screen then? If so, make sure that it is scripted correctly... I just cannot think of anything worse than a permanent screenlock in the middle of a D-Mod... drives me nuts when I try to play through them... Try Beginning of Evil- if you need proof of the importance of unlocking screens...
Yeah, at the fountain. But i found that you can just skip past the fountain part and attack the clerics- druids.
EDIT: I have not played it recently, so this might have been fixed, I don't know.
EDIT: I have not played it recently, so this might have been fixed, I don't know.
There are two fountains. The other fountain (which isn't guarded) won't give you much of a fighting chance later in the game.
Sigh... that part has to be the most buggy part in the whole game. Well... shared first place with the pillbug guy, though I think 1.08 fixes parts of this. Variable bleeding, name troubles, etc...
Sigh... that part has to be the most buggy part in the whole game. Well... shared first place with the pillbug guy, though I think 1.08 fixes parts of this. Variable bleeding, name troubles, etc...