All Activity
- Today
-
reepblue started following Command Line not applying in Project Settings
-
I don't think the command line arguments is being applied anymore. The editor always seems to apply the map and devmode. if you do anything else or just delete the default, no changes happen. Here's an updated main.cpp to demonstrate the issue. Add +test "cool" to the command line arguments in the Project Settings and the window titlebar should change. #include "Leadwerks.h" #include "ComponentSystem.h" #include "Encryption.h" #include "Game/Game.h" #include "Game/GameMenu.h" #include "CustomEvents.h" //#include "Steamworks/Steamworks.h" using namespace Leadwerks; int main(int argc, const char* argv[]) { #ifdef STEAM_API_H if (not Steamworks::Initialize()) { RuntimeError("Steamworks failed to initialize."); return 1; } #endif Game::commandline = ParseCommandLine(argc, argv); Game::Initialize(); //Load packages std::vector<std::shared_ptr<Package> > packages; auto dir = LoadDir(""); String password; GetPassword(password); for (auto file : dir) { if (ExtractExt(file).Lower() == "zip") { auto pak = LoadPackage(file); if (pak) { if (not password.empty()) { pak->SetPassword(password); pak->Restrict(); } packages.push_back(pak); } } } password.Clear(); RegisterComponents();// Call this after packages are loaded auto mainmenu = CreateGameMenu(); mainmenu->AddPostEffect("Bloom", "Effects/Bloom.fx", true); mainmenu->AddPostEffect("SSAO", "Effects/SSAO.fx"); mainmenu->AddPostEffect("Auto-exposure", "Effects/AutoExposure.fx"); mainmenu->AddPostEffect("Volumetric Lighting", "Effects/VolumetricLighting.fx"); //Load the map if (Game::commandline["map"].is_string()) { String mapname = Game::commandline["map"]; Game::scene = LoadMap(Game::world, mapname); if (Game::scene) { mainmenu->ApplyCameraSettings(); mainmenu->SetHidden(true); Game::window->SetCursor(CURSOR_NONE); mainmenu->newgamebutton->SetText("Resume Game"); } } if (Game::commandline["test"].is_string()) { String s = Game::commandline["test"]; Game::window->SetText(s); } //Main loop while (true) { Game::world->Update(); bool vsync = true; if (Game::settings["video"]["vsync"].is_boolean() and Game::settings["video"]["vsync"] == false) vsync = false; Game::world->Render(Game::framebuffer, vsync); while (PeekEvent()) { // Get the next event auto event = WaitEvent(); // Change the scene if (event.id == EVENT_CHANGELEVEL) { WString mapfile = "Maps/start.map"; if (not event.text.empty()) mapfile = event.text; Game::scene = LoadScene(Game::world, mapfile); if (Game::scene) { mainmenu->ApplyCameraSettings(); mainmenu->SetHidden(true); mainmenu->newgamebutton->SetText("Resume Game"); Game::world->Resume(); Game::window->FlushKeys(); Game::window->FlushMouse(); Game::window->SetCursor(CURSOR_NONE); } else { mainmenu->SetHidden(false); Game::window->SetCursor(CURSOR_DEFAULT); } } // Exit the program if Alt + F4 is pressed else if (event.id == EVENT_QUIT) { goto Exit; } // Exit the program when window is closed else if (event.id == EVENT_WINDOWCLOSE && event.source == Game::window) { goto Exit; } // Pause the game else if (event.id == EVENT_WORLDPAUSE) { Game::window->SetCursor(CURSOR_DEFAULT); } // Resume the game else if (event.id == EVENT_WORLDRESUME) { Game::window->SetCursor(CURSOR_NONE); Game::window->FlushKeys(); Game::window->FlushMouse(); } // Detect first rendered frame else if (event.id == EVENT_STARTRENDERER) { if (event.data == 1) { // Renderer initialized successfully Print(event.text); Game::window->SetHidden(false); Game::window->Activate(); } else { // Renderer failed to initialize Print("Error: Failed to initialize renderer"); Print(event.text); goto Exit; } } } #ifdef STEAM_API_H Steamworks::Update(); #endif } Exit: Game::SaveSettings(); #ifdef STEAM_API_H Steamworks::Shutdown(); #endif return 0; }
-
- 1
-
-
OlR started following Button Widget keeps firing EVENT_MOUSEENTER
-
On the attached project I setup a interface with some buttons on the GameUi.lua, this interface has a listener on one of its buttons for the EVENT_MOUSEENTER and EVENT_MOUSELEAVE events. When the mouse enters the area of the button it keeps firing non stop the EVENT_MOUSEENTER event while the mouse is moving inside the button area. I've tested this for different buttons and different widgets and looks like only buttons has this behavior. Below I've sent my project attached and video evidence AuroraStudy.zip
-
When you say "it" do you mean the call to Entity:SetInput?
-
I think it's because something happens with the entity's SetInput for the character controller. If I put it before the render, the controller breaks with the character's mesh visible, and if I put it after the render, the case separates. My Code. --################################################################################## --## Project : Astrocuco. --## Scripter : Yue Rexie. --## File : CInv.lua. --################################################################################### --## Notes : The object is instantiated. --################################################################################### CInv = {} CInv.__index = CInv function CInv:New(meshPlayer) local this = setmetatable({}, self) local world = meshPlayer:GetWorld() local player = meshPlayer local headBone = player.skeleton:FindBone("Head", true) local helmet = LoadModel(world, "Models/Player/Helmet/Helmet.mdl") helmet:SetHidden(false) helmet:SetPosition(0,-0.1,-0.05) helmet.name = "Helmet" helmet:Attach(player,headBone) local backBone = player.skeleton:FindBone("Spine2", true) local backpack = LoadModel(world, "Models/Player/Backpack/Backpack.mdl") backpack:SetHidden(false) backpack:SetPosition(0,-0.1,0.15) backpack.name = "Backpack" backpack:Attach(player,backBone) local elbowBoneL = player.skeleton:FindBone("LeftForeArm", true) local tablet = LoadModel(world, "Models/Player/Tablet/Tablet.mdl") tablet:SetHidden(false) tablet:SetPosition(0.1,0.04,0,false) tablet:SetRotation(-5,5,0) tablet.name = "Tablet" tablet:Attach(player,elbowBoneL) function this:Update() headBone:SetScale(0.85,0.85,0.85) backBone:SetScale(1,1,1) elbowBoneL:SetScale(1,1,1) end function this:GetHelmet() return helmet end function this:GetBackpack() return backpack end function this:GetTablet() return tablet end return this end It's strange because the only way to fix it is to put it in the loop that scales the bones, and that solves it.
- Yesterday
-
Ah, okay. So when you hit enter after delete, no change in the text is detected...
-
Yes works but only if you use [Backspace] key. Try it delete selected text with key [DEL] then is deleted text only in textfield name and when you press [ENTER], name of entity is not changed to current text in textfierld name.
-
SebastianLämsä joined the community
- Last week
-
Movement Controller Intermittent Physics Issues + Slope Handling Problems
Josh replied to vega's topic in Bug Reports
I will close this since there is no map file to try. If the problem persists please upload a file in a new thread. Thank you. -
Josh started following CAMERAS in scene ... ( set name | active ) and Attach Bone possible bug
-
If you put what before the render? Entity:Attach() only needs to be called once. I tried producing this error but even at 60 meters per second, there is only some small floating point fluttering, nothing like you showed in your video on Discord: #include "Leadwerks.h" using namespace Leadwerks; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Leadwerks", 0, 0, 1280 * displays[0]->scale, 720 * displays[0]->scale, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a world auto world = CreateWorld(); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetFov(70); camera->Move(0, 2, -8); //Create light auto light = CreateBoxLight(world); light->SetRotation(45, 35, 0); light->SetRange(-10, 10); //Model by PixelMannen //https://opengameart.org/content/fox-and-shiba auto model = LoadModel(world, "https://github.com/Leadwerks/Documentation/raw/master/Assets/Models/Characters/Fox.glb"); model->SetScale(0.05); model->Animate(1); model->SetRotation(0, -90, 0); auto neck = model->skeleton->FindBone("b_Neck_04"); auto head = model->skeleton->FindBone("b_Head_05"); Vec3 rotation; //Model by alissvetlana //https://sketchfab.com/3d-models/hat-a7f54e87bea94730b4a1827ec1f770df auto hat = LoadModel(world, "https://github.com/Leadwerks/Documentation/raw/master/Assets/Models/Characters/hat.glb"); hat->SetScale(0.025); hat->SetPosition(-0.3, 0.4, 0); hat->Attach(model, head); //Main loop while (window->Closed() == false and window->KeyHit(KEY_ESCAPE) == false) { model->Translate(10, 0, 0); camera->Translate(10, 0, 0); world->Update(); rotation.y = Cos(float(Millisecs()) / 10.0f) * 65.0f; neck->SetRotation(rotation); world->Render(framebuffer); } return 0; }
-
I don't seem to have any problems renaming cameras in the editor. Is it possible to post a video showing the steps I should take to make an error occur?
-
This is one mistake: entities[n]:SetProjectionMode(PROJECTION_PERSPECTIVE) The entity should be cast to a camera before calling camera commands: local camera = Camera(entities[n]) camera:SetProjectionMode(PROJECTION_PERSPECTIVE)
-
djacidfx joined the community
-
When I open your character in the Model editor and select the model tab you can see their are a number of meshes missing materials. Meshes 1,2,3,4,11,19 and 20 have no materials. I added the Storm Eyes07 material to each of them. I have no idea if this is the right material to add, you may need to refer back to the original model to make sure the materials are correct. Here is the resulting character.
-
tatan joined the community
-
PolandLetsPlay changed their profile photo
-
Yue started following Attach Bone possible bug
-
I don't know how to explain this, but everything points to it having to do with the SetInput update. A mesh is positioned on the controller and follows it, and the mesh detaches in falling movements, depending on whether the update comes before or after the render. Now, when attaching a mesh to a specific bone, in my case the head bone, the same thing happens. but if I put it before the render, the helmet is not delayed in free fall, but the entire mesh is delayed from the SetInput controller. I found a solution to this that doesn't make much sense but works for me. If you use bone:SetScale in the main loop. boneHead:SetScale(1,1,1) boneBack:SetScale(1,1,1) everything works perfectly and behaves as I really expect it to.
-
MaryJane joined the community
-
Josh started following After i convert my 3D model from glb to mdl Eye texture is blueish green
-
After i convert my 3D model from glb to mdl Eye texture is blueish green
Josh replied to Alexandermp's topic in Bug Reports
We will need the file in order to test this, please. -
Larisagot joined the community
-
Igrom joined the community
-
mike Waynme joined the community
-
DirkCastanova joined the community
-
hammjihi joined the community
- Earlier
-
Qulex3 started following seasunset02
-
AndyGFX started following CAMERAS in scene ... ( set name | active )
-
[1] When you have one camera in scene then is possible rename camera in inspector. But when you add second camera to scene and name is changed on second camera too, from this moment you can't rename any cameras in inspector. EDIT: Try delete first chars from entity name and pres ENTER => name is not changed, but when you add char at end, then name is changed. Looks like name is change only if char is added, but not when is any deleted. [2] When you have i.e. 2 cameras in scene, then first added camera is MAIN (it's OK), but when this camera is set to hidden in inspector, then second added camera is not automaticaly activated for projection after run map. I tried this fix in script but ... local entities = game.world:GetEntities() for n = 1, #entities do print(entities[n].name) if entities[n].name == "DebugCamera" then print("DEBUG camera exist ...") entities[n]:SetProjectionMode(PROJECTION_PERSPECTIVE) end if entities[n].name == "Camera" then print("MAIN camera exist ...") entities[n]:SetProjectionMode(PROJECTION_NONE) end end ... vhere n is ID to second camera, script crash with error attempt to call a nil value (method 'SetProjectionMode')
-
5.0.2 makes some changes to C++ projects, for good reason. To update C++ projects to the 5.0.2 beta, make these changes: Set Linker > System > Stack Reserve Size to 4194304. Add GameInput library via nuget Sync the project to get the Newton DLLs
-
- 1
-
-
I will assume this is fixed unless you tell me otherwise. Thank you.
-
You can opt into the beta version here:
-
Please keep your eyes open for any action you can take that allows you to reliably reproduce the error. There's no way to debug the problem unless I can produce the behavior.