The Dink Network

Reply to Re: sp_custom

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:
 
 
March 1st 2008, 09:20 PM
dinkdead.gif
No luck. So what've I got wrong, the maths or the scripting? Or both?

After they're killed, when I enter the screen they're all at roughly x,y 90,325 and all sequence 143.

Here's what I've done:
void main (void)
{
//extracting
int &ed_num = sp_editor_num(&current_sprite);
int &temp = editor_seq(&ed_num, -1);
int &temp2 = editor_frame(&ed_num, -1);
if (&temp)
{
&temp2 * 65535;
&temp += &temp2;
&temp2 = &temp;
&temp / 801;
sp_x(&current_sprite, &temp);
&temp2 = math_mod(&temp2, 801);
&temp = &temp2;
&temp / 2;
sp_y(&current_sprite, &temp);
&temp = math_mod(&temp2, 2);
if (&temp)
sp_seq(&current_sprite, 141);
else
sp_seq(&current_sprite, 143);
sp_brain(&current_sprite, 5);
kill_this_task();
}
//rest of script
}

spawned script:
void main (void)
{
//global &sprite = &current_sprite
//sprite dies with hurt()

//storing:
int &ed_num = sp_editor_num(&sprite);
int &temp = sp_pseq(&sprite, -1);
if (&temp == 141)
{
&temp = 1;
}
if (&temp == 143)
{
&temp = 0;
}
int &temp2 = sp_y(&sprite, -1);
&temp2 * 2;
&temp += &temp2;
&temp2 = sp_x(&sprite, -1);
&temp2 * 801;
&temp += &temp2;
&temp2 = math_mod(&temp, 65535);
editor_seq(&ed_num, &temp2);
&temp / 65535;
editor_frame(&ed_num, &temp);
kill_this_task();
}

I would store it in the die procedure but that doesn't seem to run when the sprite's killed with hurt().

Oh and thanks Phoenix, it did