Jump to content

AggrorJorn

Members
  • Posts

    4,816
  • Joined

  • Last visited

Everything posted by AggrorJorn

  1. Still, this kind of stuff should work right out of the box right? The amount of time you lose and the frustration this brings. I can imagine this would drive people away from C++.
  2. Use GetMousePosition() and then the Z axis for the mouse wheel. https://www.leadwerks.com/learn?page=API-Reference_Object_Window_GetMousePosition Very nice btw, I never could get NoesisUI to work properly.
  3. In the root of your project you can find a 'YourProjectName.werk' file were you can edit Author name etc. In the root of your project you can find a 'thum.jpg' that has your games icon for the project manager. To replace the ico of your exe, you can use an installer tool (for example www.jrsoftware.org/isinfo.php). But you can also edit it directly. I would just google that last option since there are various ways to do this.
  4. Can't find it either. This is the old documentation: Here: https://www.leadwerks.com/learn?page=API-Reference_Object_PickInfo Vec3 position Vec3 normal Entity* entity Surface* surface Face* face int triangle Mat4 mat
  5. I have been using my own Input manager for several years now. From time to time a project would require some custom tweaking, so I made a new clean version which should suit your requirements. keyboard and mouse hit and down key can be queried multiple times per frame Virtual keys with primary and secondary function (W and Up for instance) Other userfull functions Here you can find the source code: 1. Download the script and put it somewhere in your scripts folder. My example uses Scripts/Input/input.lua I use main.lua to import it. Add this to your main lua: import "Scripts/Input/input.lua" Before the main loop add the following: input = Input:Create() -- I like input as a global variable, since you use it in many places input:SetVirtualKey("RocketBoost", "Tab", "R") -- Add custom virtual key input:DebugVirtualKeys() --prints all existing virtual keys to the screen In your main loop you can now do these things: if input:VirtualKeyHit("RocketBoost") then System:Print("ROCKETBOOOSTING using Tab or ALt") end if input:KeyHit("E") then System:Print("E hit") end if input:KeyHit("E") then System:Print("E hit second time") end if input:KeyDown("Q") then System:Print("Q down") end if input:MouseHit("LButton") then System:Print("Left mouse button click") end if input:MouseDown("MButton") then System:Print("Middle mouse down") end if input:VirtualKeyHit("Jump") then System:Print("jump hit") end if input:VirtualKeyDown("Forward") then System:Print("moving forward using W or Up arrow") end By default there are a couple of Virtual keys (just like you were used in Unity). You can either change the input.lua script or add/overwrite with the SetVirtualKeyCommand() obj.virtualKeys["Forward"] = { primaryKey = "W", secondaryKey = "Up" } obj.virtualKeys["Backward"] = { primaryKey = "S", secondaryKey = "Down" } obj.virtualKeys["Left"] = { primaryKey = "A", secondaryKey = "Left" } obj.virtualKeys["Right"] = { primaryKey = "D", secondaryKey = "Right" } obj.virtualKeys["Jump"] = { primaryKey = "Space" } obj.virtualKeys["Use"] = { primaryKey = "E" } obj.virtualKeys["Fire"] = { primaryKey = "Lbutton" } obj.virtualKeys["SecondaryFire"] = { primaryKey = "Rbutton" } obj.virtualKeys["SpecialFire"] = { primaryKey = "Mbutton" } Some other usefull functions for in your game loop: if input:Any() then System:Print("Any input detected. So keyboard or mouse.") end if input:AnyKey() then System:Print("Any keyboard input.") end if input:AnyMouse() then System:Print("Any mouse input detected (besides movement)") end
  6. I think I have something that fits your need. Will post the code + example when I get home. it will allow you to setup your input like this: --config setup virtualKeys["forward"] = { primaryKey = "W", secondaryKey = "Up" } --usage if input:KeyHit("forward") then --profit end
  7. This is my work method for the past 5 years: Try to stay away from default lua scripts were possible. If you need a script, lets say the fpscontroller.lua, make a copy and use that. Use source control like git or mercurial. Make sure you have no changes and then do a project update. You can then easily identify changes in files that you do want to included (dll's, shaders) You can then easily identify changes in files that you do not want (main.lua, fpscontroller.lua) and simply revert the changes from your source control manager. This way you also quickly find any changes to your lua files.
  8. All valid points Rick. On the other hand I agree with Josh: the game loop in its current state is what I always have found attractive about Leadwerks. Here is your base game loop and adjust the way you want it. I think making these kind of changes while Leadwerks 4.x is in the final stage would be a bit late. Maybe something to consider for Le5.
  9. Regarding the topic subject: I used Udemy for the first time and I must say that I like their site a lot. I also have a pluralsight account from work, which reminded me of the course layout. So udemy would be pretty good to consider as well when I get back to a tutorial project.
  10. I like your suggestion Rick. Still, I think lua files should not be updated in general. How often has the FPS player script changed throughout the years? This is what broke Project Saturn eventually.
  11. Thats is what I would choose. Like in @Gonan suggestion, the most common issue is that the lua files have been changed by a user. Both beginners and advanced lua users will tinker with main lua and the default scripts that come with a new project.
  12. I think skipping lua files from updating a project is the easiest/quickest to implement. If a person wants an updated main.lua (or any lua file), model, material, he just needs to create a new project and copy it over from there to his original project. Shaders seems like something that most users will never touch and could still be updated imo.
  13. The problem with this, is that you are spending time working around a problem that should not be happening in the first place. Since main.lua is always the start file (unless you work with entity scripts only) you will always face the problem of it being replaced with a new version. Have a look at this 4 year old topic:
  14. Because the description was written in array form I need to use comma's to specify a new line. The extension somehow included that comma. I can solve this by just cramming everything on 1 line. It is not that people would read that document anyway. Why the ' Leadwerks' is inserted is not clear to me yet. It is not comming from the code and does also not appear in the snippet file. Vs code is adding it for some reason. Pushed a new build that fixes the comma.
  15. Small update published: I have added the parameters as indexes as well. The syntax is converted from SetRotation(number pitch, number yaw, number roll, bool global=false) to SetRotation(pitch, yaw, roll, global) The description contains the explanation of the parameters. see image below. It is not waterproof though. Sometimes the syntax parameters are missing in the description, causing the description to be empty or imcomplete. You can identify mistakes/incomplete information in the documentation easier this way. The biggest downside at the moment is the way Vs code scales the intellisense window. Right now that is not optimal. However there is word that they are working on that by making the styling more accessible through settings. In the image below I applied custom styling to make the width 2 x its original size. AddForce command with 2 different versions of paramters.
  16. I have decided that I will not be making the kickstarter for the time being. There just seems to be too little activity for it to be worth it. I will try again with Leadwerks 5 (or the new name). Thanks for your feedback.
  17. It was really interesting to follow along with the lua/C++ discussion with Josh and Rick. I feel like I learned a lot by just reading the comments. My money is on Gearhead Engine (a person who pursues mechanical or technological interests (as in automobiles or computers). Fits with the gear logo too. But seriously surprised about the name change. Either way, I like how you are open to the feedback of the community.
  18. I think you are right about that. Our brains are all wired up to using these standard layouts after so long. Still, I see it as a positive evolution of the code.
  19. That will take a lot of confusion away for starting game developers.
  20. That looks amazing! There is so much overhead disappearing this way. Looking forward to using it. So you would get something like this? --le4 Script.playerEntity = nil --entity local playerScript = nil function Script:Start() --Get the script of the referenced player entity and call its hello function playerScript = self.playerEntity.script playerScript:Hello() end --le5? Script.playerEntity = nil --entity function Script:Start() self.playerEntity:Hello() end
  21. Very nice. Is calling the garbage collector something we will have to do or is this handled internally?
  22. Do you get the desired result when the Sleep() function is commented out? What is the output of this added line: context->DrawText("Gravity: "+String(vy), 10, 50);
  23. The popup window can be restyled I think. I haven't tried it yet, but it is basically css so perhaps it is fairly easy to achieve a larger width. Adding the parameter information to the description could work. This way I can also add 'cleaner' parameter names. As long as the documentation holds up to its current parameter convention, it can be easily transformed. type name: "number x" or "bool ignoreCollision" type name=value: "bool global=true" or "number velocity = 1.0" Fyi: at https://www.leadwerks.com/learn?page=API-Reference_Object_Entity_SetPosition the first syntax is missing a comma. SetPosition(number x number y, number z, bool global = false)
×
×
  • Create New...