I’m bumping this because I keep getting asked how to see game code. Bump bump bump. Nowadays you just need to go to the startup.txt file instead of mygame.js since the scenes list is in startup.txt
@Samuel_H_Young, since you asked…
Awesome, I’ll use this for future reference
Wow, that was incredibly useful.
In five minutes of browsing havenstone’s code i’ve learned an awful lot.
Glad to hear it! By proper coding standards it’s sloppy, but it gets the job done. (: Now go look at other people’s code for more and better ideas!
If you want to see the code of games purchased in Google Chrome Store. (Note this is not the same as the Play Store). What you need to do is first purchase the game on Google Chrome. (I’ll use Curse of the Black Cat as my example.)
Thieves' Gambit: The Curse of the Black Cat - Chrome Web Store - this is the webpage you buy it from. (Take a note of those letters at the end.)
Now you need to browse to where google chrome stores app data on your computer.
Navigate to chrome://version/ and look for Profile Path, it is the default directory that chrome apps are stored in. (For instance C:\Users\USERNAME\AppData\Local\Google\Chrome\User%20Data\Default)
Then click on the extensions folder (C:\Users\USERNAME\AppData\Local\Google\Chrome\User%20Data\Default\extensions)
Now there’s a folder with a bunch of confusing folder names in there, but I remembered that the jick one is the game I want to look at. From there you want to find the scenes folder.
And there! Code!
If this doesn’t make sense, sorry. It’ll only work if you own the games on Google Chrome, and this is how I do it on a Windows 8 PC. Other Windows versions might be different.
I know this thread is old, but the method described here is not working for me…
How do I see the code for my game?
Replacing Element.htm?dl=0 with scenes/startup.txt gave me an error.
It’s a newer game? Is it compiled? If so then it’s like it’s all wrapped up in a box so we can’t use the above method to look at the code.
If it’s compiled as that game is, the best you can do to get the lines is to load the page, open your web browser’s console and type in: allScenes[“startup”].lines.join("\n");
Then hit enter.
This will output all the lines of that scene into the console, which you can then copy out into a text editor.
Of course you can replace “startup” with the name of any desired scene.
I AM SO EXCITED I FOUND THIS
I’m still taking baby steps but I feel much more confident by being able to see how others did this!
@Hell_Satan, how familiar are you with this sort of scripting?
The Choice of Games website has a few good introductions you’ll want to read and understand. The wikis are good too for explaining other techniques you’ll have available. Reading the introduction first is very useful. Most importantly, it gives you a concept of what to look for in a game’s code.
Reading the code of other games that you’re familiar with is a super handy way to find out how the writer accomplished specific things. How did they allow you to create a custom name? How did they move from one scene to the next? How did they track relationships stats, skill proficiency, etc? This has actually been the most useful tool for me so far. What have other people done that you want to do? Find the code and see how they do it!
If the issue is that you’re compiling and receiving errors that you don’t understand, what I do is search the error on the forums; 9/10 times, someone else has solved it.
It’s a lot to figure out, especially if you’re new to thinking like this. It’ll take some trial and error. Luckily, people on these forums tend to be very helpful! So if you bring a specific question to their attention, they more likely than not will be happy to help.
Good luck! It’s a lot like learning a new, vaguely mathematical language. But once you follow the internal logic of what’s going on, I promise you, it gets simpler and simpler.
I’m confuse… Need to know the codes for Boxhead Bounty Hunter. I tried everything you said, but I can’t find it.
How can I find the coding to this game:
That’s not a ChoiceScript game, none of the stuff on this forum will help you with that.
Is your problem that the games no longer work?
Have you tried moving the folder back where you moved it from?
Have you tried uninstalling and then redownloading everything?
Yes, yes and yes.
I ended up signing out of my google account and back in, and reinstalled everything. I am still missing some files but the games now work. As you can see in one of the screenshots, the .Json files text documents are missing.
The only issue is that now “The Hero Project” and “Zombie Exodus” aren’t downloading and google wants me to pay for them again. Though i’m pretty sure this isn’t an issue that CoG can help with.
Consider this issue mostly solved. I have enough money to purchase the games again.
Did you definitely own those games on that account? (Can you check your email for receipts?)
That seems really odd that the documents are missing. I’d try uninstalling and reinstalling all the files again.
Yes. It’s the exact same account. I checked for receipts but I don’t even have all the ones for the games I have now. Like I said, it’s not a big deal to me.
I created another user on the computer and logged onto Chrome from that account. That seems to have fixed everything (save the missing games) but only for that user. Which is fine. I don’t mind switching users to play a game.
This can be found in you’re google wallet account. It’s very detailed, as in it will list all the things you’ve bought with the google account. Mine dates back to when I made my first purchase in 2010.
I hope this was able to help you somehow. Maybe take some screen shots of your receipts and send them in?
Note - this will also show items you have cancelled/refunded.
Awesome post, thanks guys.
I actually have been doing the method described by the OP and FairyGodFeather for some time now but lately every scene in the startup.txt that begins with $ won’t load for me.
In here if you see the scenes list, the scene “childhood” will load for me when “startup” is replaced in the url. But the rest of the scenes begin with a , like the scene " sheepguard".
If I replace startup with sheepguard I get taken to a page where it says “error: not registered” or if i try sheepguard or even _sheepguard I get a page that says “error: couldn’t find scene”.