Hello Everyone.
I've read all the posts on Global variables, and the Docs and the Wme book. But I'm still not succeeding in what I need. I struggled with it for a couple of days before posting, I don't want to abuse the good will of the posters here. But I'm really stuck.
I want to make a checklist that the player can view when they want, showing their progress.
I made a scene in my game that is the checklist. As the player goes through the game and collects items a I want a tick to appear on the list, .Ok so I though I would make a global variable for each item that gets collected in the game. When an item is collected the variable is set to true. then if you view the checklist screen a sprite entity for the corresponding item is made active. I know this should be really easy but some how its not working.
My base.inc
#include "scripts\const.inc"
global actor;
global Score = 0;
global Kannushi;
The first scene in the game is Menu.scene and there I initalise the variable
this is the scene_init.script
#include "scripts\base.inc"
if(Kannushi==null)
{
Kannushi = false;
}
Later when the item is collected It triggers this script
on "LeftClick"
{
Score = Score +1;
Kannushi = true;
}
This is the scene.init for the checklist scene
#include "scripts\base.inc"
if (Kannushi == true);
{
}
I read in other posts that to use a global in any script you should include
global Kannushi;
but If I do that I get a script error. With this code the tick is constantly displayed even before you trigger the code. Thanks in advance for your help.