The Dink Network

Custom procedure is new script??

June 10th 2012, 05:35 AM
dinkdead.gif
Is this known? Did I know this before and have forgotten?
A custom procedure counts as a separate script? I've just spent ages debugging before discovering that using kill_this_task() just causes it to go back to the calling procedure within the same script...

//Dink says "1, 2, 4"

void main (void)
{
	say_stop("1", 1);
	
	test();
	
    //He shouldn't say this!
	say_stop("4", 1);
}
	
void test (void)
{
	say_stop("2", 1);
	kill_this_task();
	wait(1);
    say_stop("3", 1);
}


Actually I seem to remember something now about it having a different script number. How annoying.
June 10th 2012, 01:24 PM
custom_iplaydink.gif
iplaydink
Peasant He/Him Sweden
Hmm.. 
Yeah.. that is messed up.. I learned it the hard way. Also scripts declared in the main procedure can't be used in custom procedures!
June 11th 2012, 04:22 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
You mean variables, not scripts?

In any case, I can see this being very annoying, but also useful in rare circumstances.
June 11th 2012, 06:12 AM
dinkdead.gif
"useful in rare circumstances."

Dunno... can't think of any circumstances where this would be useful and there not be some other better way to get the same result.

And yeah I knew about the variables so I suppose I should've thought of this before. Oh well.

I tried returning something to say kill the script but ended up having to shuffle the whole thing around a bit to get it to work.
June 11th 2012, 06:42 AM
fairy.gif
Someone
Peasant He/Him Australia
 
Yeah, using spawn would seem to have the same effect and be less confusing. My memory of these things is fuzzy but I think you can use external to call a function while keeping it on the same script number. Funny that it works like that..
June 11th 2012, 12:10 PM
custom_iplaydink.gif
iplaydink
Peasant He/Him Sweden
Hmm.. 
"You mean variables, not scripts? "

Haha.. yeah I must've been really tired when writing that!