input_text problem


#1

Hello, me again ^^"

I’m trying a very simple thing : make the player/reader choose the name of the hero.
So here’s what I have :

*temp name

Enter your name!

*input_text name

*goto your_name_is

*label your_name_is

Your name is ${name}!

*finish

Very simple. But I always get an error message who says “Javascript {}” when I click on “Next”. Then, after the error message, on the page, everything’s fine, with the name, etc. But this error message is driving me reaaaally crazy :confused:
Is there a problem with the variable ? Where am I suppose to define it ?

Thanks for helping me everyone :slight_smile:


#2

I am not at my main PC to check the files of my game, but I think the issue is that you are defining the variable name. It may be part of ChoiceScript. Drop *temp name and see if it works.


#3

I tried, but when I do it, I still get the error message AND it don’t go to the next “page” (where the sentence “Your name is…” is supposed to be). So it’s a step back.
Thanks for helping :slight_smile:


#4

In fact, I think it’s not a problem with the “input_text”. Because I tried :

Welcome message blah blah

*page_break

You’ve got ${intelligence} of intell.
*finish

And in mygame.js :

stats = {
name: “unamed”
,intelligence: 20
,sagesse: 20

};

Same error :confused:


#5

Beats me – your code works fine when I run it in my game. If you’ve got “name” as a variable in your mygame file, you shouldn’t need to also make it a temp variable, but that doesn’t break the game when I do it. What browser are you using?


#6

Did you change any of the standard choicescript files? Because like Havenstone says, the code looks fine.


#7

I’m using Safari.
Thank you for helping guys, I really appreciate.
I’ll try on a other browser, like Firefox or something.

And I didn’t change anything, I even re-download the files. Is it possible that it could be a problem of “Indentation” ?


#8

None of your code requires indenting so that’s not it :frowning:


#9

Is it possible you can check the game on Windows? The error messages don’t work correctly on any browser other than Internet Explorer (as far as I know). The actual error message may help diagnose the problem.


#10

I’ll try on Windows. But it will be very weird if the game work on Windows but does not on a Mac.
I tried on firefox, but I still get the error message.


#11

I meant to ask if you can try it on Internet Explorer (my mistake).

I’m not saying that it will work on Windows, just that the error message only displays correctly on Internet Explorer. On any other browser it just seems to shows a pair of curly parenthesis (like you mentioned) while on IE it actually displays the error message as intended. (Again, as far as I know, that’s how it works.)