# Variables that don't get reset with a new game?

**URL:** <https://forum.choiceofgames.com/t/variables-that-dont-get-reset-with-a-new-game/19686>\
**Category:** ChoiceScript Help\
**Created:** [August 10, 2016, 4:35pm UTC](https://forum.choiceofgames.com/t/variables-that-dont-get-reset-with-a-new-game/19686 "2016-08-10T16:35:48Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon98911805](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@anon98911805](https://forum.choiceofgames.com/u/anon98911805)\
**Post date:** [August 10, 2016, 4:35pm UTC](https://forum.choiceofgames.com/t/variables-that-dont-get-reset-with-a-new-game/19686/1 "2016-08-10T16:35:48Z")

</div>

Is there some form of global variable that I could use? I’m trying to make a game where the player plays through the game once as a human, then has the option of playing through it again as a one of the species of aliens, and each time they play through, they unlock another playable race.

---

<div class="post-metadata">

**Author:** ![FairyGodfeather](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fairygodfeather/32/16709_2.png) [@FairyGodfeather](https://forum.choiceofgames.com/u/FairyGodfeather)\
**Post date:** [August 10, 2016, 4:37pm UTC](https://forum.choiceofgames.com/t/variables-that-dont-get-reset-with-a-new-game/19686/2 "2016-08-10T16:37:59Z")

</div>

No. But you can work around it.

You could institute a password system that allows someone to play through the different race on their second playthrough.

Or you can fake a new game, but I’d suggest against that.

---

<div class="post-metadata">

**Author:** ![anon98911805](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@anon98911805](https://forum.choiceofgames.com/u/anon98911805)\
**Post date:** [August 10, 2016, 4:39pm UTC](https://forum.choiceofgames.com/t/variables-that-dont-get-reset-with-a-new-game/19686/3 "2016-08-10T16:39:21Z")

</div>

Agh ok, not the answer I was hoping for, but thanks anyways!

---

<div class="post-metadata">

**Author:** ![FairyGodfeather](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fairygodfeather/32/16709_2.png) [@FairyGodfeather](https://forum.choiceofgames.com/u/FairyGodfeather)\
**Post date:** [August 10, 2016, 4:41pm UTC](https://forum.choiceofgames.com/t/variables-that-dont-get-reset-with-a-new-game/19686/4 "2016-08-10T16:41:53Z")

</div>

Yeah, unfortunately. It’s a pity that you can’t check to see if people have achievements.

You could also ask them specific questions related to the game content as the password system with a SPOILERS WARNING on it or something.

---

<div class="post-metadata">

**Author:** ![anon98911805](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@anon98911805](https://forum.choiceofgames.com/u/anon98911805)\
**Post date:** [August 10, 2016, 4:44pm UTC](https://forum.choiceofgames.com/t/variables-that-dont-get-reset-with-a-new-game/19686/5 "2016-08-10T16:44:20Z")

</div>

OK thanks! I’ll try to integrate something like that into it (but I should probably start by creating more than the stat screen) 😄

---

<div class="post-metadata">

**Author:** ![RETowers](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/retowers/32/21477_2.png) [@RETowers](https://forum.choiceofgames.com/u/RETowers)\
**Post date:** [August 10, 2016, 5:05pm UTC](https://forum.choiceofgames.com/t/variables-that-dont-get-reset-with-a-new-game/19686/6 "2016-08-10T17:05:14Z")

</div>

Actually, there is the option of doing this with achievements. You can test for achievements in game. Of course achievements don’t stay remembered until it’s built as an app, but if you create placeholders until you’re ready to submit, we can work on that on the end.

---

<div class="post-metadata">

**Author:** ![anon98911805](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@anon98911805](https://forum.choiceofgames.com/u/anon98911805)\
**Post date:** [August 10, 2016, 5:11pm UTC](https://forum.choiceofgames.com/t/variables-that-dont-get-reset-with-a-new-game/19686/7 "2016-08-10T17:11:29Z")

</div>

I’m not _particularly_ nooby at choicescript, but not sure I understand… How would something like that look?

---

<div class="post-metadata">

**Author:** ![RETowers](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/retowers/32/21477_2.png) [@RETowers](https://forum.choiceofgames.com/u/RETowers)\
**Post date:** [August 10, 2016, 6:32pm UTC](https://forum.choiceofgames.com/t/variables-that-dont-get-reset-with-a-new-game/19686/8 "2016-08-10T18:32:32Z")

</div>

```
*achievement foo visible 10 Name
    Description

*check_achievements
*choice
    #Foo
        *achieve foo
        Foo
        *ending
    *if (choice_achieved_foo) #Bar
        FOOBAR!
        *ending

```

Just dump that in as a test and see how it plays. 🙂

---

<div class="post-metadata">

**Author:** ![Nocturnal\_Stillness](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/nocturnal_stillness/32/100414_2.png) [@Nocturnal\_Stillness](https://forum.choiceofgames.com/u/Nocturnal_Stillness)\
**Post date:** [August 10, 2016, 6:32pm UTC](https://forum.choiceofgames.com/t/variables-that-dont-get-reset-with-a-new-game/19686/9 "2016-08-10T18:32:40Z")

</div>

it IS possible I think. It just depends on how simple complex you want it to be.

Option One

You can just not use \*ending at the end but have a choice to restart or end session then \*set a c\_human variable to true and then use \*goto\_scene beginning and have players continue straight on with a check for \*if (c\_human) to offer the alien choice.

Option Two

Only offer completion bonuses not full stats and use something similar to a New Game Plus mode. [I used this option in Unnatural]

---

<div class="post-metadata">

**Author:** ![anon98911805](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@anon98911805](https://forum.choiceofgames.com/u/anon98911805)\
**Post date:** [August 10, 2016, 6:33pm UTC](https://forum.choiceofgames.com/t/variables-that-dont-get-reset-with-a-new-game/19686/10 "2016-08-10T18:33:21Z")

</div>

Thanks! I’ll test it out in a bit!

- Edit:  
I tested it out, and FairGodfeather’s idea was much more simple (in my mind at least), so I’m gonna stick with that!  
Thanks everyone!
