Masterxilo Posted April 19, 2010 Share Posted April 19, 2010 I finally did something interesting with the soldier model. And learned lua! I wrote an entity script for the model, that loads all the animations for it, creates a character controller, and lets you control it through simple messages (which will also make the animations change). The only thing left to do is controlling it with an AI script or through keyboard commands in a game script. I did the latter and wrote another (3rd person) game mode for Editor that features the LE Mascot. Here's what I came up with (soldier entity script & game script): Files For simplicity, I packed up only the required and converted files + my scripts of the soldier model and uploaded them again: http://leadwerks.com/werkspace/index.php?/files/file/141-leadwerks-soldier-animated-entity-game-script-3rd-person-cam/ Simply unpack the zip in your model folder, open LE Editor and a map in there, set your game script to "soldierGame.lua" and hit Ctrl+G to run around in your own map with the model! Since I'm still working on the scripts (and since they contain some additional descriptive text on the subject), I'll post them here too: Scripts Entity scripts <removed it, too long, see "soldier.lua" in the zip> Game script <removed it, too long, see "soldierGame.lua" in the zip> Images Feel free to use the scripts as you like. I just thought I'd share because I think I found good ways of handling (any amount of!) animations in lua and also a good way of controlling characters over messages. And because another game mode is always fun to test maps. --- Btw. This model can be used as a game character just the way it is in any non-lua language easily, due to it's message based control system. Here's what I'm working on: ... - Paul 1 Quote Hurricane-Eye Entertainment - Site, blog. Link to comment Share on other sites More sharing options...
Pixel Perfect Posted April 19, 2010 Share Posted April 19, 2010 This looks really cool! Thanks for sharing. Downloading now. Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
Marleys Ghost Posted April 19, 2010 Share Posted April 19, 2010 Works very well Paul, nicely done thanks for the share. Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
Flexman Posted April 19, 2010 Share Posted April 19, 2010 Not played with it yet but cheers. Quote 6600 2.4G / GTX 460 280.26 / 4GB Windows 7 Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT Tricubic Studios Ltd. ~ Combat Helo Link to comment Share on other sites More sharing options...
Pixel Perfect Posted April 20, 2010 Share Posted April 20, 2010 Having tried it out I'm really quite impressed. The model and animations are of a nice quality; so thanks to Josh for providing these and also to both the original modeller and subsequent animator. Thanks to Masterxilo too for sorting out the animation issue, the gmf conversion, providing the nice demo script and packaging it all up ... much appreciated. Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
Quan Posted April 20, 2010 Share Posted April 20, 2010 Looks great, downloading now. Quote BMax 1.38 * Leadwerks 2.4 * Unity 3.0 Pro * Intel Core 2 Duo 6600 - Win7 64bit - ATI 4870 Link to comment Share on other sites More sharing options...
David Will Posted April 26, 2010 Share Posted April 26, 2010 When I load the script the character appears to be floating quite high, haven't edited anything- just loaded with recent version of Leadwerks. Any ideas? Quote Link to comment Share on other sites More sharing options...
Flexman Posted April 26, 2010 Share Posted April 26, 2010 Maybe you've fallen through the ground? When you run the script and the camera is positioned close to the terrain it can drop through. It's a great script, quite complex. I just added a third person cam to my game and using a place-holder but I might try using this with the soldier for now. I notice that LODs in Leadwerks don't like animating in LUA, I suspect you have to interrogate the currently used LOD level and animate that mesh instead. You can try it yourself by commenting out the call to the 3rdPersonCam function and move the character away. I have the same behaviour in static vehicles/objects that rotate child entities (tank turrets and such). Quote 6600 2.4G / GTX 460 280.26 / 4GB Windows 7 Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT Tricubic Studios Ltd. ~ Combat Helo Link to comment Share on other sites More sharing options...
carlb Posted April 26, 2010 Share Posted April 26, 2010 when you say the recent version is that the 2.32 beta or the normal 2.31 if beta then i would say it could be a bug and you should not use till it released if 2.31 not sure lol Quote Asus ROG STRIX B350-F GAMMING AMD Ryzen 7 1700x 32 gb ddr4 15 TB raid 5 HD Nvidia EVGA 1060GTX Win10 64bit Link to comment Share on other sites More sharing options...
David Will Posted April 26, 2010 Share Posted April 26, 2010 Well, i've tried it on a few versions now- whatevers downloading through the update application and a version I downloaded about 3 months ago. Quote Link to comment Share on other sites More sharing options...
Stewie Posted August 30, 2010 Share Posted August 30, 2010 Has anyone else had any problems getting this to work in LE 2.40? I'm having no luck at all getting the model to animate, the 3rd person cam works fine and the character model loads, but no animations. Quote Link to comment Share on other sites More sharing options...
Wchris Posted August 30, 2010 Share Posted August 30, 2010 Has anyone else had any problems getting this to work in LE 2.40? I'm having no luck at all getting the model to animate, the 3rd person cam works fine and the character model loads, but no animations. I confirm, got the same problem here with 2.4, the soldier moves but the animations don't play. But the code is really interresting, thank you for sharing masterxilo, i'll try to learn something Quote Windows 7 home - 32 bits Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM Link to comment Share on other sites More sharing options...
macklebee Posted August 30, 2010 Share Posted August 30, 2010 The soldier.lua file is using function object:Render() This has been replaced in 2.32 to use function object:Draw() Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Stewie Posted August 30, 2010 Share Posted August 30, 2010 Works great now, thanks! Quote Link to comment Share on other sites More sharing options...
Wchris Posted August 30, 2010 Share Posted August 30, 2010 The soldier.lua file is using function object:Render() This has been replaced in 2.32 to use function object:Draw() Thank you mack, it works now after replacer render by draw. Quote Windows 7 home - 32 bits Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM 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.