The Dink Network

Reply to 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:42 PM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
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(&current_sprite,-1);
&dd-bary1 = sp_y(&current_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.