Project JSON modification — Topic


Hopscotch JSON structure

A hopscotch project json file contains all of its code, objects and attributes, written in JSON(see this) that a program can take and convert to dictionaries (see this).

This is how the JSON of Hopscotch projects are built up:


Stored in an array in the main dictionary
Abilities have UUID:s.

Abilites are groups of code blocks, such as in a rule or in a Check Once If block. They have an array containing all the code blocks in them.


Stored in an array in an Ability
Blocks have no UUID.

Information about a single block. Has “block_class” and “description” attributes. Has an array of parameters (if the block has a bubble).


Stored in an array in the main dictionary
Rules have UUID:s.

Rules are the “When ()” blocks. Has “name” (seems to be unused), “id”, “objectID” (referencing which Object the rule is in) and “abilityID” (references which Ability is used in the rule). “parameters” array contain one object describing which of the When types it is.


Stored in an array in either Rules or Blocks in Abilities
Parameters don’t have UUID:s

Parameters have “default_value”, “value” and “key” attributes. “datum” array is used if the parameter is not a plain number. “datum” objects can be math blocks, conditions in a When block or reference traits.

More will be coming, I just don’t have time rn. @Petrichor, you were interested in this. @William04GamerA, @Awesome_E, @XxFoxxedxX

I wrote a small program that takes a JSON file and pretty-prints it, if anyone needs that:

Pretty-print JSON files

No libraries needed

#Python 3
import json

#take the filename/directory as a user input
print ("Warning! This will overwrite your current file.")
file_name = input("File Directory:")

#get the text in the file
with open(file_name, mode = 'r' , encoding= "utf-8") as file_info:
    file_text =
    loaded_json = json.loads(file_text)

#save pretty-printed text to the same file
with open(file_name, mode = 'w' , encoding='utf-8') as f:
    f.write(json.dumps(loaded_json, sort_keys=True,indent=4, separators=(',', ': '))).

print ("Saved pretty-printed json to",file_name).


Thank you for that information, it is really helpful! I often use to get a more graphical overview of JSONs. is a really good JSON validator too.


I can paste it in Game Maker and it formats it with no clicks.
I also use


I feel like this is OMTL worthy, but @pomtl:

There are two webplayer versions: The old and the new
  • The old one does NOT have custom rules, and variables apply to one object only (individual). This version has Last Touch variables, but can also support MULTI-TOUCH input (more than one object can be pressed correctly at once). It does NOT have Clone Index as a variable/parameter.
  • The new webplayer has all the fancy stuff like object-assigned variables (and that one variable created applies to all objects), custom rules, and clone index. BUT: Multi-touch is not supported (two or more objects can NOT be pressed properly at the same time).

What did I do? I put the biggest feature of the new webplayer into the old one: Clone Index. All of the variables inside the “Secret Parameters” ability apply to “Self”. That way, one project can have both Clone Index and multi-touch. I am going to make a new HS Duel between characters using this trick, as I want to be able to identify Clone Index (obvious reasons) and have multi-touch support (so both players can actually press the arrow keys to move properly – obvious reasons).


I don’t know why I booked marked this topic I don’t know anything about json


That’s cool. How did you get the ability with a parameter? Was it an existing block, or is it just faked?


That is awesome! Maybe THT could use that in some way?


It’s probably just an ability with a parameter added.


Faked; just so I didn’t have to name the ability otherwise


is it possible to access Hs’s code @Awesome_E @Petrichor @William04GamerA @CreationsOfaNoob and turn it into javascript

then paste it into a website


The webplayer code is JavaScript already.

The rest of it is not, and you can probably access it, I just don’t know how’s.


Do you need iTunes?

Also what is this:



I think you might be able to see webplayer code in pages using the files app.


I can send you a link to the webplayer code that you can access online, if you’d like to. Then, you can just use an online JavaScript code viewer if you want to edit and view the file. Just tell me and I will fix it!


Not if you have Google Drive to swap files between – works just as well


Do you need JavaScript?


What do you mean? If you want to execute the file and/or read it, you can just use a website. I will show you.
You can find the webplayer here.
Edit: I probably misspelled the addres s… I will check it on my computer tomorrow.

But keep in mind that this is The Hopscotch Team’s code. I know the link to it, but I take no responsibility for what people potentially use that information for. You can take a look at it and maybe try changing some things, but you should not use it to make a “Hopscotch clone” or something similar. I just wanted to point that out.


I couldn’t open it.


Could it be possible to add a hyperlink by editing the .json files…?.??



Probably not.