sp_script
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", ¤t_sprite);
wait(1500);
say_stop("HELP!! HELP!! GOBLIN IS ATTACKING ME!!", ¤t_sprite);
wait(1500);
create_sprite(527, 141, 0, 417, 5);
sp_pseq(¤t_sprite, 765);
sp_pframe(¤t_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?.
BST:
say_stop("GOBLIN INFESTATION, GUARDS!!GUARDS!!", 1);
wait(1500);
say_stop("what yous on abouf war ends yearfs ago", ¤t_sprite);
wait(1500);
say_stop("HELP!! HELP!! GOBLIN IS ATTACKING ME!!", ¤t_sprite);
wait(1500);
create_sprite(527, 141, 0, 417, 5);
sp_pseq(¤t_sprite, 765);
sp_pframe(¤t_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?.
I'm not sure what you mean, but perhaps you need something like this...
int &gobbo;
&gobbo = create_sprite(527, 141, 0, 417, 5);
int &gobbo;
&gobbo = create_sprite(527, 141, 0, 417, 5);
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);
You can do it all at once though :
int &gobbo = create_sprite(x, y, brain, seq, frame);
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.......
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.......