Jump to content

Skrakle

Members
  • Posts

    79
  • Joined

  • Last visited

Everything posted by Skrakle

  1. In my example, model is an Entity. Here's a brief example. // Declared in App.h // Entity* model = NULL; Vec3 model_rotation; // Loaded at start // model = Model::Load("Models/model_name.mdl"); model->SetCharacterControllerAngle(180); model_rotation = Vec3(0, 0, 0); // In your loop // float rot_speed = 0; if (window->KeyDown(Key::Left)) { rot_speed = -1.5; } else if (window->KeyDown(Key::Right)) { rot_speed = 1.5; } if (window->KeyHit(Key::Escape)) { model->Release(); return false; } model_rotation.y += rot_speed * Time::GetSpeed(); model->SetInput(model_rotation.y + model->GetCharacterControllerAngle(), 0, 0, 0, false, 1, 0); If you're still having issues, send me the model and i'll test it.
  2. Sorry, i forgot to tell you that you also need to add model->GetCharacterControllerAngle() where you set the angle with SetInput. This is how i'm doing it since i have a lot of models that are +180 as well. Example: model->SetInput(model_rotation.y + model->GetCharacterControllerAngle(), move_speed, 0, 0, false, 1, 0);
  3. Have you tried playing with lighting quality? I had issues with shadows too and i ended up setting the lighting to High to resolve it. In the editor: Options > Video > Lighting Quality (High) and don't forget to set it when game starts as well: world:SetLightQuality(2)
  4. I had this problem before, if i remember correctly, this should fix it: self.entity:SetCharacterControllerAngle(180); (or c++) model->SetCharacterControllerAngle(180);
  5. It's one of the main reasons why i went from lua to c++ given the complexity of my game. I have so many classes and structs that for me, it would have been a nightmare to do all this in lua. As for speed penalties, i don't know, i never did any benchmark tests but i'm guessing that there might be.
  6. The error only occurs if included in a LE project. In an empty console c++ application, there are no errors and works as intended.
  7. I managed to rewrite my controller classes for native support (eliminating the need for the SDL lib) for both Linux and Windows but when i include dinput.h in a LE project, the compiler is giving errors, probably because it's conflicting somewhere somehow and i haven't been able to figure out how to fix it. 1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\include\dinput.h(4318): error C2143: syntax error : missing ';' before '__stdcall' 1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\include\dinput.h(4318): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  8. Yeah i know 20000 pivots seems extreme as a test, that was merely to demonstrate the consumption factor. Even if it's insignificant, it still good practice, especially if one day, the engine ever goes to console.
  9. I had the same problem at first and it was because i didn't build a navmesh for the map. If you haven't already, go to TOOLS -> Build Navmesh. If you modify the map after that, you'll need to rebuild it again.
  10. Yeah i was afraid that might happen in lua or even in linux, i guess it's unsafe to use.
  11. I just managed to make it work by releasing the window & context and re-creating them. I haven't tested it thoroughly, just wrote the code and it worked. Obviously you should replace the windows code for getting the desktop resolution with something else. In your loop: if (window->KeyHit(Key::F)) { window->Release(); context->Release(); if (fullscreen == false) { RECT desktop; const HWND hDesktop = GetDesktopWindow(); GetWindowRect(hDesktop, &desktop); window = Leadwerks::Window::Create("Lands of nowhere", 0, 0, desktop.right, desktop.bottom, Window::FullScreen); } else { window = Leadwerks::Window::Create("Lands of nowhere", 70, 70, 1024, 768); } context = Context::Create(window); fullscreen = !fullscreen; return true; }
  12. If you read my previous post again, you'll notice that i'm not only talking about speed optimization but memory as well which is my point. As for the pivot being an empty object, that is completely wrong, once initialized, there are objects in it are automatically initialized as well whether you're using them or not and will use extra (and unnecessary) memory... You should do some testing before making assumptions like that. It's like i said, there are people (such as you obviously) that need to see such things visually to be more productive, i don't. Edit: - I initialized 20000 Vec3s and it took about 1mb of memory - I initialized 20000 Pivots (without using or modifying them, just a simple Pivot::Create) and it took about 88mb. I rest my case.
  13. All this time i thought the problem was with my model. I wonder if we can simply use/implement a AABB for characters and use pick.
  14. I just added one in my scene, i've set a high range (20) and it does not flicker on my desktop pc. I sent it to my friend who has a laptop with an Intel Integrated Graphics and it flickers so it's no doubt on the hardware side (or driver).
  15. I agree, it definitely would make it easier to setup while editing but that's a matter of preference, some people need to see things visually more than others. For me, it's a matter of memory and performance, the choice was Initializing a Pivot object with tons of properties and methods vs a single Vec3.
  16. You don't need to, whenever you create a new LE project, it will create a Projects\Windows sub-folder, there's a solution for Visual Studio in there.
  17. Here's another version of the platform.lua with additional options. - The entity waypoint has been replaced with multiple Vec3's allowing multiple waypoints. - Looping. (clockwise or ping-pong) - Pause timer between waypoints. (in milliseconds) - Randomize starting waypoint. Here's a video demonstration of the script in action: https://www.youtube.com/watch?v=-1Q4qAcW40k&feature=youtu.be platform_slider.lua
  18. I can't figure out on how to use the platform.lua script. The problem i'm having is with: Script.target = "" --entity "Target waypoint" I can't set a target entity from the editor, it's grayed out and i can't seem to manually set one, world:FindEntity is not working, probably due to the fact that the project is c++ and not lua.
  19. Found them in Scripts/Objects/Physics, i'll check it out later. Thanks!
  20. I managed to find a way to keep the character physics updated by sending a bogus movement and cancelling it out right after. Not sure how it would affect performance but it works perfectly. // when idling player_entity->model->SetInput(player_entity->rotation.y, 1, 0, 0, false, 1, 0.5, true); player_entity->model->SetInput(player_entity->rotation.y, 0, 0, 0, false, 1, 0.5, true);
  21. Thanks for the script, it does the same thing as mine when i previously tried SetPosition instead of PhysicsSetPosition. The platform movement is smoother but the character still doesn't follow it unless i keep moving on it. Seems i need to keep the character's physics updated somehow when idling and my player script is in c++ so i'm not sure how to make this work properly.
  22. I'm using a brush to make an elevator, while it goes up, it's flickering, like it's trying to drop back down, i would have thought SetGravityMode(false) would have prevented this. Is there way to eliminate this effect? Script.Trigger_Delay = 500; --int "Triggering delay" Script.is_active = 0; Script.timer = 0; function Script:Start() self.entity:SetMass(10000) self.entity:SetGravityMode(false) self.entity:SetCollisionType(Collision.Scene) end function Script:Collision(entity,position,normal,speed) self:Activate(); end function Script:Activate() if (self.is_active == 0) then self.is_active = 1; self.timer = Time:GetCurrent() + self.Trigger_Delay; end end function Script:UpdateWorld() end function Script:UpdatePhysics() if (self.is_active == 1) then if (Time:GetCurrent() > self.timer) then local pos = self.entity:GetPosition(true); pos.y = pos.y + 0.1 * Time:GetSpeed(); self.entity:PhysicsSetPosition(pos.x,pos.y,pos.z,0.2); end end end
  23. It's a model from WoW that i extracted using a tool, it's used for testing only.
  24. Here is the table, not sure how to change those settings. http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/collision-r778
  25. Have you tried setting collision type to trigger? I just found this thread: http://www.leadwerks.com/werkspace/topic/9109-collision-response-types/ Trigger mode should only detect the collision and not apply it.
×
×
  • Create New...