Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Fri 27/10/2006 20:53:27

Title: Quick question on setting boolean variables
Post by: on Fri 27/10/2006 20:53:27
I have a variable called takeTicket, in a script after an interaction i want to set it to true.

so I put

takeTicket = true;

but it doesnt seem to work... Am I using the wrong command?
Title: Re: Quick question on setting boolean variables
Post by: Joe on Fri 27/10/2006 21:20:09
Ok: let me know if this is what you did



//At top of global script
bool takeTicket;
export takeTicket;

//At script header
import bool takeTicket;

//Some script
takeTicket=true;

Title: Re: Quick question on setting boolean variables
Post by: monkey0506 on Fri 27/10/2006 21:22:37
As Joe displayed, if you want the variable available to all your scripts, you will have to export/import it.

However, you didn't say what exactly the problem was. Was there an error message, or did the variable not appear to change correctly, or what exactly happened?
Title: Re: Quick question on setting boolean variables
Post by: on Fri 27/10/2006 21:38:45
well there's a condition on an object, that once it falls out of a window the character can pick it up. So while it's in the window the takeTicket=false and when It falls it should change to true but it doesn't. There's no error though.
Title: Re: Quick question on setting boolean variables
Post by: monkey0506 on Fri 27/10/2006 21:43:55
Okay, can you show us where you put that code? i.e., copy and paste the whole function inbetween [ code ] and [ /code ] tags (without the spaces).
Title: Re: Quick question on setting boolean variables
Post by: on Fri 27/10/2006 22:10:55
Yea I got it now, that import export is what I was missing. Thanks alot for the help!!! ;D