Jump to content

Josh

Staff
  • Posts

    26,090
  • Joined

  • Last visited

Profile Information

  • Location
    USA

Recent Profile Visitors

1,521,663 profile views

Josh's Achievements

Grand Master

Grand Master (14/14)

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

Recent Badges

16.5k

Reputation

1.1k

Community Answers

  1. That should be inside the Start() function.
  2. In your component, do this: local camera = Camera(self.entity) if camera ~= nil then camera:SetTessellation(4) end
  3. I just paid for a 3060 and I will go pick it up today.
  4. User was entering wrong password.
  5. Can you please send me a private message with your account password? The window close behavior was intentional, but since people find it confusing I will change this.
  6. Enable refraction and tessellation on the game camera by adding those commands to the code.
  7. #include <windows.h> #include <shellapi.h> #define WM_TRAYICON (WM_USER + 1) #define ID_TRAY_APP_ICON 1001 #define ID_MENU_EXIT 101 #define ID_MENU_OPTION1 102 #define ID_MENU_OPTION2 103 // Global variables NOTIFYICONDATA nid; HMENU hPopupMenu; // Forward declarations LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); int WINAPI main(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { // Register window class WNDCLASS wc = { 0 }; wc.lpfnWndProc = WndProc; wc.hInstance = hInstance; wc.lpszClassName = L"TrayAppClass"; RegisterClass(&wc); // Create window (hidden) HWND hwnd = CreateWindow(wc.lpszClassName, L"TrayApp", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 300, 200, NULL, NULL, hInstance, NULL); // Initialize NOTIFYICONDATA ZeroMemory(&nid, sizeof(nid)); nid.cbSize = sizeof(NOTIFYICONDATA); nid.hWnd = hwnd; nid.uID = ID_TRAY_APP_ICON; nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP; nid.uCallbackMessage = WM_TRAYICON; // Load icon HICON hIcon = LoadIcon(NULL, IDI_APPLICATION); nid.hIcon = hIcon; // Set tooltip lstrcpy(nid.szTip, L"My Tray Icon"); // Add icon to system tray Shell_NotifyIcon(NIM_ADD, &nid); // Create popup menu hPopupMenu = CreatePopupMenu(); AppendMenu(hPopupMenu, MF_STRING, ID_MENU_OPTION1, L"Option 1"); AppendMenu(hPopupMenu, MF_STRING, ID_MENU_OPTION2, L"Option 2"); AppendMenu(hPopupMenu, MF_SEPARATOR, 0, NULL); AppendMenu(hPopupMenu, MF_STRING, ID_MENU_EXIT, L"Exit"); // Message loop MSG msg; while (GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } // Cleanup Shell_NotifyIcon(NIM_DELETE, &nid); DestroyIcon(hIcon); DestroyMenu(hPopupMenu); return (int)msg.wParam; } LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_TRAYICON: { if (lParam == WM_LBUTTONUP) { // Left click - optional: show message or do something } else if (lParam == WM_RBUTTONUP) { // Right click - show context menu POINT pt; GetCursorPos(&pt); SetForegroundWindow(hwnd); // Needed for menu to work properly TrackPopupMenu(hPopupMenu, TPM_RIGHTBUTTON, pt.x, pt.y, 0, hwnd, NULL); } break; } case WM_COMMAND: { switch (LOWORD(wParam)) { case ID_MENU_OPTION1: MessageBox(NULL, L"Option 1 selected", L"Info", MB_OK); break; case ID_MENU_OPTION2: MessageBox(NULL, L"Option 2 selected", L"Info", MB_OK); break; case ID_MENU_EXIT: PostMessage(hwnd, WM_CLOSE, 0, 0); break; } break; } case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hwnd, uMsg, wParam, lParam); } return 0; }
  8. Josh

    VR Game

    1 download

    This is a small detailed scene for VR testing. Some included models are licensed CC-BY.
    Free
  9. 5 downloads

    This scene provides a game level for a fun and exciting first person shooter. It includes many scripted events and nice visuals. Some models included are licensed CC-BY.
    Free
  10. The updated editor is available now.
  11. In new build going up in a few minutes: UV coords of prefab brushes never change. Face tool does not work on prefab brushes. Vertex tool does not work on prefab brushes. Carve and hollow do not work on prefab brushes. I am only updating the editor right now. You won't see the change in-game until I make a full update.
  12. #include "Leadwerks.h" #include "Steamworks/Steamworks.h" using namespace Leadwerks; void ExecuteDir(std::shared_ptr<Package> package, const WString& path, const bool recursive) { std::vector<WString> dir; int type; if (package) { dir = package->LoadDir(path); } else { dir = LoadDir(path); } for (auto file : dir) { WString filepath = path + "/" + file; auto ext = Leadwerks::ExtractExt(file).Lower(); if (package) { type = package->FileType(filepath); } else { type = FileType(filepath); } switch (type) { case 1: if (ext == "lua" or ext == "luac") { RunScript(filepath); } break; case 2: if (recursive) ExecuteDir(package, filepath, true); break; } } } int main(int argc, const char* argv[]) { //Get commandline settings auto settings = ParseCommandLine(argc, argv); auto L = GetLuaState(); Steamworks::BindCommands(L); L->set_function("CommandLine", [settings]() { return tableplusplus::tablewrapper(settings); }); //Load packages auto dir = LoadDir(""); std::shared_ptr<Package> datapackage; if (FileType("data.zip") == 1) { datapackage = LoadPackage("data.zip"); } //Run the error handler script RunScript("Source/System/ErrorHandler.lua"); //Enable the integrated debugger if needed if (settings["debugport"].is_integer()) { int debugport = settings["debugport"]; int debugtimeout = 10000; int debuglevels = 4; String breakpoints; if (settings["debugport"].is_integer()) debugport = settings["debugport"]; if (settings["debugtimeout"].is_integer()) debugtimeout = settings["debugtimeout"]; if (settings["debuglevels"].is_integer()) debuglevels = settings["debuglevels"]; if (settings["breakpoints"].is_string()) breakpoints = settings["breakpoints"]; if (ConnectDebugger(debugport, debugtimeout, debuglevels, breakpoints)) { Print("Connected to debugger on port " + String(debugport)); } else { Print("Error: Failed to connect to debugger on port " + String(debugport) + " after " + String(debugtimeout) + " milliseconds"); } } //Enable the Visual Studio debugger if needed shared_ptr<Timer> debugtimer; if (settings["debug"].is_boolean() and settings["debug"] == true) { RunScript("Source/System/Debugger.lua"); debugtimer = CreateTimer(510); ListenEvent(EVENT_TIMERTICK, debugtimer, std::bind(PollDebugger, 500)); } //Run the component system helper RunScript("Source/System/ComponentSystem.lua"); //Run user start scripts ExecuteDir(datapackage, "Source/Start", false); //Run component scripts dir = LoadDir("Source/Components"); for (auto file : dir) { int type; if (datapackage) { type = datapackage->FileType("Source/Components/" + file); } else { type = FileType("Source/Components/" + file); } if (type == 2) { ExecuteDir(datapackage, "Source/Components/" + file, false); } } //Run main script RunScript("Source/main.lua"); return 0; }
  13. It's more than just the UV coords. Any changes to brushes loaded from prefabs will get discarded when the scene is reloaded. I'm not sure if brushes should even be treated as prefabs at all. This seems like two contradictary goals.
  14. BTW, the reason your project takes so long to compile is because every file is set to create a precompiled header. Only Leadwerks.cpp should have this set to Create. Every other file should be set to Use, or for SelectDevice.cpp, "Not using precompiled header".
×
×
  • Create New...