The Dink Network

"spawn" procedure in a row?

March 9th 2011, 08:32 PM
knightgl.gif
castman
Peasant He/Him Brazil
Some day I'll finish my mod... Some day... 

Hello,

I'm trying to use 'spawn' to launch one script from another running script.

I have successfully spawned the first script ('pl-army.c') from the screen base script ('battle-in.c'). But when I tried to spawn another script from 'pl-army' it didn't work...

void main ( void )
{

\\say("Yop", 1);

spawn("pl-sold");

say("Yop", 1);

kill_this_task();

}


If "Yop" is at that '\\'d line Dink says it, but if it's under the spawn procedure Dink doesn't say it.

I don't know what's happening, should I use something different than spawn in that situation?
March 9th 2011, 08:54 PM
spike.gif
No, this kind of thing works perfectly fine... Perhaps the problem is in pl-sold?
March 10th 2011, 04:10 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
And you're certain you're not doing anything to surpress the say() command? Like other subsequent says in the spawned scripts?

Nothing should stop the execution of a script after it calls a spawn() command. It must indeed lie with the spawned script that's interfering somehow. You're not creating an endless loop are you?
March 10th 2011, 05:14 AM
dinkdead.gif
"And you're certain you're not doing anything to surpress the say() command? Like other subsequent says in the spawned scripts?"

Mmm could well be that, maybe the Yop is appearing so fast you don't see it... try changing the say() to a say_stop() and then see if it works.

Also, your comments are the wrong way around // not \\
March 10th 2011, 10:54 AM
knightgl.gif
castman
Peasant He/Him Brazil
Some day I'll finish my mod... Some day... 


"And you're certain you're not doing anything to surpress the say() command? Like other subsequent says in the spawned scripts?"

Mmm could well be that, maybe the Yop is appearing so fast you don't see it... try changing the say() to a say_stop() and then see if it works.


You're right, the 'yop' on 'pl-army' suppressed the 'hey' from 'pl-sold', adding say_stop to both made see that the spawning was going well and the problem was at 'pl-sold' as Scratcher said.

The problem was:

if (&count != 0)
{
&soldi = create_sprite(283, 1, 0, &soldx, &soldy);
sp_script(&soldi, "fr-sold");
}


'pl-sold' didn't work because I invert the positions of 'x and y' with 'pseq and pframe' Pretty dumb!

Now it works fine thanks for the help.