##permanently changing attribute**
![RyanScott](https://images.v-cdn.net/banned_large.png)
Hello,
I'm trying to implement a kiip achievement but I only want it to be available once within the game.
Basically,
I want an attribute to be changed to 1 and to then change back to 0 permanently.
but I also need a way so that when the player comes back to the scene with the kiip achievement it doesn't display the same achievement before it was locked.
Any ideas?
Because this is what will happen:
attribute finish level=1
change attribute kiip to 1
when kiip=1
display kiip achievement
after 0.1 seconds change attribute kiip achievement to 0
in this process players still can re-earn the achievement because the change kiip attribute to 0 only happens after it is 1.
I'm trying to implement a kiip achievement but I only want it to be available once within the game.
Basically,
I want an attribute to be changed to 1 and to then change back to 0 permanently.
but I also need a way so that when the player comes back to the scene with the kiip achievement it doesn't display the same achievement before it was locked.
Any ideas?
Because this is what will happen:
attribute finish level=1
change attribute kiip to 1
when kiip=1
display kiip achievement
after 0.1 seconds change attribute kiip achievement to 0
in this process players still can re-earn the achievement because the change kiip attribute to 0 only happens after it is 1.
Comments
Then have the rule:
If kiip=1 and has 'kiip earned' = 0
Trigger the achievement
Change 'kiip earned' to 1
The 'kiip earned' attribute will change to 1 the first time the achievement has been earned, and nothing ever changes it back, so it will never trigger the achievement again.
Or a variation on this theme - basically adding more attributes is a good idea.
@RyanScott
Hi Ryan, I think I get what you're saying. So you'll need another attribute that'll keep your attribute at 0 after it has been 1 before.
Make a boolean called KiipDone
attribute finish level=1
When KiipDone is false
change attribute kiip to 1
display kiip achievement
after 0.1 seconds change attribute kiip achievement to 0
change KiipDone to true
Don't forget to save KiipDone as well, so it loads as true next time.
----------
Edit: @ooi beat me to it by seconds!
I've been thinking, it can be even simpler:
---- forget the boolean---
attribute finish level=1
When attribute kiip is 0 --- make sure that kiip is a game attribute
change attribute kiip to 1
display kiip achievement
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
awesome and hi-five
do I need to have a timer after 0.1 seconds change attribute and save the attribute once it changes to 1? (referring to your simpler solution)
attribute finish level=1
when attribute kiip is 0
display kiip achievement
timer (after 0.1 seconds change attribute to 1 and save attribute)
@ooi thanks for your input
@RyanScott
Hi Ryan, you don't need any timer; because even though you're changing the attribute kiip to 1 before the achievement, the achievement is in the same Rule so will not be affected and will still work that one time.
In other words, keep the Rule in the order I suggested, you'll have no problems:
attribute finish level=1
When attribute kiip is 0 --- make sure that kiip is a game attribute
change attribute kiip to 1
display kiip achievement
To answer your other question: yes; best to save the attribute kiip and load it even for starting a new game, otherwise the kiip reward will still be able to be shown and used.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Hi @tatiang , I just can't see the point of using one more step; with a boolean, the true (1) state is both the achieved stated and therefore the used state... two steps instead of three....just sayin'...
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
OK, I understand where you're coming from; but as long as the true state is saved and then loaded as true, it'll still be true (1) and so the rule won't run again (because it says when the boolean is 0), if you see what I mean.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps