Quick question on setting boolean variables

Started by , Fri 27/10/2006 20:53:27

Previous topic - Next topic

SisteenStone

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?

Joe

Ok: let me know if this is what you did

Code: ags


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

//At script header
import bool takeTicket;

//Some script
takeTicket=true;

Copinstar © Oficial Site

monkey0506

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?

SisteenStone

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.

monkey0506

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).

SisteenStone

Yea I got it now, that import export is what I was missing. Thanks alot for the help!!! ;D

SMF spam blocked by CleanTalk