Chris Vossen Posted March 1, 2013 Share Posted March 1, 2013 Hi everyone, I'm Chris Vossen, I wrote the majority of "Darkness Awaits" and have spent way too much time with the documentation. I wanted to open a forum up to answering LE3 user questions about how to do things in Lua or editor. Please don't be bashful! If you have a question chances are there are/will be many others out there with the same question. Quote Link to comment Share on other sites More sharing options...
Rastar Posted March 1, 2013 Share Posted March 1, 2013 Taking my chance and linking to my set of questions ;-) http://www.leadwerks.com/werkspace/topic/6026-couple-of-questions-on-leadwerks-3/#entry52100 Quote Link to comment Share on other sites More sharing options...
gamecreator Posted March 1, 2013 Share Posted March 1, 2013 Video showing problems here. Follow-up questions needing answers here. Thank you! Quote Link to comment Share on other sites More sharing options...
Chris Vossen Posted March 1, 2013 Author Share Posted March 1, 2013 Question: "Isn't there a way to change the size of models by entering their numbers? The viewports show me the sizes, but I seem only to be able to change them using the mouse which is awkward." Yes. - Select your model by clicking on the scene tab - Now there is a tab that says general and within it there are parameters for scale If you want to scale the model as a whole you can use the model editor: Quote Link to comment Share on other sites More sharing options...
Chris Vossen Posted March 1, 2013 Author Share Posted March 1, 2013 Also response time may vary and I am going out of order with the questions. Quote Link to comment Share on other sites More sharing options...
Chris Vossen Posted March 1, 2013 Author Share Posted March 1, 2013 Question: "I create a new project using the Project Manager (Lua). I would have expected that I can run the project right away, but it doesn't seem to work. Opening App.lua in the Script Editor and hitting F5/F6 just notifies me that <myproect>.debug.exe couldn't be launched." Answer: Josh is on this right now. I'll post more when he's done. Quote Link to comment Share on other sites More sharing options...
Rastar Posted March 1, 2013 Share Posted March 1, 2013 Thanks. But that doesn't change the numbers in the graph but rather multiplies them, right? I find that confusing since I can't easily compare the sizes. The scale makes sense for imported models, but when I create a cube I want to directly enter its size. Quote Link to comment Share on other sites More sharing options...
Chris Vossen Posted March 1, 2013 Author Share Posted March 1, 2013 Question: "Are there any commands/shortcuts to snap to the grid? Or to align objects? Without that it's pretty hard to construct the scene you want." Answer: You can adjust the grid size via View->Increase Grid Size or View->Decrease Grid Size "short cut key are the brackets '[' and ']' " When you create primitives they will automatically be created according to the grid size. Quote Link to comment Share on other sites More sharing options...
Chris Vossen Posted March 1, 2013 Author Share Posted March 1, 2013 Thanks. But that doesn't change the numbers in the graph but rather multiplies them, right? I find that confusing since I can't easily compare the sizes. The scale makes sense for imported models, but when I create a cube I want to directly enter its size. In the editor: You can select the object in the main viewport and their dimensions will appear in the 2d viewports where you can see their dimensions and resize accordingly. or If you are working in code: Box Quote Link to comment Share on other sites More sharing options...
cassius Posted March 1, 2013 Share Posted March 1, 2013 I can see no animate command in Leadwerks 3. How would I animate a character with a walk sequence containing a framebegin value of 1 and a frameend of 40? Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Chris Vossen Posted March 1, 2013 Author Share Posted March 1, 2013 Question: "Why can't I create new primitives directly in the main viewport? I would prefer to drag-n-drop them from the toolbar (giving me e.g. a unit cube) and then resize/reposition them using their property window (or the mouse)." Answer: If you would prefer to drag and drop a unit cube you could: 1. In 2d viewports create a 1x1x1 using the primitive box 2. Right click on your box in the scene tab and select "Save as Prefab" 3. Name it and save it 4. Select your prefab from the asset browser and drag n drop into the main viewport: Quote Link to comment Share on other sites More sharing options...
Chris Vossen Posted March 1, 2013 Author Share Posted March 1, 2013 I can see no animate command in Leadwerks 3. How would I animate a character with a walk sequence containing a framebegin value of 1 and a frameend of 40? The most convenient way of animating a model in lua is to attach the "AnimationManager" script (located at \Scripts\Animation\AnimationManager.lua) then call "SetAnimationSequence" an example of this is in the Player.lua class (which is attached to the barbarian in Darkness awaits) Lines 219 through 235. If you don't want to use the animation manager you could call the entity SetAnimationFrame command. Animation commands are grouped together in Entity Quote Link to comment Share on other sites More sharing options...
MCP Posted March 1, 2013 Share Posted March 1, 2013 Hi Chris, when executing a project in either debug or release mode a console window opens up before the main application window listing all the assets being loaded etc. Is there a way to suppress the console on a release build? Quote "If our brains were simple enough for us to understand them, we'd be so simple that we couldn't." - Ian Stewart 1995. Link to comment Share on other sites More sharing options...
Andy Gilbert Posted March 1, 2013 Share Posted March 1, 2013 Hi, im seeing no "helpers" for lights or cameras in any viewports? Should i be able to? Also rotating the camera or lights is useless as nothing "rotates" to show you the rotation you making. Andy Quote The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do. Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d Link to comment Share on other sites More sharing options...
shadmar Posted March 1, 2013 Share Posted March 1, 2013 Hi Chris In Camera2, self.target is suppose to be the barbarian. How can I fetch the material from code? local child = self.target:GetChild(1) local material = child:GetMaterial() seem to return the shadow material, but using GetChild(0) gives me nothing. Also self.target:GetMaterial() return nil. is there a way to fetch the material this way from the barbarian? Using to create a behind wall effect (x-ray shader) but I need the material to set the shader dynamicly Not even sure I'm doing it right. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Chris Vossen Posted March 1, 2013 Author Share Posted March 1, 2013 Hi Chris, when executing a project in either debug or release mode a console window opens up before the main application window listing all the assets being loaded etc. Is there a way to suppress the console on a release build? Okay I haven't tested this but I believe there are currently 2 steps to accomplish this: 1. Make sure you can compile for visual studios Compiling with Visual Studio 2. Change the linker subsystem property to Windows Project->Properties->Linker->System->SubSystem Quote Link to comment Share on other sites More sharing options...
josk Posted March 1, 2013 Share Posted March 1, 2013 Hi, im seeing no "helpers" for lights or cameras in any viewports? Should i be able to? Andy Copy the Icons folder from Darkness Awaits/Materials, Camera should be around. 1 Quote Elite Cobra Squad Link to comment Share on other sites More sharing options...
Josh Posted March 1, 2013 Share Posted March 1, 2013 I just added the icons folder in the project templates directory, so any new project you create will include them. We only have icons for the lights right now. We didn't have time to produce any for other entities, and I couldn't find any that looked consistent. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted March 2, 2013 Share Posted March 2, 2013 Hi Chris In Camera2, self.target is suppose to be the barbarian. How can I fetch the material from code? local child = self.target:GetChild(1) local material = child:GetMaterial() seem to return the shadow material, but using GetChild(0) gives me nothing. Also self.target:GetMaterial() return nil. is there a way to fetch the material this way from the barbarian? Using to create a behind wall effect (x-ray shader) but I need the material to set the shader dynamicly Not even sure I'm doing it right. Models in Leadwerks 3 are basically the same as a Mesh in Leadwerks 2. A model can have one or more surfaces. In this case, the material you are looking for is applied to the model surface, so it will be something like this: local child = self.target:GetChild(1) local surface = child:GetSurface(0) local material = surface:GetMaterial() Since GetChild() returns an entity, and GetSurface() is a Model class command, you might need to cast the entity object to a model: http://www.leadwerks...ng-with-lua-r57 Note that all indexes in Leadwerks 3 begin with 0, so 0 is the first entity or surface, 1 is the second, etc. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Chris Vossen Posted March 2, 2013 Author Share Posted March 2, 2013 Models in Leadwerks 3 are basically the same as a Mesh in Leadwerks 2. A model can have one or more surfaces. In this case, the material you are looking for is applied to the model surface, so it will be something like this: local child = self.target:GetChild(1) local surface = child:GetSurface(0) local material = surface:GetMaterial() Since GetChild() returns an entity, and GetSurface() is a Model class command, you might need to cast the entity object to a model: http://www.leadwerks...ng-with-lua-r57 Note that all indexes in Leadwerks 3 begin with 0, so 0 is the first entity or surface, 1 is the second, etc. The lua example in Model::GetSurface might help as well. Quote Link to comment Share on other sites More sharing options...
shadmar Posted March 2, 2013 Share Posted March 2, 2013 Models in Leadwerks 3 are basically the same as a Mesh in Leadwerks 2. A model can have one or more surfaces. In this case, the material you are looking for is applied to the model surface, so it will be something like this: local child = self.target:GetChild(1) local surface = child:GetSurface(0) local material = surface:GetMaterial() Since GetChild() returns an entity, and GetSurface() is a Model class command, you might need to cast the entity object to a model: http://www.leadwerks...ng-with-lua-r57 Note that all indexes in Leadwerks 3 begin with 0, so 0 is the first entity or surface, 1 is the second, etc. That works, thanks guys.. (my first shader in le3) : surface = self.target:GetSurface(0) initmat = surface:GetMaterial() 1 Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
DigitalHax Posted March 2, 2013 Share Posted March 2, 2013 Very nice! Reminds me of Dishonoured! Quote Win7 64bit, Leadwerks SDK 2.5, Visual Studio 2012, 3DWS, 3ds Max, Photoshop CS5. Life is too short to remove USB safely. Link to comment Share on other sites More sharing options...
Chris Vossen Posted March 2, 2013 Author Share Posted March 2, 2013 This is awesome! Quote Link to comment Share on other sites More sharing options...
Furbolg Posted March 2, 2013 Share Posted March 2, 2013 Wow Shadmar real nice, i wish i had your shader (GLSL/HLSL) knowledge Real amazing! Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted March 2, 2013 Share Posted March 2, 2013 Hi, I'm getting the following error in lua; 'attempt to index global 'Map' (a nil value). function App:Start() --Set the application title self.title="MyGame" --Create a window self.window=Window:Create(self.title,0,0,1024,768,Window.Titlebar+Window.Center+8) --self.window:HideMouse() --Create the graphics context self.context=Context:Create(self.window,0) if self.context==nil then return false end --Create a world self.world=World:Create() --Load a map return Map:Load("Maps\start.map") end Quote 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.