Since I'm still a newbie at scritping I'm just posting this in the beginners area, but I guess it could go in the advanced...
Anyways, I had a hotspot on my background with an interaction script like this:
Ã, Ã, if (rock == 0) {
Ã, Ã, AddInventory(1);
Ã, }
Ã, if (rock == 0) {
Ã, rock += 1;
Ã, }
Ã, if (rock == 1) {
Ã, Ã, Display("MESSAGE ONE");Ã,Â
Ã, }
Ã, if (rock == 2) {
Ã, Ã, Display("MESSAGE TWO");
Ã, }
Ã, if (rock < 2) {
Ã, Ã, rock += 1;
Ã, }Ã,Â
It worked out pretty good. But now I replaced the hotspot with a character, and I want this same script on the character. For that, I can no longer put int rock; at the top of the room script, but I need to put it in the global script somewhere...
I'm not sure where or how to insert the int into the game (without having it reset if the game is loaded).
I think putting
int rock;
in start of global script and
import int rock;
into the script header should do it, then you could use it for the character.
That works. Thanks a lot. I wasn't sure on how to use the import thing... Isn't there also an export function? What's that used for?
eeer... yes, you need to
export rock;
in the end of the global script if you have done something with it in the global script, and want to use it in room scripts.
Well, it worked without the export line... But I'll add it.
This is all in the BFAQ already. Did you read it?