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, 01:07 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
Wrong again.

sp(1) returns the value used by scripts, and needs the value as it appears in the editor. In this case 1 is the sp_editor_num.

sp_editor_num(sp(&crap)) = &crap;
sp(sp_editor_num(&crap)) = &crap;

consider &sprite a sprite put on the screen in the editor, then

&crap = sp_editor_num(&sprite);
say_stop("hey", &crap);

will probably result in another sprite than &sprite saying "hey"

&crap = sp(&sprite)
say_stop("hey", &crap);

will work.

Now say &sprite is placed with create_sprite() in the same script as the following lines:

&crap = sp_editor_num(&sprite);
say_stop("hey", &crap);

Will result in no text at all (or something equally buggy) as &sprite doesn't exist in the editor, so sp_editor_num() doesn't exist (so returns 0 or -1)

&crap = sp(&sprite);
say_stop("hey", &crap);

will make no sense, as sp() needs an editor number as input, and &sprite doesn't exist in the editor.

The correct way to do it with create_sprite() is:

say_stop("hey", &sprite);

Best is not to bother with sp() at all (sp_editor_num() is used for an advanced trick). Use &crap = create_sprite() or possibly the global variable thing (by adding a script whith &store = &current_sprite;, &store is a global, to the sprite) to interact with different sprites than Dink or &current_sprite.