Jump to content

Josh

Staff
  • Posts

    26,646
  • Joined

  • Last visited

Profile Information

  • Location
    USA

Recent Profile Visitors

1,526,328 profile views

Josh's Achievements

Grand Master

Grand Master (14/14)

  • Well Followed
  • Dedicated
  • Conversation Starter
  • Reacting Well
  • Problem Solver

Recent Badges

17.1k

Reputation

1.2k

Community Answers

  1. Josh

    SCP [Redacted]

    I am happy to show you the game I am working on, together with @reepblue and @Rich D: More information can be found here:
  2. Yes, the commands support this.
  3. Useful Lua example here: -- Get the display list local displays = GetDisplays() -- Create a window local window = CreateWindow("Leadwerks", 0, 0, 1280 * displays[1].scale, 720 * displays[1].scale, displays[1], WINDOW_CENTER + WINDOW_TITLEBAR) -- Create a world local world = CreateWorld() -- Create a framebuffer local framebuffer = CreateFramebuffer(window) -- Create a camera local camera = CreateCamera(world) camera:SetFov(70) camera:SetPosition(0, 100, -100) camera:SetRotation(45, 0, 0) camera:SetClearColor(0.125) -- Sunlight local light = CreateDirectionalLight(world) light:SetRotation(45, 35, 0) -- Create terrain local terrain = CreateTerrain(world, 512, 512) local mtl1 = CreateMaterial() mtl1:SetColor(1,0,0) local mtl2 = CreateMaterial() mtl2:SetColor(0,1,0) local mtl3 = CreateMaterial() mtl3:SetColor(0,0,1) local mtl4 = CreateMaterial() mtl4:SetColor(1,0,1) local layer1 = terrain:AddLayer(mtl1) local layer2 = terrain:AddLayer(mtl2) local layer3 = terrain:AddLayer(mtl3) local layer4 = terrain:AddLayer(mtl4) local x local y for x = 0, 256 do for y = 0, 256 do terrain:SetLayerWeight(layer1, x, y, 1.0) end end for x = 256, 512 do for y = 0, 256 do terrain:SetLayerWeight(layer2, x, y, 1.0) end end for x = 0, 256 do for y = 256, 512 do terrain:SetLayerWeight(layer3, x, y, 1.0) end end for x = 256, 512 do for y = 256, 512 do terrain:SetLayerWeight(layer4, x, y, 1.0) end end -- Camera controls camera:AddComponent(CameraControls) local rect = CreateTile(camera, 100, 100) function GetTerrainMaterialAtPoint(terrain, point) point = TransformPoint(point, nil, terrain) x = Round(point.x + terrain.resolution.x / 2) y = Round(point.z + terrain.resolution.y / 2) x = Clamp(x, 0, terrain.resolution.x - 1) y = Clamp(y, 0, terrain.resolution.y - 1) --Print(tostring(x)..", "..tostring(y)) local layers = terrain:GetLayers(x, y) if #layers > 0 then return terrain:GetLayerMaterial(layers[1]) end return terrain:GetLayerMaterial(1) end -- Main loop while not window:Closed() and not window:KeyDown(KEY_ESCAPE) do window:SetMousePosition(framebuffer.size.x / 2, framebuffer.size.y / 2) if window:MouseDown(MOUSE_LEFT) then local pick = camera:Pick(framebuffer, framebuffer.size.x / 2, framebuffer.size.y / 2, 0, true) if pick.entity == terrain then local mtl = GetTerrainMaterialAtPoint(terrain, pick.position) if mtl ~= nil then local color = mtl:GetColor() rect:SetColor(color) else rect:SetColor(1,1,1) end end end world:Update() world:Render(framebuffer) end
  4. We do not have built-in support for aircraft dynamics. Vehicle physics are currently not support, although this is something I want to add in ASAP. I have some code that produces really nice results, but I just need to spend a month or so integrating it. Moving between different versions is a challenge in any engine, but I can definitely say our API and system is a lot more stable than what I have seen in Unreal. There will be some major shader changes in Leadwerks 5.1, but this will only affect custom shaders. For everyone else, the update will be seamless, as long as they just update the project with the latest shader files.
  5. That's not correct. The installer application is available to download here, and your account can log in and use the software: https://www.leadwerks.com/files/LeadwerksClient.exe
  6. Thia is a great idea. We can already hide and show the vegetation layers, so why not?
  7. Currently, there's not really any way to do this. I think it would be very useful information to have, so I will figure out something here.
  8. In the model editor interface, you can use the File > Load Animation menu item to load an animation from another file. Note that the model hierarchy must match exactly for this to work.
  9. This is the layered image for the current banner. Might be useful to someone in the future. The background was generated / created by @Yue launchparty.zip
      • 1
      • Like
  10. The way it's set up in the sample project, the editor passes a command-line switch to the game called devmode. When this is encountered, the game automatically launched into a 1280x720 window (multiplied by the Windows DPI scaling value). The idea here is that if you are launching from the editor, you probably want to be able to switch back and forth between the editor quickly, either for rapid playtesting or for using the debugger. This code is all found around line 65 of the code file "Scripts/Game/Game.lua".
  11. Cast the entity to a model, and then call the Animate method: function MyScript:Start() local model = Model(self) if model ~= nil then model:Animate("walk") end end https://www.leadwerks.com/learn/Model_Animate?lang=lua
  12. I will sort this out...
  13. Thank you for the report. (First posts have to be manually approved to prevent the forum from getting flooded with spam.)
  14. I think I will probably end up getting rid of this requirement, and go back to using a Visual Studio property sheet where the path is stored. It's just easier not to have that information stored somewhere else.
  15. Hmmm, I don't think that is possible right now.
×
×
  • Create New...