Compare commits

...

3 Commits

Author SHA1 Message Date
teverse 74fd691997 hello world 2019-11-17 11:55:45 +00:00
teverse 15e78c5805 DEMO GAME: disable default loaders (new to 0.10.0) 2019-11-17 11:54:42 +00:00
teverse 2a8d389598 begun demo game 2019-11-17 11:38:50 +00:00
7 changed files with 412 additions and 33 deletions

View File

@ -0,0 +1 @@
print("Hello Client!")

393
demos/multiplayer/game.tev Normal file
View File

@ -0,0 +1,393 @@
{
"className": "engine",
"version": "Debug 0.10.0",
"gameCloudId": "",
"children": [
{
"name": "sounds",
"className": "sounds"
},
{
"ambientColour": [
0.92156863212585,
0.92156863212585,
0.92156863212585
],
"className": "graphics",
"name": "graphics",
"clearColour": [
0.21960784494877,
0.21960784494877,
0.258823543787
]
},
{
"children": [
{
"fov": 80,
"position": [
11,
5,
10
],
"className": "camera",
"name": "camera",
"rotation": [
-0.065341390669346,
0.90250700712204,
-0.1477076113224,
-0.39924192428589
]
},
{
"rotation": [
0.54463905096054,
0,
0,
0.83867055177689
],
"position": [
3,
2,
0
],
"power": 1,
"specularColour": [
1,
1,
1
],
"shadowNearClip": 0.2,
"radius": 11,
"shadowFarClip": 1000,
"lumThreshold": 0.01,
"className": "light",
"type": 0,
"shadows": false,
"falloff": 1,
"diffuseColour": [
1,
1,
1
],
"name": "mainLight",
"shadowFarDistance": 500
},
{
"velocity": [
0,
0,
0
],
"rotation": [
0,
0,
0,
1
],
"emissiveColour": [
0,
0,
0
],
"linearFactor": [
1,
1,
1
],
"friction": 0.5,
"mesh": "primitive:cube",
"restitution": 0,
"spinningFriction": 0,
"workshopLocked": true,
"colour": [
0.60000002384186,
0.60000002384186,
0.60000002384186
],
"name": "basePlate",
"roughness": 0,
"size": [
100,
1,
100
],
"position": [
0,
-1,
0
],
"renderQueue": 0,
"physics": true,
"angularFactor": [
1,
1,
1
],
"metalness": 0,
"static": true,
"rollingFriction": 0,
"className": "block",
"linearDamping": 0,
"castsShadows": false,
"angularDamping": 0,
"wireframe": false,
"angularVelocity": [
0,
0,
0
],
"opacity": 1
},
{
"velocity": [
0,
0,
0
],
"rotation": [
0,
0,
0,
1
],
"emissiveColour": [
0,
0,
0
],
"linearFactor": [
1,
1,
1
],
"friction": 0.5,
"mesh": "primitive:cube",
"restitution": 0,
"spinningFriction": 0,
"workshopLocked": false,
"colour": [
1,
0,
0
],
"name": "redBlock",
"roughness": 0,
"size": [
1,
1,
1
],
"position": [
0,
0,
0
],
"renderQueue": 0,
"physics": true,
"angularFactor": [
1,
1,
1
],
"metalness": 0,
"static": true,
"rollingFriction": 0,
"className": "block",
"linearDamping": 0,
"castsShadows": false,
"angularDamping": 0,
"wireframe": false,
"angularVelocity": [
0,
0,
0
],
"opacity": 1
},
{
"velocity": [
0,
0,
0
],
"rotation": [
0,
0.70710676908493,
0,
0.70710676908493
],
"emissiveColour": [
0,
0,
0
],
"linearFactor": [
1,
1,
1
],
"friction": 0.5,
"mesh": "primitive:wedge",
"restitution": 0,
"spinningFriction": 0,
"workshopLocked": false,
"colour": [
0,
1,
0
],
"name": "greenBlock",
"roughness": 0,
"size": [
1,
1,
1
],
"position": [
1,
0,
0
],
"renderQueue": 0,
"physics": true,
"angularFactor": [
1,
1,
1
],
"metalness": 0,
"static": true,
"rollingFriction": 0,
"className": "block",
"linearDamping": 0,
"castsShadows": false,
"angularDamping": 0,
"wireframe": false,
"angularVelocity": [
0,
0,
0
],
"opacity": 1
},
{
"velocity": [
0,
0,
0
],
"rotation": [
0,
0,
0,
1
],
"emissiveColour": [
0,
0,
0
],
"linearFactor": [
1,
1,
1
],
"friction": 0.5,
"mesh": "primitive:sphere",
"restitution": 0,
"spinningFriction": 0,
"workshopLocked": false,
"colour": [
0,
0,
1
],
"name": "blueBlock",
"roughness": 0,
"size": [
1,
1,
1
],
"position": [
0.5,
1,
0
],
"renderQueue": 0,
"physics": true,
"angularFactor": [
1,
1,
1
],
"metalness": 0,
"static": true,
"rollingFriction": 0,
"className": "block",
"linearDamping": 0,
"castsShadows": false,
"angularDamping": 0,
"wireframe": false,
"angularVelocity": [
0,
0,
0
],
"opacity": 1
}
],
"className": "workspace",
"name": "workspace"
},
{
"children": [
{
"children": [
{
"children": [
{
"autoRun": true,
"className": "script",
"source": "require('tevgit:demos/multiplayer/client.lua')",
"name": "clientLoader"
}
],
"name": "client",
"className": "luaClientFolder"
},
{
"children": [
{
"autoRun": true,
"className": "script",
"source": "require('tevgit:demos/multiplayer/server.lua')",
"name": "serverLoader"
}
],
"className": "luaServerFolder",
"name": "server"
},
{
"name": "shared",
"className": "luaSharedFolder"
}
],
"disableDefaultLoaders": true,
"className": "luaFolder",
"name": "lua"
}
],
"className": "assetsFolder",
"name": "assets"
},
{
"name": "interface",
"className": "interface"
}
],
"savedBy": "Jay",
"name": "teverse",
"signature": "unsigned"
}

