Re: Paul Pliska's Script Trick...
...I see mentioned quite often here and there, but what is it?!
Is it storing variables in editor_seq()?
Edit: While I'm at it, is this: if (&var) the same as doing this: if (&var > 0) ?
Is it storing variables in editor_seq()?
Edit: While I'm at it, is this: if (&var) the same as doing this: if (&var > 0) ?
1. yes (or editor_frame)
2. I expect that would work in most languages, but I doubt it would in DinkC
2. I expect that would work in most languages, but I doubt it would in DinkC
1. It works like this:
In the void main() procedure do:
int &var1 = sp_editor_num(¤t_sprite);
This will return the editor number of ¤t_sprite. This number is not the same as ¤t_sprite. (I believe that usually &var1 = ¤t_sprite - 1)
int &var2 = editor_seq(&var1, -1);
&var2 will now be equal to the value of the editor_seq(); of ¤t_sprite.
Then, wherever you wish to store something in the editor_seq:
&var2 = <newvalue>;
And then to store it:
editor_seq(&var1, &var2);
You can use both editor_seq and editor_frame for this. editor_frame will be a number between 0 and 255, editor_seq has a larger range. I believe it has to be positive though...
2. Well, a little test confirms that if (&var) does the same as if (&var != 0). (negative values will return true as well.)
In the void main() procedure do:
int &var1 = sp_editor_num(¤t_sprite);
This will return the editor number of ¤t_sprite. This number is not the same as ¤t_sprite. (I believe that usually &var1 = ¤t_sprite - 1)
int &var2 = editor_seq(&var1, -1);
&var2 will now be equal to the value of the editor_seq(); of ¤t_sprite.
Then, wherever you wish to store something in the editor_seq:
&var2 = <newvalue>;
And then to store it:
editor_seq(&var1, &var2);
You can use both editor_seq and editor_frame for this. editor_frame will be a number between 0 and 255, editor_seq has a larger range. I believe it has to be positive though...
2. Well, a little test confirms that if (&var) does the same as if (&var != 0). (negative values will return true as well.)
It's gotta be positive unfortunatly... Negative values did so not work. I also tried messing with editor type, and the thing dissapeared on me

I expect that would work in most languages
hmm... i wonder if that would work in BASIC?
hmm... i wonder if that would work in BASIC?
Wouldn't
BASIC ∊ Most_Languages
make more sense, though? </nitpicking>
BASIC ∊ Most_Languages
make more sense, though? </nitpicking>
I have no idea why I didn't say that instead. X)
???
anyway i saw some examples using the BASIC library i use (PB) and it had statement like
if var.b
blah blah blah
endif
(the .b indicates a byte value)
anyway i saw some examples using the BASIC library i use (PB) and it had statement like
if var.b
blah blah blah
endif
(the .b indicates a byte value)
Of course BASIC supports interpreting whether any value means "true" or not. Almost any language does, with the exception of some more quick and dirty scripting languages like DinkC.