karmacomposer Posted January 7, 2013 Share Posted January 7, 2013 Besides the built-in one, is there a better editor (code complete, highlighting, etc) for use with Leadwerks. I am going to take the plunge and learn a new scripting language and I have decided Lua is it. Is there a full Lua FPS script available for Leadwerks so I can learn it? Is there a script repository for Leadwerks and does it only have c++ or does it have Lua snippets as well? Why is this link: http://www.leadwerks.com/werkspace/index.php?/page/resources/_/programming/lua/ broken? It's on the main website documentation. Why would it be broken? Thanks. Mike Quote MSI Dominator Laptop - Core i7 - 8 cores / 3ghz / 32gb RAM / Nvidia 980 GTX with 16gb vram / SSD drives MSI Dominator Laptop - Core i7 - 8 cores / 3ghz / 32gb RAM / Nvidia 1060 GTX with 8gb vram / SSD drives Alienware Laptop - Core i7 - 8 cores / 3ghz / 32gb RAM / Nvidia 1070 Ti with 16gb vram / SSD drives My Patreon page: https://www.patreon.com/michaelfelkercomposer My music for sale: https://www.tgcstore.net/category/513?format=all&perpage=30&textures=undefined&price=all&order=default&artists[]=87213 Custom synths and sounds - http://www.supersynths.com Link to comment Share on other sites More sharing options...
fumanshoo Posted January 7, 2013 Share Posted January 7, 2013 The Leadwerks Engine SDK/Script Editor is a Lua script editor and I use it a lot. What I'd do is put your environment and such in the Editor and then edit your main character and what not using the Script Editor. You can easily do a first person camera with this tutorial by Aggror... in fact, I'll give you the script for that, but you need to change the scene your self. It's the 16th line of code which says scene=LoadScene("abstract::default.sbx") which you would change the "default" to what ever you made in the Editor your self. require("Scripts/constants/engine_const") require("Scripts/math/math") COLLISION_CHARACTER=1 RegisterAbstractPath("") Graphics(1200,600) fw = CreateFramework() credits = LoadSound("abstract::star wars.ogg") creditMaterial = LoadMaterial("abstract::credits.mat") scene = LoadScene("abstract::default.sbx") camera = fw.main.camera camera:SetPosition(Vec3(3,30,-10)) light = CreateDirectionalLight() light:SetRotation(Vec3(45,45,0)) controller = CreateController(2,.5,0.5 , 45,.03) controller:SetMass(10) controller:SetCollisionType(COLLISION_CHARACTER) controller:Move(Vec3(0,1,0)) DebugPhysics(0) MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2) camRotation = Vec3(0) dx = 0.0 dy = 0.0 SetWorldGravity(Vec3(0,-20,0)) strafe = 0 move = 0 while AppTerminate()==0 do if KeyHit(KEY_ESCAPE)==1 then break end --jump jump = KeyHit(KEY_SPACE) * 6 if controller:IsAirborne()==1 then jump = 0 end if KeyDown(KEY_H)==1 then MoveEntity(organisms,Vec3(.25,0,0)) end if KeyDown(KEY_F)==1 then MoveEntity(organisms,Vec3(-.25,0,0)) end if KeyDown(KEY_T)==1 then MoveEntity(organisms,Vec3(0,.25,0)) end if KeyDown(KEY_G)==1 then MoveEntity(organisms,Vec3(0,-.25,0)) end if KeyDown(KEY_DOWN)==1 then FreeEntity(water) end if KeyDown(KEY_M)==1 then PlaySound(credits) end --crouch if KeyDown(KEY_C)==1 then controller:Crouch(1) cameraHeight = 0.3 moveSpeed = .25 strafeSpeed = .25 else controller:Crouch(0) cameraHeight = 1.5 moveSpeed = 1 strafeSpeed = 1 end if KeyDown(KEY_LSHIFT)==1 then moveSpeed = 3 strafeSpeed = 3 else moveSpeed = 1 strafeSpeed = 1 end mx=Curve(MouseX()- GraphicsWidth()/2,3.0/AppSpeed()) my=Curve(MouseY()- GraphicsHeight()/2,3.0/AppSpeed()) MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2) camRotation.x = camRotation.x + my / 8 camRotation.y = camRotation.y - mx / 8 camera:SetRotation(Vec3(camRotation.x,camRotation.y,1)) --setting the minimum and maximum camera angles camRotation.x = math.min(camRotation.x, 75) camRotation.x = math.max(camRotation.x, -45) move = Curve( (KeyDown(KEY_W)-KeyDown(KEY_S)) * 5, move , 3 ) strafe = Curve( (KeyDown(KEY_D)-KeyDown(KEY_A)) * 5, strafe , 3 ) controller:Update(camRotation.y, move * moveSpeed, strafe * strafeSpeed, jump, 25 , 10, KeyDown(KEY_C)) fw:Update() camera.position.y = Curve (controller.position.y + cameraHeight,camera.position.y, 20) camera:SetPosition(Vec3( controller.position.x, controller.position.y + cameraHeight, controller.position.z)) fw:Render() Flip(0) end There's a whole bunch of bull**** in my first person cam because I use it to screw around with code that I don't know about... so maybe just sift though that, but here's the tutorial for it. Very easy to follow and teaches you a lot about Lua. I believe there are about five tutorials... Oh, and this is now your god. This link right here is your Jesus and savior. Even though a lot of the examples are BlitzMax and Pascal and C++ and NOT Lua, it still teaches you a lot... http://www.leadwerks.com/wiki/index.php?title=Main_Page Quote Link to comment Share on other sites More sharing options...
fumanshoo Posted January 7, 2013 Share Posted January 7, 2013 Also, this is for editing within the Editor, but under Leadwerks Engine SDK/Scripts/Games, there is a fps controller for use in the Editor. There is also a nifty car one and a free roam one which you can enable in the Editor by going into the Editor, going to the options at the top right, go to paths/gamescript and then load which ever you like. But they are for use in the Editor and I don't recommend scripting in the editor because some other people on Werkspace told me how inefficient it is. It's really easy to screw up in the Editor if you are not just loading environment stuff... Quote Link to comment Share on other sites More sharing options...
ChrisMAN Posted January 7, 2013 Share Posted January 7, 2013 If you are feeling masochistic, which I often do, I recommend Vim. I don't recommend Vim to beginners but to people who are really serious about editing their code. Vim and Emacs are the 'true' text editors. Modal editing is vastly more productive. This should be contrasted with modesty and the fact that solving problems is infinitely more time consuming then typing things. I am a web developer by day. My main weapons are Ruby and Javascript. I deal with haml, coffeescript, sass, scss, markdown and many other texty things. The truth is outside of a decent debugger and syntax highlighting your editor doesn't give you much in a dynamic language. When it does I will have a real choice on my hands but... until then I will take all of the speed I can get. If you master vim you are faster at what you do. It took me a year. It sucked. The amount of Java/.Net web programmers minds I have blown by hacking in vim is kind of awesome. Gary Bernhardt is probably the most amazing vim user I have scene. He blows my mind how fast he is. http://blog.extracheese.org/2010/11/screencast-custom-vim-refactorings.html My vim settings are at my github account https://github.com/friesencr/vim-settings Quote Link to comment Share on other sites More sharing options...
knocks Posted January 7, 2013 Share Posted January 7, 2013 Vim the memories, i evolved to Sublime Text. Quote My first Adobe purchase was Photoshop 2.0, CS6 was my last! < = > Link to comment Share on other sites More sharing options...
AggrorJorn Posted January 7, 2013 Share Posted January 7, 2013 Hi, On which page is this broken link? The correct documention link is this one: http://www.leadwerks...ua-programming/ Video tutorials and Tutorial files There are 11 tutorials on Lua scripting. (because of previous youtube length limitations, they are cut up in to 10 minute videos). You can find a playlist of all my tutorials on youtube. All tutorial files: http://www.leadwerks...tutorial-files/ A little note on the side: some of the information is outdated. If you walk into a problem, don't hesitate to ask on the forum. I allways used the editor that came with the SDK. The sublime editor on the other hand is also very nice to work with. Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted January 7, 2013 Share Posted January 7, 2013 I think I found that page you mentioned. It is kind of sloppy since I reported it a while ago. http://www.leadwerks.com/werkspace/topic/5251-dead-link/ Quote Link to comment Share on other sites More sharing options...
ChrisMAN Posted January 7, 2013 Share Posted January 7, 2013 Vim the memories, i evolved to Sublime Text. Many of my colleagues have. Good mouse, and clipboard support. A modern font rasterer. Is the vintage mode any good? Quote Link to comment Share on other sites More sharing options...
knocks Posted January 7, 2013 Share Posted January 7, 2013 Being mostly a designer I never really gelled to vintage, codejunkies i work with all seem to use it with little noise. Quote My first Adobe purchase was Photoshop 2.0, CS6 was my last! < = > Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.