The Dink Network

Reply to Re: Spawning a Monster From a Barrel

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
September 30th 2007, 08:50 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
Maybe it would be easier to modify the make.c script and spawn the monster the same way normal barrels spawn hearts and such. All you would have to do is make a new procedure in it.

Instead of copying from the empty barrel script, you probably should've looked at a barrel script that actually spawns an item. I've made some sample script for what you're trying to accomplish. BTW in the barrel hit script I only modified the procedure name of the external script and cut out the comments.

//hit procedure for barrel script
void hit ( void )
{
playsound(37, 22050, 0,0,0);
int &hold = sp_editor_num(&current_sprite);

if (&hold != 0)
{
editor_type(&hold, 3);
editor_seq(&hold, 173);
editor_frame(&hold, 6);
}
sp_seq(&current_sprite, 173);
sp_brain(&current_sprite, 5);
sp_notouch(&current_sprite, 1);
sp_nohit(&current_sprite, 1);

&save_x = sp_x(&current_sprite, -1);
&save_y = sp_y(&current_sprite, -1);
external("make", "wbonc");

sp_hard(&current_sprite, 1);
draw_hard_sprite(&current_sprite);
kill_this_task();
}

//new procedure for make.c
void wbonc( void )
{
int &mcrap = random(1,5);
if (&mcrap == 1)
{
int &bonc = create_sprite(&save_x,&&save_y,9,533,1);
sp_script(&bonc,"en-bonc");
}
}