Editing published game code (for personal use)

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?

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.

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.

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?

saved the spider.

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

@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.

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.

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

@Hild I figured. :slight_smile:

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.

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.

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?

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

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