# Mygame.js issues? Maybe?

**URL:** <https://forum.choiceofgames.com/t/mygame-js-issues-maybe/7809>\
**Category:** ChoiceScript Help\
**Created:** [February 27, 2015, 4:24am UTC](https://forum.choiceofgames.com/t/mygame-js-issues-maybe/7809 "2015-02-27T04:24:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Colt](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/colt/32/3391_2.png) [@Colt](https://forum.choiceofgames.com/u/Colt)\
**Post date:** [February 27, 2015, 4:24am UTC](https://forum.choiceofgames.com/t/mygame-js-issues-maybe/7809/1 "2015-02-27T04:24:20Z")

</div>

This is most likely the most stupid thing anyone has ever asked on here, but here’s my question:

I was looking through the forums for a way to set a name for your character with a text box, and most methods said something about needing to use mygame.js . I’ve tried to open up mygame.js before, but it always comes up with the same error message:

> Line: 1  
> Char: 1  
> Error: ‘SceneNavigator’ is undefined  
> Code: 800A1391  
> Source: Microsoft JScript runtime error

Every topic I looked into about this was someone asking, another person telling them to install Notepad++, and then it worked. I’ve tried installing Notepad++, but the file still won’t open.  
For some reason, when I try to be sneaky and drag the mygame.js file into a new Notepad++ file, it shows up as just this:

> nav = new SceneNavigator([“startup”]);  
> stats = {};

and that’s it. From what I’ve seen, there should be lots more in the file than just that, and I’m scared to try to edit it without knowing if this should be happening or not.

In the end, I’m left with a few questions:  
How do I get it to work?  
If it’s already working, then why is it different?

Also, in regards to the naming thing, do you need to use mygame.js for it, or is there a way to just use scenes (startup, I imagine) to do it? Thanks!

---

<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:** [February 27, 2015, 4:29am UTC](https://forum.choiceofgames.com/t/mygame-js-issues-maybe/7809/2 "2015-02-27T04:29:32Z")

</div>

Choicescript changed. You no longer need to edit mygame.js to do anything.

You can just place the following in startup.

\*create name “none”

And then anywhere else (as long as it comes after the create)

```
*choice
    #Alan
        *set name "Alan"
        *goto next
    #Bob
        *set name "Bob
        *goto next
```

---

<div class="post-metadata">

**Author:** ![Colt](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/colt/32/3391_2.png) [@Colt](https://forum.choiceofgames.com/u/Colt)\
**Post date:** [February 27, 2015, 4:33am UTC](https://forum.choiceofgames.com/t/mygame-js-issues-maybe/7809/3 "2015-02-27T04:33:43Z")

</div>

@FairyGodfeather Thank you! And then you’d just change (set, technically) the variable whenever in the game that the text box pops up, right?

Also, is there any need to be concerned about my strange mygame.js file, or should I just leave it?

---

<div class="post-metadata">

**Author:** ![Havenstone](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/havenstone/32/198451_2.png) [@Havenstone](https://forum.choiceofgames.com/u/Havenstone)\
**Post date:** [February 27, 2015, 4:41am UTC](https://forum.choiceofgames.com/t/mygame-js-issues-maybe/7809/4 "2015-02-27T04:41:03Z")

</div>

You can just leave mygame.js.

To allow the reader to input their own name in a text box (as opposed to selecting pre-set options like Alan and Bob), use: [http://choicescriptdev.wikia.com/wiki/Input\_text](http://choicescriptdev.wikia.com/wiki/Input_text)

And no, you shouldn’t need to set a variable again (unless it’s changed). To display a variable like “name” so the reader sees what it’s been set to, use:

> **[Displaying variables](https://choicescriptdev.fandom.com/wiki/Displaying_variables)**
>
> This article is aimed at beginners to ChoiceScript. However, if you have not already done so then the best place to start would be with the very first article in this Introduction To ChoiceScript Game Development series of linked articles: A Basic...

---

<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:** [February 27, 2015, 4:42am UTC](https://forum.choiceofgames.com/t/mygame-js-issues-maybe/7809/5 "2015-02-27T04:42:57Z")

</div>

I’d suggest using an unaltered version of mygame.js. Download choicescript again (or just grab a new copy of that file). Just in case it messes stuff up.

If you haven’t already I’d suggest reading the code of some of the existing games. I found it helped me get a feel for how they do things.

Choice of the Dragon’s nice and simple. [https://www.choiceofgames.com/dragon/scenes/startup.txt](https://www.choiceofgames.com/dragon/scenes/startup.txt)
