Re: return;
What exactly does the 'return;' command do? And where should I use it? I've never quite understood it, and there's nothing in the DinkC Reference about it.
It probably does the same as it does in C which is end your function, and returns control to the calling function, if it is main function, then your program ends. Something like that anyway.
It leaves the script so any commands after wont be read.
"return;" stops running the script:
It is commonly used whenever you use a lot of ifs.
If I hadn't used "return;" everywhere, Dink would have said the last line whenever you talked to whatever this script is attached to. Even worse, when &story is 1, it'd set &story to 2, and it'd immediately say that "Story is 2!" as well. Which is something you often don't want.
void talk( void ) { say_stop("The next line has return on it",1); return; say_stop("I'll never say this line!",1); }
It is commonly used whenever you use a lot of ifs.
void talk( void ) { if (&story == 0) { say_stop("Oh, my, story is 0!",1); return; } if (&story == 1) { say_stop("Right now, story is 1!",1); say_stop("Let's set it to 2.",1); &story = 2; return; } if (&story == 2) { say_stop("Story is 2!",1); return; } say_stop("Story is not 0, 1, or 2",1); }
If I hadn't used "return;" everywhere, Dink would have said the last line whenever you talked to whatever this script is attached to. Even worse, when &story is 1, it'd set &story to 2, and it'd immediately say that "Story is 2!" as well. Which is something you often don't want.
Oh man. The [code] just looks so awesome on Opera.

That's the traditional use of return;
With Dink v1.08 return can actually return values as well...
With Dink v1.08 return can actually return values as well...
Example:
void talk(void) { eight(); int &var = &return; say("Eight equals &var",¤t_sprite); } void eight(void) { return(8); }
Yeah, and it works with external() too!
Oh, hey, feature request for any maybe future versions of Dink:
Please accept things like "int &var = eight();". It seems like something you'd want to work... In the perfect world, there should be no difference in the usage of self-defined functions and built-in functions.
And while at it, fix "make_global_function", even though I currently don't really know how broken it is.
Enh, I should look into getting the source compiled myself, so I can add these things <_<
Oh, hey, feature request for any maybe future versions of Dink:
Please accept things like "int &var = eight();". It seems like something you'd want to work... In the perfect world, there should be no difference in the usage of self-defined functions and built-in functions.
And while at it, fix "make_global_function", even though I currently don't really know how broken it is.
Enh, I should look into getting the source compiled myself, so I can add these things <_<
What's this "make_global_function"?
Sorry for my n00bishness.

Sorry for my n00bishness.
It's something that's apparently broken (though I don't know how, exactly), but what it *should* do is something like this:
I haven't experimented with it, but using external is still recommended.
Yeah... I'm being vague >_> <_<
// imagine this to be in main.c somewhere make_global_function("functions","procname"); // from now on, you can use: procname(); //instead of: external("functions","procname");
I haven't experimented with it, but using external is still recommended.
Yeah... I'm being vague >_> <_<
Thank you to all. I am now much more enlighted. I had a hunch about what return; did, but I wasn't quite sure.
You guys rule.
You guys rule.