The Dink Network

sp_script

July 9th 2003, 10:38 PM
dragon.gif
eug1404
Peasant He/Him New Zealand
 
Hmmm i try to execute the previous command in this script:

BST:

say_stop("GOBLIN INFESTATION, GUARDS!!GUARDS!!", 1);
wait(1500);
say_stop("what yous on abouf war ends yearfs ago", &current_sprite);
wait(1500);
say_stop("HELP!! HELP!! GOBLIN IS ATTACKING ME!!", &current_sprite);
wait(1500);
create_sprite(527, 141, 0, 417, 5);
sp_pseq(&current_sprite, 765);
sp_pframe(&current_sprite, 1);
sp_script(24, goblinkill);
unfreeze(1);
kill_this_task( void );

There is more above but it all works great it replaces the sprite with the new (dead goblin) one fine but then it won't attach the script to the sprite that was just created, the next number in line is 24 but there is no way that i know of to check a sprites number if it wasn't placed in the editor and don't know it's number so can't put a script on it .
Any help?.
July 10th 2003, 03:54 AM
custom_fish.png
SabreTrout
Noble He/Him United Kingdom
Tigertigertiger. 
I'm not sure what you mean, but perhaps you need something like this...

int &gobbo;
&gobbo = create_sprite(527, 141, 0, 417, 5);
July 10th 2003, 04:20 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
Definitely. You can't just do a create sprite without attaching it to a local or global variable.
You can do it all at once though :

int &gobbo = create_sprite(x, y, brain, seq, frame);
July 10th 2003, 05:22 AM
pq_frog.gif
Ric
Peasant They/Them Canada
 
and when you use sp_script, the name of the script getting attached needs to be in " ".
sp_script(24,"goblinkill");
And who is sprite 24?. If you want the newly created sprite to have this script, then:
sp_script(&gobbo,"goblinkill");
And you have created it in view of the player. Thats o.k. if you want it that way, but you can use create_sprite beyond the screen:
(you don't need sp_pseq, put 765 in the create_)
int &gobbo = create_sprite(700,140,0,765,5);
then after giving him a base walk(in this script or in "goblinkill")
sp_base_walk(&gobbo,760);
freeze(&gobbo);
move_stop(&gobbo,4,550,1);
In fact, within this script, you can control the newly create sprite completly! because you have the variable &gobbo.
sp_brain(&gobbo,9);
sp_target(&gobbo,1);
ect.......