How To See Other Games' Code


#11

Wow, that was incredibly useful.

In five minutes of browsing havenstone’s code i’ve learned an awful lot.


#12

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!


#13

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

https://chrome.google.com/webstore/detail/thieves-gambit-the-curse/jickpmgeolbdpldfpefcadbjoninpelg - 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.


Any way to read the whole thing?
Seeing game codes
#14

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.


#15

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.


#16

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.


Guenevere (WIP)
Children of the Gods (Important poll #12306)
Guenevere (WIP)
#17

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!


#19

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


#21

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:


#22

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]


#23

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


#25

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?


#26

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.


#27

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.


#28

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.


#29

Edit

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.


#30

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.

For example;

https://www.choiceofgames.com/user-contributed/lost-heir-fall-of-daria/scenes/startup.txt

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

How come?


#31

That’s because the $ symbol designates content you have to pay for, in your specific example both ‘startup.txt’ and ‘childhood.txt’ are part of the free trial. Without buying the game you can’t access the rest of the scenes.

It’s to prevent people from using this method to get games they haven’t paid for.


#32

Oh that explains why it worked for me last night on my computer but not today on my mobile phone!!

Thank you!

I do have The Lost Heir purchased, where in the url can I have it recognize my purchase? Because I do believe I am properly logged in to choicegames from my computer and my mobile phone but it doesn’t seem to recognize I have it purchased from my mobile phone?

Fyi, I have it purchased from the website, via “Play Online” as opposed to steam or Chrome apps. (But I do use chrome BROWSER for my computer but not my mobile android phone, idk if that means anything)


#33

@TheKid90 If you own the game you only need to be logged in. Note that the “$” is not part of the scene name, you should just write “sheepguard”.