The Dink Network

monster

August 23rd 2006, 11:51 PM
duck.gif
maacks
Peasant He/Him
 
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(&current_sprite, 9);
sp_speed(&current_sprite, 1);
sp_distance(&current_sprite, 60);
sp_range(&current_sprite, 45);
sp_frame_delay(&current_sprite, 45);
sp_timing(&current_sprite, 0);
sp_exp(&current_sprite, 200);
sp_base_walk(&current_sprite, 640);
//sp_base_death(&current_sprite, 680);
sp_base_attack(&current_sprite, 630);
sp_defense(&current_sprite, 5);
sp_strength(&current_sprite, 20);
sp_touch_damage(&current_sprite, 10);
sp_hitpoints(&current_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(&current_sprite, 1);
screenlock(1);
}

void die( void )
{ screenlock(1); playmidi("20.mid"); int &hold = sp_editor_num(&current_sprite); if (&hold != 0) editor_type(&hold, 6);
&save_x = sp_x(&current_sprite, -1);
&save_y = sp_y(&current_sprite, -1);
external("emake","xlarge");
}
void attack( void )
{
playsound(27, 22050,0,&current_sprite, 0);
&mcounter = random(4000,0);
sp_attack_wait(&current_sprite, &mcounter);
}
August 24th 2006, 12:22 AM
wizardg.gif
slayer4990
Peasant He/Him Canada
Foppery and Whim! 
you didn't put "screenlock(0);" anywhere
August 24th 2006, 12:25 AM
girl.gif
joshriot
Peasant They/Them United States
keep it real 
please please please style your scripts
August 24th 2006, 12:32 AM
duck.gif
maacks
Peasant He/Him
 
but it doesn't play the midi
void die( void )
{
screenlock(0);
playmidi("20.mid");
int &hold = sp_editor_num(&current_sprite);
if (&hold != 0)
editor_type(&hold, 6);
&save_x = sp_x(&current_sprite, -1);
&save_y = sp_y(&current_sprite, -1);
external("emake","xlarge");
}
August 24th 2006, 04:29 PM
slimeb.gif
DaVince
Peasant He/Him Netherlands
Olde Time Dinkere 
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.
August 24th 2006, 04:55 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
external("that_script","main");

or just spawn("that_script");

in the second case, make sure the main() procedure ends with kill_this_task();
August 24th 2006, 05:03 PM
slimeb.gif
DaVince
Peasant He/Him Netherlands
Olde Time Dinkere 
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.
August 24th 2006, 05:18 PM
death.gif
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...
August 24th 2006, 05:54 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
BoE has non-unlocking screens?
August 24th 2006, 06:24 PM
death.gif
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.
August 24th 2006, 06:47 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
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...
August 25th 2006, 12:28 AM
duck.gif
maacks
Peasant He/Him
 
I've fixed it. The problem was extremely simple. I misspelled the script it was supposed to attach to.