Jump to content

Josh

Staff
  • Posts

    23,332
  • Joined

  • Last visited

Everything posted by Josh

  1. 1.0.2 Updated C++ library with all recent changes. Documentation for exposing C++ classes to Lua is complete. It's a lot to take in, but it covers all the nuances and is very powerful. Use Core::LuaState() instead of the GetLuaState() function in the docs, for now.
  2. 1.0.2 Editor now using Lua with UTF-8 strings File thumbnails are disabled until I rework these No environment maps will be set temporarily and PBR materials will appear darker than normal (file opening bug, there is an error in the DDS loader and I don't know why, probably some low-level file read change...) It looks like the DDS load error is happening with every single DDS file...stay tuned... Fixed! (An integer overload of Max() was returning a double causing the calculated mipmap size to be wrong.) You can see the unicode working if you copy and paste this text into the console and press return to run it: Notify("Message: Unicode❤♻Test", "Title: Unicode❤♻Test")
  3. 1.0.2 Baseline Lua example now works ZenMode module now using light user data for HWND pointer
  4. I think the only way to get that done is to go through all the documentation and write examples for every command. All the information about how Lua works is very explicit in Ultra: https://www.ultraengine.com/learn/Scripting
  5. This Lua code will work right now in the current build of 1.0.2: --Get the displays local displays = GetDisplays() --Create a window local window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[1], WINDOW_CENTER | WINDOW_TITLEBAR) --Create a framebuffer local framebuffer = CreateFramebuffer(window) --Create a world local world = CreateWorld() --Create a camera local camera = CreateCamera(world, 2) camera:SetClearColor(0,0,1,1) camera:SetPosition(0,0,-2) --Create a model local box = CreateBox(world) --Create a light --local light = CreateBoxLight(world) --light:SetRotation(45,35,0) while window:KeyDown(KEY_ESCAPE) == false and window:Closed() == false do --Rotate the model box:Turn(0,0.1,0) --Update the world world:Update() --Render the world to the framebuffer world:Render(framebuffer) end And this shows how the C++ side is set up: https://github.com/UltraEngine/Documentation/blob/master/CPP/PollDebugger.md
  6. 1.0.2 All recent changes are now available in the C++ library Updated C++ library to Lua 5.4.4 Added some system Lua files in the game template Added PollDebugger() function Added .vscode folder in game template for development with VSCode @CanardiaPrint() now takes an optional bool for the line return. This function does not attempt to be thread-safe in any way!
  7. This shows how Lua scripting in the editor works:
  8. 1.0.2 Updated editor to Lua 5.4.4 and everything seems to work fine. This adds a utf8 library, bitwise operations, constants, integers, to-be-closed variables, and goto. See here for details, previous version was Lua 5.1: https://www.lua.org/versions.html#5.4 A copy of Lua is available here for building modules.
  9. 1.0.2 Did a lot of work on editor Lua debugging and it works really well now. I recommend doing an uninstall / reinstall of version 1.0.2 to clear out the scripts.
  10. This was a bug in the way the window position was saved. I fixed this in the latest build.
  11. Update 1.0.2 In-editor Lua debugging now works with Visual Studio Code: Run VSCode Select the File > Open Folder menu item Open your Ultra Engine install directory (C:/Program Files/Ultra Engine) When prompted, install the Lua debugger extension. (Devcat Lua Debugger) Select the Debug option in the left-side panel and press the run button. Or just select the "Scripting > Open Editor Folder in Visual Studio Code" menu item. You can set breakpoints and examine variables when they are hit and step through the code. Set a breakpoint in one of the Lua files in "Scripts/Start/Extensions".
  12. Updated 1.0.2 Editor Added EVENT_ERROR which gets triggered in a RuntimeEvent. EmitEvent now returns a boolean. See docs for explanation. Fixed bug in WAV loader Modules (Lua DLLs) now stored in Scripts/Modules Added some critical system scripts in Scripts/Start/System Editor will now remember window position I recommend uninstalling and reinstalling version 1.0.2. Not the whole client, just the install process in the client. It only takes a minute and it will get rid of some scripts that I moved. This prepares for Lua debugging of the editor from VSCode. I haven't run the Lua debugger in a long time but I think it will all work to allow debugging of editor extensions.
  13. This will give you a better idea of how editor scripting works: https://www.ultraengine.com/learn/EditorEvents?lang=lua The editor emits a lot of extra events to trigger actions. You can intercept these events and override them or add your own functionality. For example, you could intercept the EVENT_OPENASSET event and make a script file open in a new script editor interface.
  14. Did you try deleting Documents / Ultra Engine / Settings.json?
  15. Is this win 10 or 11?
  16. Updated 1.0.2 Lua listeners will now be executed in such a way that errors will be shown Added PreviewSound.lua extension, which plays a WAV file when the popup preview window is displayed
  17. Example: https://www.ultraengine.com/learn/LoadMaterial?lang=lua
  18. This works: RewriteCond %{QUERY_STRING} ^lang=lua$ RewriteRule "^learn/(.+)$" "learn.php?page=$1&lang=lua" RewriteCond %{QUERY_STRING} ^lang=cs RewriteRule "^learn/(.+)$" "learn.php?page=$1&lang=cs" RewriteCond %{QUERY_STRING} ^lang=cpp RewriteRule "^learn/(.+)$" "learn.php?page=$1&lang=cpp" RewriteRule "^learn/(.+)$" "learn.php?page=$1"
  19. I am using this .ntaccess rewrite rule to prettify the documentation URLs: RewriteRule "^learn/(.+)$" "learn.php?page=$1" This makes it so the URL "https://www.ultraengine.com/learn/Entity" gets treated as "https://www.ultraengine.com/learn?page=Entity". However, if I have trailing arguments like "?lang=lua" they get omitted from the redirected URL. How can I add those into the rewrite rule? I want to use a URL like this: https://www.ultraengine.com/learn/Entity?lang=lua
  20. The client app has been updated: https://github.com/UltraEngine/ultraengine.github.io/raw/main/files/UltraClient.exe When you click on a project it will now be opened in the editor If the editor is already open, the client will send a message to the already opened instance, and it will switch to the new folder You can open the project folder by clicking on the new folder icon Shortcuts for the editor will be created on the desktop and in the start menu The gear icon has a little bit of shading on the gear now, which I think looks better Fixes file copy bug in project sync system Also note the name of the client app is now "Client.exe" and the editor is "Editor.exe".
  21. This is the best way to do this: struct EnumWindowInfo { int messageid; WString procname, title; shared_ptr<Buffer> data; shared_ptr<Window> source; bool result; }; BOOL CALLBACK EnumWindowsProc(_In_ HWND hwnd, _In_ LPARAM lParam) { const int MAX_NAME = 2048; auto info = (EnumWindowInfo*)lParam; WString path; path.resize(MAX_NAME); std::fill(path.begin(), path.end(), 0); int sz = GetWindowTextW(hwnd, (LPWSTR)path.c_str(), path.size()); if (0 == sz) { auto err = GetLastError(); return true; } path.resize(sz); //Print(path); if (path != info->title) return true; DWORD lpdwProcessId = 0; auto threadID = GetWindowThreadProcessId(hwnd, &lpdwProcessId); HANDLE proc = OpenProcess(PROCESS_ALL_ACCESS, TRUE, lpdwProcessId); path.resize(MAX_NAME); auto len = GetModuleFileNameExW(proc, NULL, (LPWSTR)path.c_str(), path.size()); CloseHandle(proc); path.resize(len); if (StripDir(path) == info->procname) { COPYDATASTRUCT copydata; copydata.dwData = info->messageid; copydata.cbData = info->data->GetSize(); copydata.lpData = info->data->Data(); HWND srchwnd = 0L; if (info->source) srchwnd = info->source->GetHandle(); ShowWindow(hwnd, SW_RESTORE); SendMessageW(hwnd, WM_COPYDATA, (LPARAM)srchwnd, (LPARAM)&copydata); SetForegroundWindow(hwnd); SetActiveWindow(hwnd); SetFocus(hwnd); info->result = true; return false; } return true; } bool SendWindowData(shared_ptr<Window> source, const WString& title, const WString& processname, const int messageid, shared_ptr<Buffer> data) { EnumWindowInfo info; info.title = title; info.result = false; info.procname = processname; info.data = data; info.messageid = messageid; EnumWindows(EnumWindowsProc, (LPARAM)&info); return info.result; }
  22. I did not know that VMs now even support 3D graphics. That was not the case a few years ago. What program do you use for the VM?
  23. Also made a small improvement...when rendering the selection outline, the backfaces all get rendered, so the selection includes those:
  24. This command is part of the dynamic render Vulkan extension: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdBeginRenderingKHR.html This is core in Vulkan 1.3.
×
×
  • Create New...