Reply to Re: sp_custom
If you don't have an account, just leave the password field blank.
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(¤t_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(¤t_sprite, &temp);
&temp2 = math_mod(&temp2, 801);
&temp = &temp2;
&temp / 2;
sp_y(¤t_sprite, &temp);
&temp = math_mod(&temp2, 2);
if (&temp)
sp_seq(¤t_sprite, 141);
else
sp_seq(¤t_sprite, 143);
sp_brain(¤t_sprite, 5);
kill_this_task();
}
//rest of script
}
spawned script:
void main (void)
{
//global &sprite = ¤t_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
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(¤t_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(¤t_sprite, &temp);
&temp2 = math_mod(&temp2, 801);
&temp = &temp2;
&temp / 2;
sp_y(¤t_sprite, &temp);
&temp = math_mod(&temp2, 2);
if (&temp)
sp_seq(¤t_sprite, 141);
else
sp_seq(¤t_sprite, 143);
sp_brain(¤t_sprite, 5);
kill_this_task();
}
//rest of script
}
spawned script:
void main (void)
{
//global &sprite = ¤t_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