The Dink Network

Reply to Re: Some problem

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:
 
 
December 5th 2005, 04:42 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
You seem to have some good advice here but I am still not convinced that
sp_editor_num(x) = sp(x).


That's because they aren't. If you pardon the somewhat mathematical term, they're each other's inverse.

I'll try to explain it as well as I can, but it's rather difficult if you feel the difference intuitively, as you might know.
Anyway, here I go:

In dinkedit (or WDE, of course), attach the script test.c to a sprite you've placed there. Write down the number just before you save and exit the program.

test.c looks like this:

void main( void )
{
int &crap = sp(###written number###);
if (&crap == &current_sprite)
{
say_stop("Okay, so sp() transforms the 'editor number' into a 'script number'", 1);
say_stop("`5 That's true, Dink, and you can use it in say_stop lines, move lines, ",&crap);
say_stop("`5 and other script commands that need a sprite number", &crap);
}
else
{
say_stop("Make sure you've written down the 'editor number' after you've done all other modifications",1);
}
wait(500);
&crap = sp_editor_num(&current_sprite);
if (&crap == ###written number###)
{
say_stop("Okay, so sp_editor_num() transforms the 'script number' into a 'editor number'", 1);
say_stop("`5 That's true, Dink, and as you see, using this 'editor number' in scripts", &crap);
say_stop("`5 can lead to weird behaviour", &crap);
say_stop_xy("`% Note that if the correct sprite is talking",1,1);
say_stop_xy("`% try to place more sprites on the screen with the editor",1,1);
say_stop_xy("`% don't forget to update the number you wrote down in the script",1,1);
}
else
{
say_stop("Make sure you've written down the 'editor number' after you've done all other modifications",1);
}
}

I hope this makes sense, if not, I hope someone else can explain better, or perhaps explain it to me