-
Posts
7,936 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Rick
-
Session 6 is up
-
When I run the following it says 'create' is a nil value. local t = coroutine.create(function() end) This is leading me to believe that coroutines aren't part of the Lua build LE is using? I know this worked back in Jan 14 as I was using coroutines then. Did something change with this? When I look at the Lua source I see inside linit.c http://www.lua.org/source/5.2/linit.c.html that it inits a bunch of libraries. Josh did you comment out the coroutine one? If so can you put it back in? This is a very handy thing and shouldn't be any sort of security issue with it. [EDIT] Nevermind. My entity script I created was named coroutine.lua which overwrote Lua's coroutine table since it seems the script name is used to make a table in LE. Renamed my entity script to something else and it works now. Who would have thunk it
- 1 reply
-
- 5
-
YouGroove, the thing you have to understand is that if GI makes or breaks your game, then that game was most likely doomed to begin with. Also, Josh has done many performance enhancements and I think it runs good now. In release mode I don't have any FPS issues with my HGT2 project and I have 9 point lights all right next to each other. Josh is clearly trying to focus on things (a main focus anyway) that help you make games. GI doesn't help you make a game. Sure it can make it look better, but show him a game that you need to be made to look better and maybe he'd be interested in helping with the GI. Until then, the price of LE and no royalties is an amazing deal compared to the other engines.
-
I never seem to have any luck with that but will give it a shot.
-
So in my HGT2 game when I attack an enemy I have the player (character controller) turn and face the player. This worked at one point but now it turns for that frame only, then the next frame it goes back to the old rotation. MoveAndCheck Inside Attack Inside ForEach Orc hit Facing mob 28.791143417358 -- after facing the mob 4 Y rotation = 28.791143417358 -- same frame but the last line in UpdateWorld() 1 Y rotation = 99.609992980957 -- the next frame and the first line in UpdateWorld() I can't figure out why it's getting reset back to 99 (in this case) and not staying at 28 (in this case). Any ideas? Here is the FaceMob() function where I pass in the location of the enemy and as the log (and visual) shows it does do it's job but only for that frame before it's getting reset. function Script:FaceMob(pos2) local pos1 = self.entity:GetPosition(true) local v = Vec2() v.y = pos1.x - pos2.x v.x = pos1.z - pos2.z local angle = Math:ATan2(v.y, v.x) self.entity:SetRotation(0, angle, 0) System:Print("Facing mob "..angle) end
-
Yeah, I think Youtube takes some time to get the higher resolutions or something because I didn't do anything different on my end. Glad you like them.
-
Session 5 is up. Updated original post above.
-
FindChild(), which is how you get bones, is available to both Lua & C++
-
I would like labels to be able to wrap text and perhaps have coloring formatting as well. Something like: lbl.Text = "{c='r', f='times'}This will be red and in ny times font {c='b'}while this will be blue and this entire thing will wrap based on the height" where {} is a table (you could parse the table out) that defines color and font (c, f). or something like that. Also list boxes (not just combo) would be nice.
-
Session 4 is up. Updated original post above
-
No I mean what calls your Script:Use() function that is passing in the player value to it's parameter variable? It doesn't even get to call the GetInventory() function because your player variable is nil. That's what the error is telling you. So you have to look at why your player variable is nil. You declare the player variable as a function parameter to the Use() function. So whatever is calling that Use() function should be passing something in, but whatever it's passing in is nil or it's not passing anything in which the default value is then set to nil.
-
It's saying that the value of the player variable is nil. So yes while you declared it as a parameter to the function, whatever calls this function must pass in a valid (non nil) value to the player variable. It would seem it's not. So look at whatever calls this function and see what it's passing into it.
-
I think he means split animation instead of animation blending. If you are using Lua then make 2 AnimationManager instances. For one pass in the entire model entity and for the other find a bone using FindChild("bone name") on the entire model that will be the top most bone for that entire body part. ie you normally pick the spine for upper body and hips for lower. Then you make sure you call animMgr:Update() for the entire model first, then call the upper/lower body one second so that it'll overwrite the entire body one but just for the parent bone you passed in. self.animMgr = AnimationManager:Create(self.entity) self.animMgrUpper = AnimationManager:Create(self.entity:FindChild("spine_bone_name") function Script:Draw() self.animMgr:Update() self.animMgrUpper:Update() end You then manage calling self.animMgr:SetAnimationSequence() on both instances. It doesn't matter the order you call them on in UpdateWorld() as it's the Update() function that does the actual manipulation of the bones. Note that inside Script:Draw() after you call the animation managers Update() you can also manually rotate/move bones as well. In one of my games I do this with the neck bone so when the player in 3rd person view looks up I rotate the neck bone slightly based on the camera pitch to give a more realistic look.
-
[Solved] LUA - How to find a named entity stored in the loaded map
Rick replied to Roland's topic in Programming
for x=0,App.world:CountEntities()-1 do local entity = App.world:GetEntity(x) Or if you have a C++ app then you won't have the App variable, but can use World:GetCurrent() I believe. World:FindEntity() perhaps as well. -
A light is an entity and if you look at the top of this page it has a mat variable which is a Mat4 type http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/entity/ The Mat4 type has a k vairable http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/mat4/
-
Honestly, water is not a major strength of Leadwerks atm. It's going to be tough to get decent water doing all the things I'm sure you want it to do if water is that big of a deal to your game.
-
Resources for Learning Lua ( and programming in general )
Rick replied to Guppy's topic in General Discussion
My 1 on 1 training sessions. Some people are using them and enjoy them and there is nothing like learning directly 1 on 1 from a real person. I mean it's what we do for our children from K-College after all Plus I'm making a developer diary series for making my Halloween Game Tournament here where I go over making the entire game. http://www.leadwerks.com/werkspace/topic/10771-halloween-game-tournament-2-hgt2-dev-diary-videos/ -
How do you use klepto's script there? I set the 50_PP_klepto_fog.lua in the Post Effects, but the Script:Render function doesn't seem to ever get called when I put a break point in it and run the game. I placed the shader in the right spot and Script:Start() gets called fine. [edit] Would love to know the settings you use on this.
-
Nah shadmar's one you linked to, that was the one I was talking about with it needing to be applied to every shader. I thought there was a post processing one out there that doesn't require that? I've used this one before but it has some visual strangeness compared to one that is done on the entire scene after it's drawn (post processing). ah klepto's looks like it's a post processor. Am I correct in thinking that?
-
So is there any fog effects out there? I remember a long time ago shadmar had one that needed to touch every shader in order to work, but is there anything that is more of a post processing effect that wouldn't need to do that?
-
In-Depth tutorials for Lua scripting in leadwerks ?
Rick replied to seifeldin's topic in General Discussion
I have a few tutorial videos, but most of the work I do 1 on 1 for training. I'm currently making a game for the Halloween Game Tournament 2 and am recording most of my sessions in making the game. You can check out a tutorial here and check my channel for other videos. http://youtu.be/dTaSP1fKD7c -
In-Depth tutorials for Lua scripting in leadwerks ?
Rick replied to seifeldin's topic in General Discussion
I offer 1 on 1 Lua for Leadwerks training. Only $10/hr. Feel free to send me a PM if you are interested. I help get people up and running and understanding quickly. -
Yep, all working now. Thanks guy!
-
Why would it only work for skinned animated bone stuff? Doesn't every model have a color to it via SetColor()? That and the noise texture is all that's being used here to determine if the pixel should be discarded or not right? If the CSG has a script attached then it should be a normal model entity right?
-
So am I missing something here or does this not work on CSG? When I apply this to CSG it just disappears. This would for sure need to work for CSG. Any ideas why it doesn't? Maybe it's something I'm doing but could white or shadmar do a quick test on their side with CSG and this shader?