Reply to Re: Globals and the if statement
If you don't have an account, just leave the password field blank.
July 26th 2002, 03:40 PM

bdjnk


: I always thought of myself as an inteligent person. I live in a country where the way I speak and write in English deserves an A+. I can also handle many computer problems analyze them and find solutions. But scripting is something beyond my abilities. Now...
: I compared my script (the one with the if statement) with the poster script from dink source, I am using programs such as CEdit or EasyDinkC. Still however my problem remained unsolved! This is how the dang script looks like:
: void main(void)
: {
: }
: void talk(void);
: {
: freeze(1);
: if (&story == 1);
: {
: \Conversation is in here
: unfreeze(1);
: &story = 2;
: return;
: }
: if (&story == 2);
: {
: return;
: }
: // And that's it!
: HELP!!!!!!!!!!!!!!!!!
: (How come I always end my post with the same word
?)
Let's dissect your script and see what is wrong with it, ok. There doesn't need a semicolon (
at the end of these three statements: void talk(void); if (&story == 1); and if (&story == 2);
I don't know if it works to have the freeze() and unfreeze() commands aligned like they are but it looks suspicious to me.
Next, why are there two separate if() statements when one will do if you phrase them like this:
void talk(void);
{
return;
if (&story == 1);
{
freeze(1);
\Conversation is in here
&story = 2;
unfreeze(1);
return;
}
}
And lastly make sure you made a proper global variable in main.c
make_global_int("&story", ?);
hope that helps
P.S. get the revised DinkC.txt and read it!
: I compared my script (the one with the if statement) with the poster script from dink source, I am using programs such as CEdit or EasyDinkC. Still however my problem remained unsolved! This is how the dang script looks like:
: void main(void)
: {
: }
: void talk(void);
: {
: freeze(1);
: if (&story == 1);
: {
: \Conversation is in here
: unfreeze(1);
: &story = 2;
: return;
: }
: if (&story == 2);
: {
: return;
: }
: // And that's it!
: HELP!!!!!!!!!!!!!!!!!
: (How come I always end my post with the same word

Let's dissect your script and see what is wrong with it, ok. There doesn't need a semicolon (

I don't know if it works to have the freeze() and unfreeze() commands aligned like they are but it looks suspicious to me.
Next, why are there two separate if() statements when one will do if you phrase them like this:
void talk(void);
{
return;
if (&story == 1);
{
freeze(1);
\Conversation is in here
&story = 2;
unfreeze(1);
return;
}
}
And lastly make sure you made a proper global variable in main.c
make_global_int("&story", ?);
hope that helps
P.S. get the revised DinkC.txt and read it!