-
Posts
7,936 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Rick
-
Member1592834 has blown his cover. Take him out. Is this related to the physics image you posted?
-
No example links that I can think of. I'm out of town starting tomorrow and pretty busy tonight but if I remember I can show you what I do. To explain it: Create an animation class that stores things like: name, currentFrame, startFrame, endFrame, loop, blend, speed 1) Create instances for each animation and store them in a list probably by character or whatever 2) Loop through each animation every frame calling the Animate() method on them (sort of). However at the start of the function that does this you can check for a blend value of 0 for that specific instance and bail out since a blend of 0 wouldn't show anything anyway there isn't much point in running the frame increase code. 3) Make a method to change animation. This would start a timer on the old animation to have it's blend value decreased, and start a timer on the new animation to have it's blend value increased. 4) ?? 5) Profit That's all you have to do. It all becomes about the blend value for the animation then. Some people will have a list of just the animations they are blending and only call the function that will call Animate() on those, but I just use my master list so I don't have to screw around with another list. I add that blend check so if it's an animation that isn't one of the 2 I'm blending out of or in to it just skips the rest of the frame increasing because it's meaningless anyway so that helps reduce the overhead. If there is such a hit of going into the function and bailing out right away each frame I just eat it to save myself having to manage a separate list of animations. I've added some other things like events for animations. Like an OnComplete or even an arbitrary event that I pick which frame to call it on. I do this for things where I want another thing to happen at a certain point in an animation. Helps it look more real. ie. on frame 213 the sword would be hitting the target so fire an event to do some code to see if it's a hit/miss/dodge, how much dmg and if it's a hit then have the target play it's hit animation.
-
A .phy file with the same name as the model gets created automatically for you when you run the engine/editor. If it's already there it doesn't get recreated. Delete that file each time you modify your model in an outside program like that.
-
I sort of think the animation example LE comes with a pretty poor or more perhaps it's just to get the general idea of how to animate in LE but not how to animate in the best way for an actual game. I find it much easier to use an approach where I increase my frame by a given amount (1 in my example) at a given interval. To add on to that idea, when getting into blending I've found (from help of others on this board) to "play" all your animations (or just a set of them) all the time BUT modifying the blend value to get nice blending between them. Again, what I do with this is have a timer to increase the blend value to the animation I want played and decrease the blend value to the current animation until it's 0. These ideas make it easier to work with animations however it's more complex to setup so guessing that's why Josh didn't go that route.
-
I agree with the above and I think someone was starting this as I remember a post about it. Not sure where it is yet, but a character building system would be so nice. So many games require basic human type characters yet you don't really see this kind of assembly line character creator. Everything is so specialized. Make a base character for $25 and start selling accessories for .99 cents and you'll get a ton of transactions. I would assume this would be easier for the artist as well because making a fireman hat and texture is less time consuming and more modular than creating a fireman model. The more accessories you can pump out the more likely you'll hit the look someone is looking for and that you'll get a sale.
-
So mixing open areas and "dynamic" cave like areas and getting the right light isn't possible in LE? What kind of workarounds would we be talking about to get this to work? I mean looking into a dark cave that has no light I wouldn't expect to see the same ambient light as outside of the cave. Seems like an issue there.
-
So here is the first shot from my resources "game" which is similar to minecraft but not really Anywhere I built a house in the first picture then I went into it and closed it off and the lighting inside didn't change at all. The blocks are simply CreateCube() with physics bodies that have no mass parented to them. Is there something else I have to do? Is it because of the ambient light? I'm using klepto's day/night script which works perfectly for what I'm after but I need areas like this to be darker when closed off. It's like I need the ambient light outside but not when inside some structure. I assume using a spot light for the sun is probably not the best idea?
-
So what are some options for drawing an outline on a cube? Basically what I'm thinking is if I have my cursor over a cube I want to draw a line on each visible edge so it becomes outlined. I could swap materials/textures that have an outline on the edge - Don't have to worry about finding edges that aren't seen like I would if I went 2D drawing method - Have to have 2 sets of each texture - Is there a way to dynamically have more than 1 texture on the model where I could just add an outlined texture on top of the base textures? I could use the 2D drawing - Have to find which edges are visible and only draw those - Have to find the edges - Nice in that I wouldn't have to swap any textures on the previously mouse over cube Any other ideas? Seems the texture swapping method would be nice if I could overlay another texture that just had an outline and transparent for everything else, but not sure if that's possible or how to go about that if it is.
-
What am I missing with this code. It does enter this section when I click another cube, but I don't see anything. I print out pick.normal.x, y, & z and it has the right values or +/- 1 so not sure why my cube doesn't seem like it's getting offset the block variable is a cube I create at startup if GetEntityKey(pick.entity, "type") == "block" then local c = CopyEntity(block) --Notify(pick.normal.x.." "..pick.normal.y.." "..pick.normal.z) PositionEntity(c, Vec3(EntityPosition(pick.entity, 1)), 1) -- position the new cube at the picked cube location MoveEntity(c, Vec3(pick.normal.x, pick.normal.y, pick.normal.z), 1) -- offset the new cube from the picked cube else nvm got it with local pos = EntityPosition(pick.entity, 1) pos.x = pos.x + pick.normal.x pos.y = pos.y + pick.normal.y pos.z = pos.z + pick.normal.z PositionEntity(c, pos, 1) Thx
-
I always just do the "trunk of the character" myself.
-
Cool thanks. Will give that a try tonight.
-
@Naughty nice idea. I'll keep it simple for now and see how performance goes. I'm doing this a little different than minecraft in that the entire world isn't built with cubes so not sure if I'll need to worry that much about performance. My idea is more of like a FPRTS where you can build structures from cubes, but the terrain is normal and there are normal trees and stone models that you can gather resources from. So given that, there is no digging of the earth. The idea is to then add a multiplayer element that is a persistent world where people can attack each other and structures. So sort of a survival game. @macklebee so if I was using Lua just use the normal field of the pick table? (pick.normal). So that just has like a 1 or -1 in the x, y, or z value? Never used that normal field before.
-
If I have a cube already in my scene, and I do a mouse pick on any of the sides I would like to place another cube that lines up with the side I clicked. All the sides of the cubes are the same in texture so rotation doesn't matter, and all the cubes are the same size. So if I'm using CameraPick to get the selected point of a cubes size, how can I line up another cube perfectly on that side? My first thought was to place the new cube directly at the same location of the clicked cube and then just offset it by 1 (in my case the cubes are all 1x1x1) in the direction of the face that was clicked, Just not sure how to figure out what direction to offset based on the face of the cube that was clicked. Must be some local coord value I can get perhaps? Or if anyone else has another way I'm open to hearing it
-
Yeah I set that. I just thought once that was set the script toolbar icon would open that script if I didn't have any models selected, but it was blank to my surprise. I saw the file menu and figured I could probably navigate to the file but thought there might have been another way to directly go to the set game script with 1 button click. Thanks.
-
I would have thought so also, but when I reopen the editor and just run the code again it works, which is the part that confuses me. I'll make a video sometime about this. Since a reopen works it's not the end of the world for me just interrupts the flow is all. @macklebee, ah thanks. I clicked that scrip icon and it was blank. I noticed it had the menu options to navigate, just thought there was a way to directly open the script that was configured as the game script, but that's easy enough too.
-
The problem is there isn't much to the code. It is literally LoadTexture(), basic game loop with a DrawTexture() in it. Do you use an external editor for your Lua code? I'm using notepad++ when I edit all my Lua so not sure if that would have anything to do with it. I guess I don't even know how to open the main game script from the editor. If it's not the external editor I'll make a video showing it. I'm able to reproduce it.
-
In the game Lua script from the editor when I try to draw an image that I just put the LoadTexture function in for the first time it crashes on me. After the restart everything works fine. Anyone else have this issue? I wouldn't think it would require a restart of the editor since the code is loading the texture, but it almost seems like if that texture wasn't loaded by the editor on startup or something it crashes. If you are curious on how to repeat this: 1) Load editor 2) Bring up game script and put in a LoadTexture and assign it to a variable 3) Put a DrawImage() on that variable somewhere in the game script 4) Run the editor 5)??? 6) Crash That's how it works for me anyway. Not a huge issue but just annoying and wondering if I have to live with it or if there is something I'm doing wrong. Leadwerks Engine 2.43
-
Stay hungry, stay foolish. I like it.
-
L3DT was really easy and produced a really nice landscape.
-
Is there a nice and easy way to get more realistic landscapes in LE besides sculpting them yourself? I can't make very good landscapes and would be nice to just import some kind of gray scale image of an already made landscape.
-
Then you should make a shader for us that does that
-
Flexman have you ever seen this thread and shader? http://www.leadwerks.com/werkspace/topic/607-non-instancing-copy-command/page__p__5296__hl__instancing__fromsearch__1#entry5296 Bottom of 2nd page he has the shader file. It lets you have a giant texture that stores all the different skins and you control which section of this giant texture to use from the alpha value of SetColor I believe it is. His video that he links to seems to no longer be online but in the thread he should write the usage I think.
-
CopyEntity() will instance CreateXXX() commands. ie. CreateCube(). If you do 10k CreateCube() they won't be instanced. If you do 1 CreateCube() and CopyEnity() on it 10K they will be. If you LoadModel() 10K times on the same model it'll instance it because it knows it already has it loaded.
-
I think the documentation just wasn't updated but I'm pretty sure it's possible. Give it a try. Use the fps script that comes with the editor for an example as I believe it does line picking.
-
YouGrove, you can think of each model script as 1 method. Each model script has an update method that gets called each frame and so you can create a Rotate model script which takes a message (there is a message method by default) that will start the rotation. You then target this model script to the actual model you want to rotate. Here is the video that shows what I was doing. In this example I use model scripts to do simple functionality. I just make the model of these scripts a invisible model because it's the functionality I want and not the model. I then use the targeting system of LE to basically act like parameters to a function. If the first parameter to my rotation method is the actual model to rotate, then target 0 I link to that actual model. The benefit of this is that you code smaller more general model scripts that can be combined to do some cool stuff.