• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Legacy GM Achievements not changing colour

T

theno1

Guest
Hi, I have an image that has index 1 and 0 and are different colours and the below two objects are situated in rm_achievements. However, when I get to rm_level_2_intro room and exit, the achievement has not changed. The show_message("hi") does not show for level 2 too. Can anyone help?

obj_controller
Create
Code:
global.achievement1=false;
obj_score_show
Step
Code:
if room = rm_level_2_intro && global.achievement1 = false
{
    if(!global.ach1)
    {
    show_message("hi");
    }
    global.achievement1=true;
}
 

MeBoingus

Member
Hi, I have an image that has index 1 and 0 and are different colours and the below two objects are situated in rm_achievements. However, when I get to rm_level_2_intro room and exit, the achievement has not changed. The show_message("hi") does not show for level 2 too. Can anyone help?

obj_controller
Create
Code:
global.achievement1=false;
obj_score_show
Step
Code:
if room = rm_level_2_intro && global.achievement1 = false
{
    if(!global.ach1)
    {
    show_message("hi");
    }
    global.achievement1=true;
}

Hi!

Global variables are not saved over rooms. So once your objects are being destroyed and a new room is being visited - these variables are being cleared.

Some options:

Bad:
Make an object that stores the global achievement variables. Make this object persistent and have it spawn at the start of the game.

Good:
Read up on ini files and use an ini file to read / write the values of the achievements.


If you need any help with the latter, inbox me.
 
Top