Jump to content

Rick

Members
  • Posts

    7,936
  • Joined

  • Last visited

Everything posted by Rick

  1. That was a joke on my part, but it must not have read that way. Given how many people were saying things like this and you were telling them it was just a test scene but they kept saying it, then MG reiterates it. I don't think you're strange was just curious what was happening with the other FPS scene you were working on. Keep up the good work.
  2. As a finished scene you should totally have more detail in there... So do you still use/have your outdoor FPS scene that you started showing the AI with or are you keeping that separate because it uses your A* implementation with the 2D grid system you created?
  3. @Manuel I used Fragmotion and it worked really well so I would recommend that. You can easily flip the model in there also as some of the FPS weapons were left handed.
  4. Rick

    Font sizes

    Hey Master, thanks for the explanation and code. Very nice of you to share this. I currently do the scaling of other GUI elements based on the base resolution and it does work great. However with pure LE code only, the fonts don't allow this when using DrawText() and loading fonts. Sounds like maybe you got around this specific limitation by using OpenGL commands? I'll check those out in your code. One way I got around it, some months ago, was to actually create an image for each letter for a base font size and then load each letter individually as normal images so that they can be scaled while drawing based on the resolution using LE's DrawImage() function. Of course this was a pain in the butt and the spacing wasn't always perfect so that's why I was wondering. Something I haven't tested either, but almost sounds like when you do this method you have to have multiple GUI setups based on the different aspect ratios that monitors can have these days and switch based on that also since otherwise the GUI would look funky switching between aspect ratios. Nothing is simple in the game world is it. Thanks for the code!
  5. Looks like he tagged this post as BMax. Sounded like PointDistance() is a Lua function? Could be wrong, but that's how I read the post by macklebee. If the language/library I was using already had the function, then for sure use it. If not then for me, it's about not having to think about it or implementing it every time I do a new project (which is often). I'm not very organized so I don't keep a library of common code really. I know the function already exists in LE but it just so happens it needs an entity, so this is a way to do that with using just LE code that's easier for me to remember. So I guess for me it's not about logic, it's about laziness.
  6. Not directly with LE2. It requires a graphics window. The new Leadwerks will do this I believe. Others have worked around this though, but I'm sure it's not so straight forward as you'd hope. Mumbles I think did something where she worked directly with the physics library for a server app.
  7. If you put a pivot at your picked position you could use EntityDistance(camera, pivot);.
  8. Rick

    Font sizes

    This thread sort of talks about what my question is and doesn't seem anything really came from it. http://www.leadwerks.com/werkspace/topic/2169-font-questions/page__hl__font+sizes When I look into creating a GUI, I want the controls to have text scales with the control. Today, I can either create new font files for each supported resolution (a pain and lots of work to fine tune it), or I can create my own font code that loads the fonts as images and I scale them and piece them together manually (another pain ). Anyone have any other suggestions that might be more dynamic and easier? Is the new Leadwerks going to address any of these?
  9. Nope, you are correct. I think my problem was I probably had AddHook() before the function was declared and for some reason I then moved the function outside CreateObject() and it worked but then you have to the whole objecttable thing, but you're right in what you have there. Thanks for clearing that up.
  10. Rick

    Debugging Lua Apps

    This is an amazing step in the right direction for sure! A question of common implementation for breakpoints however is not to actually have code that we type, but to do it behind the scenes for us in the form of clicking an area in the margins to set breakpoints. Is that not something you're interested in doing here? If not could you create some sort of global remove breakpoints menu option that will look for that line of code and remove them all, and/or all in the specific file.
  11. Without knowing your final goal I would say you are starting to get into pathfinding and object avoidance. If you did pathfinding and used a grid of some kind to show the crawler where it could walk, you'd already have it predetermined that certain heights aren't reachable and therefore your pathfinding code would never allow the crawler to even approach those areas. Pathfinding is in itself a big topic. That being said if this is really all you need to do you could cast out a ray at maybe mid level of the controller/character for a small distance (2 or 3 or so maybe) and if it collides with anything but another character then you know you are getting close to something you don't want to collide with so then you can randomly change direction or go back the way it came. [edit] I wouldn't do this every frame to save some processing power.
  12. Be sure to put all your code inside the function. In your post you have the if statement outside the function. That won't work (unless you just copied and pasted incorrectly).
  13. The catch with AddHook() is that the function needs to be on it's own. It can't be inside the script function class:CreateObject() (I get an error when trying to do so anyway, which makes sense) which then means you can't refer to that object directly because inside the flip function it knows nothing of the object it happens to be in the same script with (or AddHook() was called from). Instead you have to loop through objecttable to find the object in question to get it's variables/methods/etc (if you wish to reference objects inside it like in this case). So in this case using object.model no longer works without first finding the object in question by looping through objecttable. This is why I eventually came to my solution I posted above as it overcomes the other 2 ways limitations. If I have to loop through the objecttable anyway in the AddHook() way, then I might as well only do it once in the main game loop than possibly multiple times in each Flip hook that I might need to define in multiple scripts. You could only have 1 main drawing method but it's breaking the object oriented theme then which to each their own in their views on that. It then gets the advantage of being able to access that object variables directly from inside the function. The function also is directly part of the object which is nice and clean I think too when looking at it from an OO perspective and having the object data being it's own instance from the other instances of the same object. Just like objects have SetKey() and Update() I really wish Josh would have created Draw2D() as well to handle this directly. So Dennis, I'm just trying to show you the evolution of 2D drawing in Lua that I came to and how I solved it. I, like you, wanted to have each object have it's own ability to draw in 2D independently from any other object while still having direct access to that object instance data.
  14. Even better ... Maybe not better. This seems flawed in some respects. If I have 2 different model scripts and I put this in, only 1 wins out. So it works but with an *. Then if I delete the instance I added last the other one doesn't seem to come back with the flip. Even if I have 2 of the same instance, then delete the last one, the text goes away.
  15. model scripts aren't called at the 2D drawing part you want (3D rendering and 2D rendering are done a different times). If you want to do this inside a model script you need to hook into the Flip function I believe it is, and then do it. The Flip function that you hook to however I believe will be global and not linked to the model script you hooked it in, in any way. I find it pretty lame and I believe the hooking ability was added at a later time as sort of a hack (in my mind). I'm in your boat, sort of, in that a 2D Draw() function should be available for all model scripts and automatically called by the engine. The way I simulated this, is by just making a function called Flip (or whatever you want) inside the model script. Then my main lua game script I created a function call RunFlip() that would cycle through every model script, check if the Flip function exists and if it does call it. Then I call RunFlip() at the correct time in the main loop. Shown below: main lua game script -- objecttable holds all the loaded objects in your scene so we simply loop through them seeing if they have a function called Flip and if so, call it function RunFlip() for k,v in pairs(objecttable) do if v.Flip ~= nil then v:Flip() end end end while (KeyHit(KEY_ESCAPE) == 0) fw:Update() fw:Render() RunFlip() -- Calling this which will loop through objecttable (which is every model script in the scene) and if a Flip function is defined it calls it Flip(0) end Then in your model script you would do: function class:CreateObject(model) local object=self.super:CreateObject(model) function object:Flip() -- do your 2D drawing here end end
  16. On top menu Support/Wiki is what I generally use to view all functions and info about them (most of them anyway)
  17. Look into GetChild() or GetParent() I believe. Once of those passing in an index of 0 or 1 will get the mesh from the model. I always forget the exact direction. Probably GetChild(model, 1) though. At work currently so can't test it.
  18. Thanks Josh I'll scope it out! I for sure do plan on keeping it very simple to start with so we can get some things moving around and something to shoot at.
  19. Hey Aggror, I'll take the basic AI and start working on that so Roland can focus on Cells at the moment.
  20. Not a genius, just handing off information that was once told to me . I believe Josh or someone else provided me with this information years back but I remember it working and loving it because it gave great control to moving platforms. Hope it works out for you! Note that it acts like in real life. If your platform is moving really fast then suddenly stops your player will keep moving in that direction so either keep things slow, or slow down before stopping if you're going fast.
  21. I made a moving platform before. I believe what I did was use a body just for calling MoveEntity() on. Then I made a joint between the this body and the model that is the elevator. MoveEntity() will kill physics but because it's on the body it didn't matter because the player stands on the model, but because there is a joint the model will move (with physics) with the body. The nice thing about this is you can be very precise in movement because you are avoiding forces and can use functions like PositionEntity() or MoveEntity().
  22. What IndieDB doesn't know doesn't hurt them Later, we can always tell IndieDB we are earlier in our development then we really are. I'm fine with this but I'd want Aggror to do it and he'll be away for a week or so.
  23. @Marcus +1. I would love a GUI system with LE3D.
  24. Probably not, but it's the way I think about it
×
×
  • Create New...