Reply to Spawning a Monster From a Barrel
If you don't have an account, just leave the password field blank.
Yep, that's right. Another question. What I want to do, is have Dink punch a barrel, and a monster spawns from it. I just got the barrel script bar-e.c and copy & pasted everything from it, into my new script. Then before kill_this_task();, I have my monster spawn bit. This is how it goes:
// main.c excerpt
make_global_int("&dd-barx1",0);
make_global_int("&dd-barx2",0);
make_global_int("&dd-barx3",0);
make_global_int("&dd-bary1",0);
make_global_int("&dd-bary2",0);
make_global_int("&dd-bary3",0);
// script excerpt
if (&rand == 1)
{
// Bad barrel
// Save X and Y coordinates for monster spawn
&dd-barx1 = sp_x(¤t_sprite,-1);
&dd-bary1 = sp_y(¤t_sprite,-1);
// Monster spawn
// Weak monster: Bonca
int &bonc = create_sprite(&dd-barx1,&dd-bary1,9,533,1);
sp_script(&bonc,"en-bonc");
}
I think I might be doing the "Save X and Y corrdinates" bit wrong. But I'm not sure.
// main.c excerpt
make_global_int("&dd-barx1",0);
make_global_int("&dd-barx2",0);
make_global_int("&dd-barx3",0);
make_global_int("&dd-bary1",0);
make_global_int("&dd-bary2",0);
make_global_int("&dd-bary3",0);
// script excerpt
if (&rand == 1)
{
// Bad barrel
// Save X and Y coordinates for monster spawn
&dd-barx1 = sp_x(¤t_sprite,-1);
&dd-bary1 = sp_y(¤t_sprite,-1);
// Monster spawn
// Weak monster: Bonca
int &bonc = create_sprite(&dd-barx1,&dd-bary1,9,533,1);
sp_script(&bonc,"en-bonc");
}
I think I might be doing the "Save X and Y corrdinates" bit wrong. But I'm not sure.