JSON and Copying Objects

  • 17 Sep 2021 10:39
    Message # 11095314
    Anonymous member (Administrator)

    How to Copy Objects between all developers:

    Watch the Video Here

    Download the full document of the text in the attachment below - FYI I cant insert all the images in this forum.

    You may make any changes you want; all changes must be Scouting appropriate and may not include any forms of identification. So no names or addresses or mention of 1st Kellyville Scout Hall.

    One of the great features of Krunker is the ability to export the Object or Group you are working on in a JSON format.

    JSON stands for Java Script Object Notation and is being more commonly used every data in data transfer, in this case JSON is being used because it is a lightweight format best for storing and transporting data.

    How do I get the JSON text for my object or Group?

    Middle Mouse Click, this will open a menu window, select JSON, highlight and copy all the code in the new window (Highlighted in Red Below)

    This is the JSON text for a simple Cube

     [{"p":[285,32,465],"s":[10,10,10]}]

    I would imagine that the “p” stands for position and the “s” stands for size. Since the Cube is still default with no changes applied there is no need for further data.

    What if we were to change the Cubes colour to Red, how would that affect the JSON Text?

                    [{"p":[285,32,465],"s":[10,10,10],"c":"#FF0000"}]

    Here we can see that a “c” (Colour) has bee added with a strange code. This Colour Code is called Hex Colour Code and you can find this online if you want to find specific colours. A HEX colour is expressed as a six-digit combination of numbers and letters defined by its mix of red, green and blue

    The good news is that you do not need to understand JSON to work with each other but if you want to dig into it you can.

    So why am I going over this?

    Well because if you design something and want to share it with others you can simply send them the JSON code. It is as simple as that.

    I have found that the easiest way to do this is to create a normal cube then Middle Mouse Click, this will open a menu window, select Replace then Select JSON.

    This will in turn open an Input window on the top of the screen, paste your JSON text in here and click the OK button or press the Enter/Return key.

    And just like that your Cube will be updated to the new JSON code.

    So now onto the challenge. I am creating a map of our hall and would like to include you guys into it, in order to do that I have created two template models (that match the huge size of the hall) for you to copy and then edit to look like you. Once done send me back the JSON code and I will incorporate you character into the map. You may make any changes you want; all changes must be Scouting appropriate and may not include any forms of identification. So no names or addresses or mention of 1st Kellyville Scout Hall.

    Another important thing to know is how to group and ungroup objects. The above humanoid models are simply groupings of objects, before you can make any major changes you must un group them. You do this by middle mouse click on the Group and select Group then Stop

    This then breaks the group and you will be able to click on and manipulate each object.

    Now, in order to share your completed model with everyone when you are done you must first group all the objects before getting the JSON code.

    This is done by select Object from the menu and then place holder.

    The place holder is a cube with only a wireframe, it usually appears where your camera is and so you may need to zoom out a little to see it

    Next step is to move and stretch this place holder around your model. The place holder will group anything it touches so be careful you don’t include other items accidentally. You should only stretch the placeholder around the objects you want in the group.

    With my model completely surrounded I will middle mouse click and select Group then Create from the resulting menus

    This then groups my model allowing me to collect the JSON code and share it.

    Blue Shirt Krunker JSON Code is:

    [{"p":[338.09,12.12,625.84],"s":[7,30,7],"c":"#9E8D73","t":5},{"p":[338.09,7,632.84],"s":[7,5.18,7],"c":"#000000","t":5},{"p":[338.09,36.83,629.37],"s":[7,28,14],"c":"#000080","t":5},{"p":[338.09,64.74,629.37],"s":[10,9,10],"c":"#FFC3A0","t":5},{"p":[338.09,73.71,629.37],"s":[10,2,10],"c":"#3B3B3B","t":5},{"p":[338.09,36.83,629.37],"s":[8,8,15],"c":"#9E8D73","t":5},{"p":[338.09,51.78,619.37],"s":[6,12,6],"c":"#000080","t":5},{"p":[338.09,37.89,619.37],"s":[6,14,6],"c":"#FFC3A0","t":5},{"p":[338.09,33.89,619.37],"s":[6,4,6],"c":"#FFC3A0","t":5},{"p":[338.09,51.78,639.45],"s":[6,12,6],"c":"#000080","t":5},{"p":[338.09,37.89,639.45],"s":[6,14,6],"c":"#FFC3A0","t":5},{"p":[338.09,33.94,639.45],"s":[6,4,6],"c":"#FFC3A0","t":5},{"p":[338.07,71.35,624.58],"s":[10,4.35,0.61],"c":"#535353","t":5},{"p":[334.08,72.85,629.37],"s":[2,2,10],"c":"#3B3B3B","t":5},{"p":[334.08,71.33,625.31],"s":[2,2,2],"c":"#3B3B3B","t":5},{"p":[334.08,71.33,633.38],"s":[2,2,2],"c":"#3B3B3B","t":5},{"p":[333.8,69.67,627.54],"s":[1.5,1.5,1.5],"t":5},{"p":[333.8,69.67,631.01],"s":[1.5,1.5,1.5],"t":5},{"p":[333.53,69.71,627.77],"s":[1,1,1],"c":"#1D14C9","t":5},{"p":[333.53,69.71,630.76],"s":[1,1,1],"c":"#1D14C9","t":5},{"p":[333.37,68.27,629.26],"s":[0.75,0.75,0.75],"c":"#FFC3A0","t":5},{"p":[333.53,66.53,629.37],"s":[1,0.54,3.19],"c":"#030303","t":5},{"p":[338.07,71.35,634.1],"s":[10,4.35,0.61],"c":"#535353","t":5},{"p":[339.59,69.52,624.58],"s":[7.06,4.35,0.61],"c":"#535353","t":5},{"p":[340.47,67.92,624.58],"s":[5.24,4.35,0.61],"c":"#535353","t":5},{"p":[340.47,67.92,634.1],"s":[5.24,4.35,0.61],"c":"#535353","t":5},{"p":[339.54,69.52,634.1],"s":[7.06,4.35,0.61],"c":"#535353","t":5},{"p":[342.8,67.92,629.44],"s":[0.61,6.56,10],"c":"#535353","t":5},{"p":[333.53,71.48,627.54],"s":[1,0.54,1.96],"c":"#030303","t":5},{"p":[333.53,71.48,631.05],"s":[1,0.54,1.96],"c":"#030303","t":5},{"p":[338.09,12.1,632.84],"s":[7,30,7],"c":"#9E8D73","t":5},{"p":[338.09,7,625.92],"s":[7,5.18,7],"c":"#000000","t":5}]

    Pink Shirt Krunker JSON Code is:

    [{"p":[338.95,11.69,591.84],"s":[7,30,7],"c":"#9E8D73","t":5},{"p":[338.95,11.73,598.84],"s":[7,30,7],"c":"#9E8D73","t":5},{"p":[338.95,36.83,595.37],"s":[7,28,14],"c":"#F9A2A2","t":5},{"p":[338.95,64.74,595.37],"s":[10,9,10],"c":"#FFC3A0","t":5},{"p":[338.95,73.71,595.37],"s":[10,2,10],"c":"#3B3B3B","t":5},{"p":[338.95,36.83,595.37],"s":[8,8,15],"c":"#9E8D73","t":5},{"p":[338.95,51.78,585.37],"s":[6,12,6],"c":"#F9A2A2","t":5},{"p":[338.95,37.89,585.37],"s":[6,14,6],"c":"#FFC3A0","t":5},{"p":[338.95,33.89,585.37],"s":[6,4,6],"c":"#FFC3A0","t":5},{"p":[338.95,51.78,605.45],"s":[6,12,6],"c":"#F9A2A2","t":5},{"p":[338.95,37.89,605.45],"s":[6,14,6],"c":"#FFC3A0","t":5},{"p":[338.95,33.94,605.45],"s":[6,4,6],"c":"#FFC3A0","t":5},{"p":[338.93,71.35,590.58],"s":[10,4.35,0.61],"c":"#535353","t":5},{"p":[334.94,72.85,595.37],"s":[2,2,10],"c":"#3B3B3B","t":5},{"p":[336.63,68.58,591.31],"s":[5.44,4.97,2],"c":"#3B3B3B","t":5},{"p":[334.66,69.67,593.54],"s":[1.5,1.5,1.5],"t":5},{"p":[334.66,69.67,597.01],"s":[1.5,1.5,1.5],"t":5},{"p":[334.39,69.71,593.77],"s":[1,1,1],"c":"#1D14C9","t":5},{"p":[334.39,69.71,596.76],"s":[1,1,1],"c":"#1D14C9","t":5},{"p":[334.23,68.27,595.26],"s":[0.75,0.75,0.75],"c":"#FFC3A0","t":5},{"p":[334.39,66.53,595.37],"s":[1,0.54,3.19],"c":"#030303","t":5},{"p":[338.93,71.35,600.1],"s":[10,4.35,0.61],"c":"#535353","t":5},{"p":[340.45,69.52,590.58],"s":[7.06,4.35,0.61],"c":"#535353","t":5},{"p":[341.33,65.56,590.58],"s":[5.24,5.46,0.61],"c":"#535353","t":5},{"p":[340.45,69.52,600.17],"s":[7.06,4.35,0.61],"c":"#535353","t":5},{"p":[343.66,64.73,595.44],"s":[0.61,9.1,10],"c":"#535353","t":5},{"p":[336.63,68.58,599.47],"s":[5.44,4.97,2],"c":"#3B3B3B","t":5},{"p":[341.33,65.56,600.18],"s":[5.24,5.46,0.61],"c":"#535353","t":5},{"p":[334.39,71.49,597],"s":[1,0.17,1.47],"c":"#030303","t":5},{"p":[334.39,71.49,593.54],"s":[1,0.17,1.47],"c":"#030303","t":5},{"p":[338.95,7,591.84],"s":[7,4.77,7],"c":"#000000","t":5},{"p":[338.95,7,598.79],"s":[7,4.77,7],"c":"#000000","t":5}]

    Door JSON Code is:

    [{"p":[336.98,6,394.26],"s":[11.89,88,44],"i":21,"r":[3.14,0,3.14],"ms":22}]


    Last modified: 17 Sep 2021 10:43 | Anonymous member (Administrator)