Global Variables question
Heya. I'm trying to do a certain room there the global variable has to be 1 before you can "use" a talking option. The variable get to 2 when I talk to another guy on the same screen (using something like "&pussle += 1;").
This is not working for me... Is it impossible to make?
This is not working for me... Is it impossible to make?
Maybe a greater than/less than statement?
//if &pussle is 1 or more, then this will work
if (&pussle >= 1)
{
....
}
//if you're using it for a choice statement...
(&pussle >= 1)"Talk Option"
Btw it's spelled puzzle.
//if &pussle is 1 or more, then this will work
if (&pussle >= 1)
{
....
}
//if you're using it for a choice statement...
(&pussle >= 1)"Talk Option"
Btw it's spelled puzzle.
I suggest:
//Code for the 'other guy'
...
void talk(void)
{
if (&pussle == 1)
{
&pussle = 2;
}
...
}
This way if you continue talking to the first guy the &pussle var doesn't keep incrementing. In some cases, it won't matter, but it's always nice to know the values of your globals.
//Code for the 'other guy'
...
void talk(void)
{
if (&pussle == 1)
{
&pussle = 2;
}
...
}
This way if you continue talking to the first guy the &pussle var doesn't keep incrementing. In some cases, it won't matter, but it's always nice to know the values of your globals.
Thanks, both of you
I have one more question. Is it possible to make like this? (&pussle2 > 1 < 5) "Say something"
I have one more question. Is it possible to make like this? (&pussle2 > 1 < 5) "Say something"
No, you need multiple if statements, so break it up like this.
(&pussle2 > 1)(&pussle2 < 5)"Say something"
I think that should work. Remember, one condition per if statement. In a non-choice statement it'd actually look like this.
if (&pussle2 > 1)
{
if (&pussle2 < 5)
{
//do whatever here
}
}
(&pussle2 > 1)(&pussle2 < 5)"Say something"
I think that should work. Remember, one condition per if statement. In a non-choice statement it'd actually look like this.
if (&pussle2 > 1)
{
if (&pussle2 < 5)
{
//do whatever here
}
}









