The Dink Network

Reply to Spawn and external!

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:
 
 
January 19th 2014, 06:41 PM
dragon.gif
Quiztis
Peasant He/Him Sweden bloop
Life? What's that? Can I download it?! 
Gah, I want to spawn a script with a loop in it, getting a variable from the main script that is attached to a sprite without halting the main script. Word.

External() apparently halts the main script until kill_this_task() or something is run from the external script.

I want to pass a variable to the spawned script from the main script. Like this here external:

void main (void)
{
int &sx = sp_x(&current_sprite, -1);
int &sy = sp_y(&current_sprite, -1);
external("rloop", "main", &sx, &sy); //&sx = &arg1, &sy = arg2

...rest of script...
}

But the loop in rloop halts the main script so I want to liiiiikeee:

spawn("rloop", "main", &sx, &sy); //&sx = &arg1, &sy = arg2

Maybe I'm too tired. My guess is taking advantage of script_attach or something since that's what spawn is using.