{
  "SaveName": "Remote Control Cubes",
  "GameMode": "RC Car",
  "Gravity": 0.5,
  "Date": "7/28/2017 10:37:48 PM",
  "Table": "Table_RPG",
  "Sky": "Sky_Sunset",
  "Note": "",
  "Rules": "",
  "LuaScript": "--[[ Lua code. See documentation: http://berserk-games.com/knowledgebase/scripting/ --]]\n\n--[[ The OnLoad function. This is called after everything in the game save finishes loading.\nMost of your script code goes here. --]]\nfunction onload()\n    --[[ print('Onload!') --]]\nend\n\n--[[ The Update function. This is called once per frame. --]]\nfunction update ()\n    --[[ print('Update loop!') --]]\nend",
  "LuaScriptState": "",
  "Grid": {
    "Type": 0,
    "Lines": false,
    "Color": {
      "r": 0.0,
      "g": 0.0,
      "b": 0.0
    },
    "Opacity": 0.75,
    "ThickLines": false,
    "Snapping": false,
    "Offset": false,
    "BothSnapping": false,
    "xSize": 2.0,
    "ySize": 2.0,
    "PosOffset": {
      "x": 0.0,
      "y": 1.0,
      "z": 0.0
    }
  },
  "Lighting": {
    "LightIntensity": 0.54,
    "LightColor": {
      "r": 1.0,
      "g": 0.9804,
      "b": 0.8902
    },
    "AmbientIntensity": 1.3,
    "AmbientType": 0,
    "AmbientSkyColor": {
      "r": 0.5,
      "g": 0.5,
      "b": 0.5
    },
    "AmbientEquatorColor": {
      "r": 0.5,
      "g": 0.5,
      "b": 0.5
    },
    "AmbientGroundColor": {
      "r": 0.5,
      "g": 0.5,
      "b": 0.5
    },
    "ReflectionIntensity": 1.0,
    "LutIndex": 0,
    "LutContribution": 1.0
  },
  "Hands": {
    "Enable": true,
    "DisableUnused": false,
    "Hiding": 0,
    "HandTransforms": [
      {
        "Color": "Red",
        "Transform": {
          "posX": -15.1107855,
          "posY": 4.81034231,
          "posZ": -20.1076221,
          "rotX": 0.0,
          "rotY": 0.0,
          "rotZ": 0.0,
          "scaleX": 11.7719965,
          "scaleY": 9.174497,
          "scaleZ": 4.87123871
        }
      },
      {
        "Color": "Yellow",
        "Transform": {
          "posX": -30.2150211,
          "posY": 4.81034231,
          "posZ": 10.17524,
          "rotX": 0.0,
          "rotY": 90.0,
          "rotZ": 0.0,
          "scaleX": 11.6554956,
          "scaleY": 9.174497,
          "scaleZ": 4.91999054
        }
      },
      {
        "Color": "Purple",
        "Transform": {
          "posX": 30.2511959,
          "posY": 4.81034231,
          "posZ": 9.59069252,
          "rotX": 0.0,
          "rotY": 270.0,
          "rotZ": 0.0,
          "scaleX": 11.655489,
          "scaleY": 9.174497,
          "scaleZ": 4.91999054
        }
      },
      {
        "Color": "Blue",
        "Transform": {
          "posX": 15.4749184,
          "posY": 4.81034231,
          "posZ": 19.8365288,
          "rotX": 0.0,
          "rotY": 179.8,
          "rotZ": 0.0,
          "scaleX": 11.7720528,
          "scaleY": 9.174497,
          "scaleZ": 4.871281
        }
      },
      {
        "Color": "White",
        "Transform": {
          "posX": 15.1961336,
          "posY": 4.81034231,
          "posZ": -20.1400986,
          "rotX": 0.0,
          "rotY": 0.0,
          "rotZ": 0.0,
          "scaleX": 11.77198,
          "scaleY": 9.17449951,
          "scaleZ": 4.87123871
        }
      },
      {
        "Color": "Green",
        "Transform": {
          "posX": -15.1927767,
          "posY": 4.81034231,
          "posZ": 19.787817,
          "rotX": 0.0,
          "rotY": 180.000122,
          "rotZ": 0.0,
          "scaleX": 11.77198,
          "scaleY": 9.174497,
          "scaleZ": 4.87123871
        }
      },
      {
        "Color": "Pink",
        "Transform": {
          "posX": 30.10358,
          "posY": 4.81034231,
          "posZ": -8.449126,
          "rotX": 0.0,
          "rotY": 270.0,
          "rotZ": 0.0,
          "scaleX": 11.655489,
          "scaleY": 9.174497,
          "scaleZ": 4.91999054
        }
      },
      {
        "Color": "Orange",
        "Transform": {
          "posX": -30.247818,
          "posY": 4.81034231,
          "posZ": -8.822588,
          "rotX": 0.0,
          "rotY": 90.0,
          "rotZ": 0.0,
          "scaleX": 11.6555014,
          "scaleY": 9.174497,
          "scaleZ": 4.91999054
        }
      }
    ]
  },
  "Turns": {
    "Enable": false,
    "Type": 0,
    "Tur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YMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgy8DQx5DAABHyNK3wAAAABJRU5ErkJggg==",
  "VectorLines": [],
  "ObjectStates": [
    {
      "Name": "BlockSquare",
      "Transform": {
        "posX": -1.08503517E-08,
        "posY": 1.45999992,
        "posZ": -1.46500874E-08,
        "rotX": -3.889248E-06,
        "rotY": 2.27757346E-06,
        "rotZ": 3.141882E-06,
        "scaleX": 1.0,
        "scaleY": 1.0,
        "scaleZ": 1.0
      },
      "Nickname": "RC Cube",
      "Description": "Tint this block the colour of the owner.\n\nButton 8 is forward,\nButton 6 is right,\nButton 5 is backwards,\nButton 4 is left.\n\nSet these buttons in your configuration to the corresponding NumPad key for the desired effect.",
      "ColorDiffuse": {
        "r": 1.0,
        "g": 1.0,
        "b": 1.0
      },
      "Locked": false,
      "Grid": true,
      "Snap": true,
      "Autoraise": true,
      "Sticky": true,
      "Tooltip": true,
      "GridProjection": false,
      "LuaScript": "--[[\r\nRC CUBE SCRIPT BY MARKIMUS\r\nhttp://steamcommunity.com/id/markipie/\r\n--]]\r\n\r\nrc_car = true\r\n--USED FOR OTHER SCRIPTS TO DETECT WHETHER THIS OBJECT IS A RC_CAR OR NOT.\r\n\r\nmovement_speed = 0.5\r\n\r\nrotate_object_to_pointer = true\r\nrotate_type = 1\r\n--SET THIS TO 1 OR 2. ROTATION TYPE 1 FORCES THE ROTATION, ROTATION TYPE 2 USES TORQUE.\r\n--ROTATE_TYPE 1 IS SLIGHTLY MORE STABLE, THOUGH HAS HARSHER MOVEMENT.\r\n--ROTATE TYPE 2 IS SLIGHTLY LESS STABLE, THOUGH HAS SMOOTHER MOVEMENT.\r\nturn_speed = 100\r\n--ONLY USED WITH ROTATION TYPE 2.\r\n\r\n--DON'T CHANGE ANYTHING UNDER HERE UNLESS YOU KNOW WHAT YOU'RE DOING.\r\n\r\nindexes = {}\r\nindexes[8] = \"forwards\"\r\nindexes[5] = \"backwards\"\r\nindexes[4] = \"left\"\r\nindexes[6] = \"right\"\r\n\r\nmovement = {}\r\nmovement.forwards = false\r\nmovement.right = false\r\nmovement.backwards = false\r\nmovement.left = false\r\n\r\nall_colours = {\"White\", \"Brown\", \"Red\", \"Orange\", \"Yellow\", \"Green\", \"Teal\", \"Blue\", \"Purple\", \"Pink\"}\r\nmy_owner = \"White\"\r\n\r\nfunction onLoad()\r\n    self.static_friction = 0\r\n    self.dynamic_friction = 0\r\nend\r\n\r\nfunction inRange(num1, num2, range)\r\n    if num1 >= num2 - range and num1 <= num2 + range then return true end\r\n    return false\r\nend\r\n\r\nfunction tintSame(tint1, tint2)\r\n    local range = 0.05\r\n    if inRange(tint1.r, tint2.r, range) and inRange(tint1.g, tint2.g, range) and inRange(tint1.b, tint2.b, range) then\r\n        return true\r\n    end\r\n    return false\r\nend\r\n\r\nfunction getOwner()\r\n    local my_tint = self:getColorTint()\r\n    for i, col in pairs(all_colours) do\r\n        if tintSame(stringColorToRGB(col), my_tint) then\r\n            return col\r\n        end\r\n    end\r\nend\r\n\r\nfunction vectRotateRad(vector, rad_rot)\r\n    local new_x = math.cos(rad_rot) * vector.x + math.sin(rad_rot) * vector.z\r\n    local new_z = math.sin(rad_rot) * vector.x * -1 + math.cos(rad_rot) * vector.z\r\n    return {x=new_x, y=vector.y, z=new_z}\r\nend\r\n\r\nfunction getGlobalForce(vector)\r\n    return vectRotateRad(vector, math.rad(Player[my_owner]:getPointerRotation()))\r\nend\r\n\r\nfunction nearestDir(rot)\r\n    while rot >= 180 do\r\n        rot = rot - 360\r\n    end\r\n    while rot < -180 do\r\n        rot = rot + 360\r\n    end\r\n    return rot\r\nend\r\n\r\nrotateCubeToPointer = {}\r\n\r\nrotateCubeToPointer[1] = function()\r\n    local my_rot = self:getRotation()\r\n    local pointer_rot = Player[my_owner]:getPointerRotation()\r\n    self:setRotation({x=my_rot.x, y=pointer_rot, z=my_rot.z})\r\nend\r\n\r\nrotateCubeToPointer[2] = function()\r\n    local my_rot = self:getRotation()\r\n    local pointer_rot = Player[my_owner]:getPointerRotation()\r\n    local rot_diff = nearestDir(pointer_rot - my_rot.y)\r\n    \r\n    if rot_diff < 0 then\r\n        self:addTorque({x=0, y=-turn_speed * (rot_diff/-180), z=0})\r\n    elseif rot_diff > 0 then\r\n        self:addTorque({x=0, y=turn_speed * (rot_diff/180), z=0})\r\n    end\r\nend\r\n\r\nfunction fixedUpdate()\r\n    my_owner = getOwner()\r\n    if my_owner ~= nil and Player[my_owner].seated == true then\r\n        --self:setAngularVelocity({0, 0, 0})\r\n        --local my_rot = self:getRotation()\r\n        \r\n        if rotate_object_to_pointer == true then\r\n            rotateCubeToPointer[rotate_type]()\r\n        end\r\n        \r\n        if movement.forwards == true or movement.backwards == true or movement.left == true or movement.right == true then\r\n            local add_force = {x=0, y=0, z=0}\r\n            if movement.forwards == true then\r\n                add_force.z = add_force.z - movement_speed\r\n            end\r\n            if movement.backwards == true then\r\n                add_force.z = add_force.z + movement_speed\r\n            end\r\n            if movement.left == true then\r\n                add_force.x = add_force.x + movement_speed\r\n            end\r\n            if movement.right == true then\r\n                add_force.x = add_force.x - movement_speed\r\n            end\r\n            self:addForce(getGlobalForce(add_force), 4)\r\n        end\r\n    end\r\nend\r\n\r\nfunction onScriptingButtonDown(index, player_color)\r\n    if indexes[index] ~= nil and player_color == my_owner then\r\n        movement[indexes[index]] = true\r\n    end\r\nend\r\n\r\nfunction onScriptingButtonUp(index, player_color)\r\n    if indexes[index] ~= nil and player_color == my_owner then\r\n        movement[indexes[index]] = false\r\n    end\r\nend\r\n\r\n",
      "LuaScriptState": "",
      "PhysicsMaterial": {
        "StaticFriction": 0.0,
        "DynamicFriction": 0.0,
        "Bounciness": 0.0,
        "FrictionCombine": 0,
        "BounceCombine": 0
      },
      "GUID": "d65613"
    }
  ],
  "DecalPallet": [],
  "TabStates": {
    "0": {
      "title": "Rules",
      "body": "",
      "color": "Grey",
      "visibleColor": {
        "r": 0.5,
        "g": 0.5,
        "b": 0.5
      },
      "id": 0
    },
    "1": {
      "title": "White",
      "body": "",
      "color": "White",
      "visibleColor": {
        "r": 1.0,
        "g": 1.0,
        "b": 1.0
      },
      "id": 1
    },
    "2": {
      "title": "Brown",
      "body": "",
      "color": "Brown",
      "visibleColor": {
        "r": 0.443,
        "g": 0.231,
        "b": 0.09
      },
      "id": 2
    },
    "3": {
      "title": "Red",
      "body": "",
      "color": "Red",
      "visibleColor": {
        "r": 0.856,
        "g": 0.1,
        "b": 0.094
      },
      "id": 3
    },
    "4": {
      "title": "Orange",
      "body": "",
      "color": "Orange",
      "visibleColor": {
        "r": 0.956,
        "g": 0.392,
        "b": 0.113
      },
      "id": 4
    },
    "5": {
      "title": "Yellow",
      "body": "",
      "color": "Yellow",
      "visibleColor": {
        "r": 0.905,
        "g": 0.898,
        "b": 0.172
      },
      "id": 5
    },
    "6": {
      "title": "Green",
      "body": "",
      "color": "Green",
      "visibleColor": {
        "r": 0.192,
        "g": 0.701,
        "b": 0.168
      },
      "id": 6
    },
    "7": {
      "title": "Blue",
      "body": "",
      "color": "Blue",
      "visibleColor": {
        "r": 0.118,
        "g": 0.53,
        "b": 1.0
      },
      "id": 7
    },
    "8": {
      "title": "Teal",
      "body": "",
      "color": "Teal",
      "visibleColor": {
        "r": 0.129,
        "g": 0.694,
        "b": 0.607
      },
      "id": 8
    },
    "9": {
      "title": "Purple",
      "body": "",
      "color": "Purple",
      "visibleColor": {
        "r": 0.627,
        "g": 0.125,
        "b": 0.941
      },
      "id": 9
    },
    "10": {
      "title": "Pink",
      "body": "",
      "color": "Pink",
      "visibleColor": {
        "r": 0.96,
        "g": 0.439,
        "b": 0.807
      },
      "id": 10
    },
    "11": {
      "title": "Black",
      "body": "",
      "color": "Black",
      "visibleColor": {
        "r": 0.25,
        "g": 0.25,
        "b": 0.25
      },
      "id": 11
    }
  },
  "VersionNumber": ""
}