Save and load an attribute for achievement
Player_E
Member, PRO Posts: 604
Okay I have an achievement for dying within the first 20 sec of the game and I cant seem to figure out how to only unlock the achievement once. This is what I have so far.
(simplified)
I have a global Boolean attribute that tells me if I have gotten the achievement or not.
Rule When global attribute achievement is false. when death before 20 sec spawn actor that shows achievement. Change attribute Achievements to true. Save attribute Achievement.
This is all on one actor.
Then when the game ends I have it so it resets the game so you go back to my main screen. on the main screen I have a load attribute achievement. which should load that the attribute is now true making the above rule not function.
Now I click play and die within 20 sec and the achievement still appears on my screen.
p.s. im doing this all on the GS preview button would that have something to do with it because im not actually using a devise to test it on at this point.
Any thoughts
(simplified)
I have a global Boolean attribute that tells me if I have gotten the achievement or not.
Rule When global attribute achievement is false. when death before 20 sec spawn actor that shows achievement. Change attribute Achievements to true. Save attribute Achievement.
This is all on one actor.
Then when the game ends I have it so it resets the game so you go back to my main screen. on the main screen I have a load attribute achievement. which should load that the attribute is now true making the above rule not function.
Now I click play and die within 20 sec and the achievement still appears on my screen.
p.s. im doing this all on the GS preview button would that have something to do with it because im not actually using a devise to test it on at this point.
Any thoughts
Comments
First I have a global boolean attribute that is at false. That I want to determine if I have the achievement or not. I'll call this achievement 1 for description purposes
I have an actor with the follow rule.
When all conditions are valid
Game time is less than 20 sec
health is 0
and game attribute achievement 1 is false.
Spawn actor (the achievement image)
Change game attribute achievement 1 to true
Save game attribute achievement 1
Now this should make it when I play the game again Game attribute achievement 1 is True therefore making the first Rule I have above invalid so it will not longer spawn the achievement image.
When the game ends it goes back to my main screen and i have the load attribute achievement 1 on an actor in that screen. and when I click Play and die within the 20 sec the achievement image still spawns.
hope that cleared things up.
it keep appearing game after game when I get the achievement when I only want it to show one time only in the lifetime of the game.
thanks everyone