How do you change what the show stats, restart and settings buttons say?

If possible, can anyone tell me how to change the word by, play again, share with friends, etc. The reason why I want to change the names is because my book is in Spanish, and I think it would be nicer if everything was in Spanish.

Thanks :smile:

1 Like

Unless things have changed, you should be able to do it by editing the mygameā€™s index.html file, and search for the actual button name text (e.g. Show Stats) to change. Relevant lines should look something like this:

<p><button id="statsButton" onclick="showStats()">Show Stats</button></p>

Edit: I doubt it would be quite as easy to change such as the ā€˜play againā€™ wording as those options are generated by the *ending command (where included in your scenes, and when the game reaches the end of the last scene). However, you should be able to create your own ā€œfinal choiceā€ type of ending at any point, and use theā€¦

Edit again :slight_smile: : *goto_scene startup command for the option where your readers choose to play again. Doing this will automatically reset all *create variable commands to their default values (etc.) and restart the game from the very beginning.

3 Likes

Thank you. IĀ“ll take a look as soon as I can

1 Like

OK, I was able to change he names of the buttons for settings and achievements, but not the show stats button, or any other buttons. Please help

Hmm. If a search on ā€˜Show Statsā€™ or ā€˜Restartā€™ is coming back with ā€˜no match foundā€™ or similar, then things have recently changed (probably with the addition of the ā€˜Menuā€™ button option to allow the reader to alter font size and background) and itā€™s likely no longer possible to actually change those buttons?

Can anyone confirm this, one way or the other?

1 Like

At one time I wanted to this but it is best to leave it be as when you get it publiahed CoG can work with you on changing those if you want.
://forum.choiceofgames.com/t/changing-the-text-of-the-show-stats-button/18941

1 Like

Some of these buttons and their names/values are now generated dynamically (usually in ui.js). You could tweak the values there, but as always, thereā€™s no guarantee that any such modificiations will be accepted for publishing.

5 Likes

I have learned that it is better to leave button names alone until you publish the book. I spent a ton of time trying to change them, and ended up with a bug in the script, and it isnā€™t worth all the trouble, because now I would have to go through the ui.js script, which is suuuuuper long, and find it. Soooā€¦ Iā€™m definetely leaving it alone, and ask Choice of Games to help me when I publish the book.

4 Likes

Well, I am doing an interactive fiction with the ChoiceScript in my native language for a group of friends and would like to know if any way to change the button name ā€œShow statsā€

PS: Sorry for any spelling mistakes, my english is bad :ā€™(

Youā€™ll have to do a bit of CS modification. Iā€™m on mobile, so what Iā€™ll say is just a general guide. Might do a detailed one once I got back, or maybe other folks can show you the way more detailed.


Find ui.js file (directory: ā€¦/web/); open it with text editor, preferably non-default ones: Notepad++, Atom writer, etc.

Find (Ctrl + F) for the text-elements you want to translate. Save the changes

Your future compiled games should utilize the translated elements.


For reference, go here

2 Likes