View File

@ -0,0 +1 @@
print("Hello Server!")

View File

@ -8,6 +8,7 @@ local boundingBox = engine.construct("block", workspace, {
static = true,
physics = false,
workshopLocked = true,
doNotSerialise = true,
position = vector3(0, -100, 0)
})

View File

@ -9,13 +9,12 @@ local ui = require("tevgit:workshop/controllers/ui/core/ui.lua")
-- use a table of two icons,
-- [1] will be unexpanded and [2] will be used when the obj is expanded.
local overridingIcons = {
scriptSource = "fa:s-file-code",
scriptContainer = "fa:s-microchip",
script = "fa:s-file-code",
input = {"fa:s-keyboard", "fa:r-keyboard"},
debug = "fa:s-bug",
light = "fa:s-lightbulb",
block = "fa:s-cube",
camera = "fa:s-camera"
camera = "fa:s-camera",
}
-- dictionary of buttons to their corrosponding objects.
@ -68,7 +67,7 @@ local function updatePositions(frame)
else
-- object has no children
frame.icon.texture = regularIconWithOutChildren
frame.icon.imageAlpha = .2
frame.icon.imageAlpha = 0.5
frame.textAlpha = .6
frame.fontFile = "local:OpenSans-Regular.ttf"
end
@ -76,7 +75,7 @@ local function updatePositions(frame)
-- object is expanded
frame.textAlpha = 0.6
frame.fontFile = "local:OpenSans-Regular.ttf"
frame.icon.imageAlpha = 0.4
frame.icon.imageAlpha = 0.75
frame.icon.texture = expandedIcon
end
@ -188,8 +187,9 @@ local function createHierarchyButton(object, guiParent)
btn:once("destroying", function() childAddedEvent:disconnect() end)
if object:isA("luaSharedFolder") or object:isA("luaServerFolder") or
object:isA("luaClientFolder") then
if object:isA("luaSharedFolder")
or object:isA("luaServerFolder")
or object:isA("luaClientFolder") then
context.bind(btn, {
{name = "Add Script", callback = function() engine.construct("script", object) end}
})
@ -200,10 +200,10 @@ local function createHierarchyButton(object, guiParent)
end
controller.window = ui.window(shared.workshop.interface, "Hierarchy",
guiCoord(0, 260, 0, 400), -- size
guiCoord(1, -260, 0.75, -25), -- pos
true, -- dockable
true -- hidable
guiCoord(0, 260, 0, 400), -- size
guiCoord(1, -260, 0.75, -25), -- pos
true, -- dockable
true -- hidable
)
controller.window.visible = true

View File

@ -189,26 +189,6 @@ createInputs = {
return container
end,
scriptSource = function(instance, property, value)
local container = createInputs.default(value, pType, readOnly)
local presetSelect = ui.create("guiTextBox", container, {
size = guiCoord(1, -4, 0, 16),
position = guiCoord(0, 2, 0, 2),
borderRadius = 3,
text = "Edit Source",
fontSize = 16,
align = enums.align.middle,
backgroundAlpha = 0.75
}, "primary")
presetSelect:mouseLeftReleased(function ()
if instance[property] then
instance[property]:editExternal()
end
end)
return container
end,
string = function(instance, property, value)
local container = createInputs.default(value, pType, readOnly)
@ -216,13 +196,15 @@ createInputs = {
backgroundAlpha = 0.25,
readOnly = false,
multiline = false,
wrapped = true,
fontSize = 18,
name = "input",
size = guiCoord(1, -4, 0, 18),
position = guiCoord(0, 2, 0, 1),
text = "text input",
align = enums.align.middleLeft,
zIndex = 2
zIndex = 2,
cropChildren = true
}, "primary")
x:textInput(function ()

View File

@ -37,7 +37,8 @@ local function alphabeticalSorter(a, b) return a.property < b.property end
local excludePropertyList = {
physics = true, -- letting user changes this will break raycasts
doNotSerialise = true
doNotSerialise = true,
source = true
}
function controller.generateProperties()