Reply to Re: sp_custom
If you don't have an account, just leave the password field blank.
65535 is a bit small to be working with and get accurate results after extracting it.
What I've got so far:
//example - storing seq (not bigger than 143) and y position.
int &crap = sp_pseq(¤t_sprite, -1);
&crap /= 2;
&crap *= 1000;
int &crap2 = sp_y(¤t_sprite, -1);
&crap += &crap2;
&crap /= 2;
int &me = sp_editor_num(¤t_sprite);
editor_seq(&me, &crap);
//main procedure
//extracting the x,y
int &me = sp_editor_num(¤t_sprite);
int &crap = editor_seq(&me, -1);
&crap *= 2;
int &crap2 = &crap;
&crap /= 1000;
&crap *= 2;
sp_seq(¤t_sprite, &crap);
&crap /= 2;
&crap *= 1000;
&crap2 -= &crap;
sp_y(¤t_sprite, &crap2);
//end of scripting
Which gives a result 1 larger than the numbers I started with, which is ok for x/y but not for the sequence! If I do x and y instead of the seq and y then it's anywhere up to 600 and 400 which means more shrinking to fit into 65535 and less accurate when extracted. Help?
What I've got so far:
//example - storing seq (not bigger than 143) and y position.
int &crap = sp_pseq(¤t_sprite, -1);
&crap /= 2;
&crap *= 1000;
int &crap2 = sp_y(¤t_sprite, -1);
&crap += &crap2;
&crap /= 2;
int &me = sp_editor_num(¤t_sprite);
editor_seq(&me, &crap);
//main procedure
//extracting the x,y
int &me = sp_editor_num(¤t_sprite);
int &crap = editor_seq(&me, -1);
&crap *= 2;
int &crap2 = &crap;
&crap /= 1000;
&crap *= 2;
sp_seq(¤t_sprite, &crap);
&crap /= 2;
&crap *= 1000;
&crap2 -= &crap;
sp_y(¤t_sprite, &crap2);
//end of scripting
Which gives a result 1 larger than the numbers I started with, which is ok for x/y but not for the sequence! If I do x and y instead of the seq and y then it's anywhere up to 600 and 400 which means more shrinking to fit into 65535 and less accurate when extracted. Help?