How To See Other Games' Code (current info posted in OP and Post 146 on 6/18/19)

@Greenwolf No, you can’t alter the files without direct access. It’s sort of like, when you download a file, you can’t just turn around and upload something in it’s place. Think Youtube, you can download the videos easily enough, (in fact that’s technically what you’re doing when you watch them on the site) but you can’t upload or alter the videos unless Youtube gives you access (such as them being your videos).

@FairyGodfeather Yea, to my knowledge the way dropbox handles things precludes that from working, though I actually prefer to use mygame.js anyways, as it gives me the same view as the writer, meaning it’s easier to get into their head to help debug.

2 Likes

@Reaperoa Yep, the raw scenes folder is not much use for dropbox and similar hosts where you can’t directly access directories. I’m nosy, I like poking about in scenes especially finding files not listed in mygame.js

@FairyGodfeather Yea, I keep a lot of my notes in the scenes folder to, such as my file named |<font color = "white>youdidn’tactuallythinkI’dsay,didyou?|

Of course it’s worth noting that it would be possible to restructure your game, so while it will work in most, it may not work in every case.

And I think it goes without saying, but I’ll say it anyway: While people should feel encouraged to look at other author’s game files and learn from them, don’t rip stuff directly, try and put your own spin on it. I’m not even suggesting you have to ask for their permission (some author’s want it, others don’t) - but you won’t learn anything if you copy and paste a stats screen and just change some variable names.
Take systems apart, mix them with others and put them back together, it’s the best way to learn!

3 Likes

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…

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

(file:///C:/Users/USERNAME/AppData/Local/Google/Chrome/User%20Data/Default/Extensions/jickpmgeolbdpldfpefcadbjoninpelg/1.0.5_0/scenes/)

And there! Code!

If this doesn’t make sense, sorry. :slight_smile: 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.

6 Likes

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?
https://dl.dropboxusercontent.com/s/d8y63t3wvpbwfc9/Element.htm?dl=0

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.

14 Likes

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!

3 Likes

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

1 Like

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. :grin:

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:
[Removed Link]

That’s not a ChoiceScript game, none of the stuff on this forum will help you with that.

1 Like

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.