Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. A few years ago I used the Torque 3D game engine heavily. I could develop a gameplay logic in Torque Script, and perform high-performance calculations in C++. In Leadwerks 5 I see that I can create two separate project types: Lua and C++. But don't they overlap?
  3. Today
  4. Ok, working code bellow. I have my 3 second delayed start, with the gravity issue solved. I also implemented a max jump height to prevent the player from just going over top of the game objects. This code works, but if anyone would care to look over it and tell me if things are wrong, or if I should have done something else, I'd really appreciate it. I don't want to create bad habits from the start. myPlayer = { name = player } myPlayer.name = "myPlayer" myPlayer.speed = 10 myPlayer.jumpforce = 5 myPlayer.maxheight = 10 function myPlayer:Start() self.window = ActiveWindow() -- create start timer gracetimer = CreateTimer(3000) ListenEvent(EVENT_TIMERTICK,gracetimer,OnGraceTimer) -- Enable physics self:SetPhysicsMode(PHYSICS_RIGIDBODY) self:SetCollisionType(COLLISION_PLAYER) self:SetMass(1) self:SetGravity(0) -- Create camera self.camera = CreateCamera(self.world) self.camera:SetPosition(self.entity:GetPosition()) --we need to save the position of the entity so that we can reset to it startpos = self:GetPosition() end --timer callbacks function OnGraceTimer() Print("timer Worked") gracetimer:Stop() gamestarted = true gravity = -10 end function myPlayer:Sound() hit = LoadSound("Sound/Music/hit.mp3") end -- collision function myPlayer:Collide(entity) if entity:GetCollisionType() == COLLISION_SCENE then hit = LoadSound("Sound/Music/hit.mp3") hit:Play() Print("Game Over!") isgameover = true end end --player movement function myPlayer:Update() local pos = self:GetPosition() local vel = self:GetVelocity() if gamestarted == true then self:SetGravity(-10) vel.z = self.speed end vel.x = 0 self.entity:SetRotation(0,0,0) if pos.y > self.maxheight then pos.y = self.maxheight self:SetPosition(pos) end if self.window:KeyDown(KEY_SPACE) then vel.y = self.jumpforce end self:SetVelocity(vel) -- Game is over, so lets reset the player back to the starting position and resume after 3 seconds if isgameover == true then self:SetPosition(startpos) isgameover = false end -- Update camera self.camera:SetPosition(self.entity:GetPosition()) self.camera:Move(0,1,-3) end
  5. I'm a little confused. I thought I should use the Ultra Engine beta. Now everything is working correct.
  6. You are using Ultra Engine. Use Leadwerks and opt into the beta branch.
  7. I'm convinced that I'm using Self:SetGravity() incorrectly. With gravity disabled in the editor, I thought that self:SetGravity(-10) would add the gravity to the player, but it doesn't. Scratch that, SetGravity doesn't seem to enable gravity, it modifies its value.
  8. I have updated my project but everything is the same. You can see this error in the image number one. Then I try to execute your code statement: result is nil (look picture number two). If I write: local p = CreatePivot(nil) Notify(type(p.GetEnabled)) if true then return end The label in the message box is: "function" like you said in the previous post.
  9. When creating a new C++ project, the Classes and Components folder is still referenced. The classes folder still points to files that have been moved to "Game". <ItemGroup> <Filter Include="Source Files"> <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> </Filter> <Filter Include="Header Files"> <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions> </Filter> <Filter Include="Resource Files"> <UniqueIdentifier>{54f0adeb-8b31-4c2f-979f-e4ee6840b918}</UniqueIdentifier> </Filter> <Filter Include="Source Files\Steamworks"> <UniqueIdentifier>{6db9dbd5-6d5c-4f70-94e5-523fbcf69c75}</UniqueIdentifier> </Filter> <Filter Include="Header Files\Components"> <UniqueIdentifier>{315863a5-a94a-4237-91aa-7ebc5f7b7c57}</UniqueIdentifier> </Filter> <Filter Include="Header Files\Classes"> <UniqueIdentifier>{fffb3907-599d-4991-8eb4-0b47570890c1}</UniqueIdentifier> </Filter> <Filter Include="Source Files\Game"> <UniqueIdentifier>{1a430258-2bc8-4d33-b6f1-84a974bba2c0}</UniqueIdentifier> </Filter> </ItemGroup>
  10. I think your project needs to be updated. I just created a new project and ran this code, and it says the type is "function": local p = CreatePivot(nil) Notify(type(p.GetVisible)) if true then return end https://www.leadwerks.com/learn/projectmanager
  11. Yesterday
  12. Yes, I have double rechecked.
  13. Are you using Leadwerks on Steam, beta branch?
  14. This is awesome! And samples are great! But there is not GetVisible() method.
  15. So far, I’ve achieved basic player control. The player flies forward at a constant speed. I’ve set the player's starting point via script, and the player successfully resets to that point when it makes contact with the ground or other game objects. I achieved collision detection by checking the struck entity's collision type. This works in this case, but perhaps there is a better way? Utilizing a timer, I’ve successfully added a 3-second delay after opening the game, before the player starts moving forward. This has caused an issue that I’m currently trying to overcome. Gravity still acts even when the timer is active. I thought maybe setting self:SetGravity(0) from the start and calling self:SetGravity(1) after checking if the game has started would be the key, but this has a logic error. Perhaps someone here can offer some advice? -- create start timer gracetimer = CreateTimer(3000) ListenEvent(EVENT_TIMERTICK,gracetimer,OnGraceTimer) -- Enable physics self:SetPhysicsMode(PHYSICS_RIGIDBODY) self:SetCollisionType(COLLISION_PLAYER) self:SetMass(1) -- Create camera self.camera = CreateCamera(self.world) self.camera:SetPosition(self.entity:GetPosition()) --we need to save the position of the entity so that we can reset to it startpos = self:GetPosition() end --timer callbacks function OnGraceTimer() Print("timer Worked") gracetimer:Stop() gamestarted = true end function myPlayer:Sound() hit = LoadSound("Sound/Music/hit.mp3") end -- collision function myPlayer:Collide(entity) if entity:GetCollisionType() == COLLISION_SCENE then hit = LoadSound("Sound/Music/hit.mp3") hit:Play() Print("Game Over!") isgameover = true end end --player movement function myPlayer:Update() local vel = self:GetVelocity() if gamestarted == true then vel.z = self.speed end vel.x = 0 self.entity:SetRotation(0,0,0) if self.window:KeyDown(KEY_SPACE) then vel.y = self.jumpforce end self:SetVelocity(vel) -- Game is over, so lets reset the player back to the starting position and resume after 3 seconds if isgameover == true then self:SetPosition(startpos) isgameover = false end -- Update camera self.camera:SetPosition(self.entity:GetPosition()) self.camera:Move(0,1,-3) end
  16. Hello all, in my attempt to learn scripting in Leadwerks 5, I figured I could start a thread here and update my progress. I have a small understanding of some things so far. I’ve been working on a learning project for the past week. The idea is a Flappy Bird-style game, or an old-school helicopter game if any of you are old enough to remember that game. The player, “Cube,” flies forward at a constant velocity without player input. When the player hits the space key, the cube will jump. If the player hits the ground or any object, they reset to the beginning. Learns goals for this project include Storing the distance traveled by the player. Saving the highest distance traveled as a high score. Adding power-ups, such as momentarily slowed movement, that the player can use for difficult sections. Said power-ups, when collided with, would be stored rather than immediately executed, so the player can use them when they need them. I figured this would be a good starting point for learning. I will post screenshots and code throughout the game's progress, along with the current goal I’m working on. Any help and advice would be greatly appreciated. I’ve always wanted to learn scripting, and once I found Leadwerks, I knew it would be my engine of choice.
  17. 11
  18. Asking it now and will post answer once will get it.
  19. Well, the good news is they didn't put out an engine-breaking driver. I have 25.11.1 installed now and the editor runs fine. I am testing on a 6600, so it's not exactly the same card, but it is likely to act the same. The only thing I can do now is get a 9xxx series card and make sure it is working, although I would be surprised if it had a problem. Do you know if this user has win 10 or 11?
  20. Installing this driver now...
  21. It's latest drivers
  22. We had a lot of problems with some not-too-old AMD drivers earlier this year. Updating the drivers should be the first step.
  23. At EVENT_STARTRENDERER data = 0, event text is empty (or have " ", not sure), white window. SelectDevice cpp included to project. It happens not on my PC, so can't debug. Same with simple code. What can be done to fix it? #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, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a world auto world = CreateWorld(); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetPosition(0, 0, -4); //Create a light auto light = CreateBoxLight(world); light->SetRotation(45, 35, 0); light->SetRange(-10, 10); light->SetColor(2); //Create a model auto model = CreateBox(world); model->SetColor(0, 0, 1); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { while (PeekEvent()) { const Event ev = WaitEvent(); if (ev.id == EVENT_STARTRENDERER) { if (ev.data != 0) { Notify(ev.text.empty() ? "Empty" : ev.text); } break; } } model->Turn(0, 1, 0); world->Update(); world->Render(framebuffer); } return 0; }
  24. This box got slightly smashed, but the item does look nice, with leather siding.
  25. Last week
  26. Videos are now available for the Game Mechanics series. Please let me know if you find these helpful: https://www.leadwerks.com/learn/gamemechanics
  27. Hmm, but you are attempting to fix something that previously didn't require a fix - I would understand these arguments/suggestions if I had purchased the Ultra Engine app as a steam app but I didn't. As I say, what I would like to happen is access to the standalone app returned as soon as possible. If this is not something you are able or willing to do then I will be forced to request a refund for the standalone version as the product is essentially unavailable at this point...
  28. Steam can run offline. It might be possible to add version 4.6 as a DLC. If it works, this would add a launch option that only appears if the DLC is installed, and would let you choose to launch either version 5.x or 4.6 when you run the program.
  29. Yes in effect - not that I do but I like the ability to be able to switch quickly between the versions without having to use steam's beta channel to do so. I also preferred the portability of the standalone app and that it could be used entirely offline if necessary.
  1. Load more activity
×
×
  • Create New...