"spawn" procedure in a row?
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?
No, this kind of thing works perfectly fine... Perhaps the problem is in pl-sold?
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?
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?
"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 \\
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 \\
"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.