Jump to content

Averice

Members
  • Posts

    36
  • Joined

  • Last visited

Posts posted by Averice

  1. Thanks for the feedback everyone, I'll post a new picture once I get some more stuff happening in the scene to avoid posting the same scene 4 times haha.

    Good eye panther, the seats were out by 1cm, no I didn't make the models, I originally started this project in unity and had bought the model pack from the asset store so I just dropped them into Leadwerks and continued using them it was a pretty seamless drag and drop and they were able to be used which was nice, the only thing I had to do was re-add the materials to them which took about 5 minutes.

     

    The unity asset store has some really nice content that is compatible with Leadwerks( am I allowed to say that? ), some model packs have their models as a U3dMesh which for some reason puts the pieces out of alignment in Leadwerks but it's as simple as opening blender and using the Leadwerks exporter instead of the usual .fbx exporter and they're fine to use again.

  2. More menu background map progress, I plan to have it as a live background map so you'll see AI walking around doing their jobs and **** nothing major just something to pop out and show it's an actual map not just a picture in the background.

     

    Need some help deciding, Bloom or no bloom

    Note this is only for a menu background, not an actual gameplay map.

    c8dead0105.jpg

    f471933335.jpg

    • Upvote 2
  3. I wrote a quick event binding module in lua for the game I'm working on, all you have to do is import this file and add event.CheckInput() in your loop somewhere.

    This solves the problem of leaving unchecked keys in the event and also allows you to add more functionality to a single key check instead of adding it all in one massive loop in one file.

     

    http://pastebin.com/yQTC6BQP

     

    For some reason I can't paste the code here because it won't copy tabs and looks ugly

     

    Usage is quiet simple.

    -- keyboard binds.
    event.AddInputBind(key, name, held, func, ...) -- Key code, Unique Name, Run on key held?, function, function args
    
    event.AddInputBind(Key.A, "unique_name_here", true, print, "hello", "leadwerks", "community");
    
    -- mouse binds.
    event.AddMouseBind(but, name, func, ...) -- mouse button code, unique name, function, function args.
    
    event.AddMouseBind(mousebuttoncode, "unique name", print, "hey there");
    

     

    I have quite a few helpful modules I've written for the game I'm working on, is there somewhere you guys would like me to put them so others can take advantage of them?

    • Upvote 1
  4. Just working on a test game in LE3....

     

    Video

     

    Looks like it's coming along nicely, I think you should have the enemies only make the alert sound sometimes so they can sneak up on the player occasionally, at the moment it pretty much alerts you of it's presence right away which makes it easy to pre-aim and kill.

     

    Something like

    if prevmode~="chase" then
    if self.sound.alert and math.random(1, 100) < 25 then
    self.entity:EmitSound(self.sound.alert);
    end
    end
    -- 25% chance of alerting of presence.
    

     

    On a side note I'm working on the map for the menu background of my game, it's themed in a Spacestation

    4cb65a0daa.jpg

    • Upvote 8
  5. I don't know if this is on purpose or not but whenever I require a non-lua library it crashes before launching, I can just ffi the C versions of these libs but that's not what I want to do.

     

    Is there any ideas on why this is? It's not the libraries themselves as they run perfectly with the lua interpreter outside leadwerks.

  6. If you are referring to the mousewheel being clicked, then you can use 'self.window:MouseHit(Key.MButton)' or 'self.window:MouseDown(Key.MButton)'. If you are referring to the mousewheel being scrolled, then use 'self.window:GetMousePosition().z'

     

    GetMousePosition().z is what I was looking for, thanks!

  7. Currently porting my GUI lib to leadwerks and decided to port my console over.

    017f90049a.png

     

    It took a few tweaks but overall it was really easy to port over.

    The text entry does move and clip text so you can see what you're doing if it's out of the boxs bounds, it also has carrat positioning, line wrapping and scrollbars are there too.

    Parenting and dragging are supported.

     

    Does anyone know if there is a keycode for the mousewheel up and mousewheel down in lua yet?

    • Upvote 2
  8. Sorry for the double post, but if anyone else is looking for a working glScissor ( or other gl functions ) I've managed to get it working using luajits ffi library.

     

    ffi = require "ffi";
    gl = ffi.load("OPENGL"); -- windows.
    ffi.cdef[[
    enum {
    GL_SCISSOR_TEST = 0x0C11
    };
    typedef unsigned int GLenum;
    typedef int GLint;
    typedef int GLsizei;
    
    void glEnable(GLenum cap);
    void glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
    ]]
    

     

    Usage:

    gl.glEnable(gl.GL_SCISSOR_TEST);
    gl.glScissor(0, 0, 100, 100);
    -- draw stuff
    gl.glScissor(0, 0, scrwidth, scrheight);
    

    The only difference is the origin is bottom left instead of top left so I've provided this.

     

    function math.glreverse(y, objH) -- y is the position on the y axise, objH is the height of the obj you want to place at y
    return (App and App.context) and App.context:GetHeight() - y - objH or 0;
    end
    

  9. It let's you specify a rectangle on the screen in which anything drawn outside it during that pass is not actually drawn, it's part of openGL I was just wondering if it had been bound to Lua for leadwerks at all.

    glScissor(x, y, width, height) -- small rect

    -- Draw stuff

    glScissor(0, 0, screenwidth, screenheight) -- return to normal

×
×
  • Create New...