# Editing published game code (for personal use)

**URL:** <https://forum.choiceofgames.com/t/editing-published-game-code-for-personal-use/1681>\
**Category:** General\
**Created:** [September 13, 2013, 6:35pm UTC](https://forum.choiceofgames.com/t/editing-published-game-code-for-personal-use/1681 "2013-09-13T18:35:37Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![hild](https://avatars.discourse-cdn.com/v4/letter/h/a9a28c/32.png) [@hild](https://forum.choiceofgames.com/u/hild)\
**Post date:** [September 13, 2013, 6:35pm UTC](https://forum.choiceofgames.com/t/editing-published-game-code-for-personal-use/1681/1 "2013-09-13T18:35:37Z")

</div>

I noticed with the windows app store versions of the choice of games that you can actually view the code for the games by going into the games directory. The problem I noticed immediately was that the games uses json, which are usually not editable, if my memory of college programming classes is correct. I was wondering is it possible to edit the code for these games for personal use?

---

<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:** [September 13, 2013, 6:47pm UTC](https://forum.choiceofgames.com/t/editing-published-game-code-for-personal-use/1681/2 "2013-09-13T18:47:26Z")

</div>

Looking at code is one of the ways that I learned how to use choicescript. I’ve never edited existing code though, to me that would be a bit like taking a pen to a novel and writing my own sections.

If you really wanted to you could edit the code though. Remember to back everything up first. You should edit the text files, not the json ones, and definitely don’t share them with anyone or distribute them in any way.

---

<div class="post-metadata">

**Author:** ![hild](https://avatars.discourse-cdn.com/v4/letter/h/a9a28c/32.png) [@hild](https://forum.choiceofgames.com/u/hild)\
**Post date:** [September 13, 2013, 7:37pm UTC](https://forum.choiceofgames.com/t/editing-published-game-code-for-personal-use/1681/3 "2013-09-13T19:37:29Z")

</div>

I did that all the time in my books as a child I remember rewriting the ending to Charlotte’s web. I thought most of the coding would be in the json files, but I will give editing the txt code a try and see how it works. I have no plans to share with anyone ever.

---

<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:** [September 13, 2013, 11:17pm UTC](https://forum.choiceofgames.com/t/editing-published-game-code-for-personal-use/1681/4 "2013-09-13T23:17:10Z")

</div>

The code’s in the text files. It’s those that we edit in order to make games. If you read the make your own games section on the site it might explain a little.

Did you make them eat the pig, or did you save the spider so she wouldn’t die?

---

<div class="post-metadata">

**Author:** ![hild](https://avatars.discourse-cdn.com/v4/letter/h/a9a28c/32.png) [@hild](https://forum.choiceofgames.com/u/hild)\
**Post date:** [September 13, 2013, 11:55pm UTC](https://forum.choiceofgames.com/t/editing-published-game-code-for-personal-use/1681/5 "2013-09-13T23:55:40Z")

</div>

saved the spider.

---

<div class="post-metadata">

**Author:** ![hild](https://avatars.discourse-cdn.com/v4/letter/h/a9a28c/32.png) [@hild](https://forum.choiceofgames.com/u/hild)\
**Post date:** [September 13, 2013, 11:56pm UTC](https://forum.choiceofgames.com/t/editing-published-game-code-for-personal-use/1681/6 "2013-09-13T23:56:29Z")

</div>

and I hate spiders but I remember growing so attached to her throughout the story.

---

<div class="post-metadata">

**Author:** ![P\_Tigras](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/p_tigras/32/626_2.png) [@P\_Tigras](https://forum.choiceofgames.com/u/P_Tigras)\
**Post date:** [September 14, 2013, 7:45pm UTC](https://forum.choiceofgames.com/t/editing-published-game-code-for-personal-use/1681/7 "2013-09-14T19:45:47Z")

</div>

@FairyGodfeather When I was bug-testing Way Walkers 2, I edited startup.txt.json to change the initial variables without having to replay Way Walkers 1 multiple times to test out certain variable combinations that weren’t accounted for in the preset characters that were available

I also edited a second json file in WW2 to allow me to confirm a pretty big bug that I found while reading through the code, without having to replay the game. I just added a pair of \*set’s to set the conditions needed to trigger the bug, and a \*goto to send me from where I was to the label where the bug was.

The reason why I edited the json files instead of the originals was because editing the original txt files doesn’t work for the latest beta test games. There is probably a variable value somewhere in the javascript code for Choicescript that allows for switching back to the original txt files. You could also no doubt port the txt files to your own choicescript installation. The reason why I preferred working with the json files was because I didn’t want to risk the very tiny possibility that the original txt files might not produce the exact same results as the json files that were actually being used. And once I found a solution that worked for me, ie. editing the json files directly, I stopped digging.

Finally, there is no doubt a script to format Choicescript into json. I have not as of yet however checked the Choicescript git to see if it’s now included, or if it’s something that has been held back by Dan. If it’s included, editing the original txt files, and then using the script to convert them to json, would probably be the easiest way to go.

---

<div class="post-metadata">

**Author:** ![P\_Tigras](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/p_tigras/32/626_2.png) [@P\_Tigras](https://forum.choiceofgames.com/u/P_Tigras)\
**Post date:** [September 14, 2013, 8:26am UTC](https://forum.choiceofgames.com/t/editing-published-game-code-for-personal-use/1681/8 "2013-09-14T08:26:10Z")

</div>

The json files \*are\* editable. They just crash if you add additional lines of code without updating the line number on which the various \*label’s are located.

---

<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:** [September 14, 2013, 4:16pm UTC](https://forum.choiceofgames.com/t/editing-published-game-code-for-personal-use/1681/9 "2013-09-14T16:16:23Z")

</div>

That’s good to know @P_Tigras. Is there any point of editing them instead of the txt files?

@Hild I figured. 🙂

---

<div class="post-metadata">

**Author:** ![hild](https://avatars.discourse-cdn.com/v4/letter/h/a9a28c/32.png) [@hild](https://forum.choiceofgames.com/u/hild)\
**Post date:** [September 16, 2013, 12:50am UTC](https://forum.choiceofgames.com/t/editing-published-game-code-for-personal-use/1681/10 "2013-09-16T00:50:16Z")

</div>

thanks after poking around the game files I noticed that the app has a block mechanism probably using sha-1 or something similar,for making any changes. So I found another way around it to get it to work.

---

<div class="post-metadata">

**Author:** ![CJW](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/cjw/32/111787_2.png) [@CJW](https://forum.choiceofgames.com/u/CJW)\
**Post date:** [September 16, 2013, 4:14am UTC](https://forum.choiceofgames.com/t/editing-published-game-code-for-personal-use/1681/11 "2013-09-16T04:14:25Z")

</div>

It’s just easier for authors to code straight into a text file - imagine writing your games out as JSON? Ouch.

But in terms of data reference, i.e. pulling and using the game/scene data - it’s much easier in JSON. Actually in standard text format, the data is useless to javascript, it doesn’t know what to do with it - it’s just one huge string.

Currently whilst your games are in text file format, your scenes are actually converted to JSON objects whenever they’re loaded, you just don’t see it.

I guess the inclusion of JSON files at installation just speeds things up a little, there’s no lull whilst converting to JSON - as it’s already there.

---

<div class="post-metadata">

**Author:** ![raceoflegend](https://avatars.discourse-cdn.com/v4/letter/r/6de8d8/32.png) [@raceoflegend](https://forum.choiceofgames.com/u/raceoflegend)\
**Post date:** [March 28, 2015, 6:38am UTC](https://forum.choiceofgames.com/t/editing-published-game-code-for-personal-use/1681/12 "2015-03-28T06:38:18Z")

</div>

I have been attempting to figure out a way to mod the startup text file as suggested to edit some stats at the beginning of “The Hero of Kendrickstone”. However, I own the steam version of the game, and the steam version does not have the files in this format in the installation folder. Am I looking in the wrong place, or does the steam version not support tinkering of any kind?

---

<div class="post-metadata">

**Author:** ![Tathen](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/tathen/32/38134_2.png) [@Tathen](https://forum.choiceofgames.com/u/Tathen)\
**Post date:** [February 6, 2016, 10:03pm UTC](https://forum.choiceofgames.com/t/editing-published-game-code-for-personal-use/1681/13 "2016-02-06T22:03:08Z")

</div>

Hi I’m all so trying to edit files as a steam user i don’t know if you are still looking for info on this but if you are ill redirect you to my thread which im updating as i find more info

> [@Steam, Editing files and finding saves?](https://forum.choiceofgames.com/t/steam-editing-files-and-finding-saves/14824):
>
> I have spent a while Googling and looking for info on how to (cheat) edit files found out a bit, how ever i am a steam user current game i am trying to edit is The Lost Heir1, but i am guessing it’s the same with most of the games Problems i have, the files to edit are inside the .exe while i can look inside even pullout all the files and play the game as a stand alone i can not edit and save the files while they are inside the .exe and while i can play the game as a standalone u can not save …

tl;dr there located in the .exe file Good luck
