Jump to content

lxFirebal69xl

Members
  • Posts

    333
  • Joined

  • Last visited

Posts posted by lxFirebal69xl

  1. Make sure app is defined in Main.lua.

     

    app:Disconnect()
    

     

    All honesty, I really should set you up with the newer system as the git has been deleted cause I broke it, and the entire design was bad.

     

    That does the trick, it sticks the loading screen in the background which is kind of weird, but nothing too bad for what I need right now.

    Thanks.

  2. Hello, I've been looking at the API and experimenting a bit, but I haven't really figured out a good way to restart the app.

     

    It's nothing overly complicated, just have a trigger that makes the app return to it's original state (menu screen in LEX to be specific).

     

    Anyone have a good way of doing this? I don't mind having the game close and open instantly that works too.

  3. Works just fine for me. Other than the weird clamp you have on the camera rotations that prevent it from looking past certain angles, the camera only rotates based on mouse movement.

     

    The clamps are supposed to be there, but I don't get why it works well for you but not for me.

     

    What kind of resolution?

    Maybe round the window width and heigth.

     

    Just tried rounding the window width and height, no dice, still same problem.

     

    EDIT: Managed to fix it, switched

     

    local cx=window:GetClientWidth()/2
    local cy=window:GetClientHeight()/2
    

     

    To

     

    local cx=Math:Round(window:GetWidth() / 2)
    local cy=Math:Round(window:GetHeight() / 2)
    

  4. Hey folks, recently I ran into trouble with a camera script I'm working on, here's the code:

     

     

    function Script:Start()
     self.camerarotation=Vec3(0)
     self.mouseposition=Vec2(0,0)
     self.lookspeed=0.1
     self.looksmoothing=5
     self.mouseposition=Vec2()
     self.mousespeed=Vec2()
    
     local window = Window:GetCurrent()
     local cx=window:GetClientWidth()/2
     local cy=window:GetClientHeight()/2
     window:SetMousePosition(cx,cy)
    end
    function Script:UpdatePhysics()
     local window = Window:GetCurrent()
     local cx=window:GetClientWidth()/2
     local cy=window:GetClientHeight()/2
     local camerarotation = self.entity:GetRotation()
     local mousepos=window:GetMousePosition()	
     window:SetMousePosition(cx,cy)
     self.mousespeed.x = Math:Curve(mousepos.x-cx,self.mousespeed.x,self.looksmoothing)
     self.mousespeed.y = Math:Curve(mousepos.y-cy,self.mousespeed.y,self.looksmoothing)
     camerarotation.x = Math:Min(camerarotation.x+self.mousespeed.y*self.lookspeed,30)
     camerarotation.x = Math:Max(camerarotation.x+self.mousespeed.y*self.lookspeed,-35)
     camerarotation.y = Math:Min(camerarotation.y+self.mousespeed.x*self.lookspeed, -55)
     camerarotation.y = Math:Max(camerarotation.y+self.mousespeed.x*self.lookspeed, -130)
     self.entity:SetRotation(camerarotation)
    end
    

     

    The goal is to just have a camera with the mouse's movement, and while it does work beautifully for what I'm going for, if you try it you'll see a problem which as said in the title is that the camera looks down indefinitely. How could I solve this issue?

  5. Welp, the git is shot now due to my branch conflicts. So here is the exe's via zip.

     

    https://dl.dropboxusercontent.com/u/16218991/Requests/lex1.zip

     

    What will help is if you post your log as we don't know what's happening. It shouldn't be the application. As for the template (LEX1), I'm thinking about nuking the git and uploading a lighter version of it. It was a bad idea to add shaders and scripts that get outdated and no one seems to be using anyway,

     

    This fixed my problem thankfully.

  6. This issue started happening since the latest update where I would load a level, and if I tested it in the editor immediately, it would work without problems, but, if I just moved a single piece of code in the flowgraph it would make the level crash when loading completely, from then on out, the level wouldn't work anymore, no matter what I did.

     

    Here's a short 2 minute video showing the problem.

     

     

     

     

    Things I have tried:

    -Re-loading the level.

    -Re-installing the engine.

    -Make a new project.

     

     

    I'm using the latest version of LEX 1.

  7. Maybe setting the ambient light colour in any script could fix this, even if its the exact same as in the editor.

    Also if one could get the graphics card name and if its amd or nvidia set the colour a little darker in the script, so it looks the same for every card, you would need to experiment with both cards ,then.

     

    Is there any easy way to find out what type of GPU the player has? This seems like an ideal fix for my problem but I don't even know where to begin.

  8. I've been noticing this more and more often, instead of maintaining the same "darkness" on all computers, my game appears to be a lot brighter on my pc for no reason.

     

    This is what the game looks on my portable computer:

    post-13811-0-73875100-1464165119_thumb.jpg

     

    That is how it's meant to look, dark but with enough light to see where you can go.

     

    This is the exact same scene (same settings and all) on my main computer:

    post-13811-0-02189200-1464165309_thumb.jpg

     

    At first I thought my monitor had its brightness up, but nope, that isn't the issue.

     

    I realize that the game will look brighter or darker on some computer because of a variety of things, but I find it really weird that it looks darker on anything that isn't my main computer (it also makes it very hard to make the levels since I can see really well but the final product turns out really dark.)

     

    Anyone have any clue how I could fix this "issue"?

  9. This issue seems to be something that shouldn't be an issue from the get go, like rick mentioned. But since it is, I find it interesting how all of you have a different way of dealing with it.

     

    At this point in time, I've messed around with all of your answers, and to be honest, all of them work, some more than others of course.

    To be honest the ones I understand the most is Hankinator's and Rick's second option, and since Leadwerks doesn't have any kind of CSS compatibility I'll be sticking to Hank's method for now.

    Thank you for all your answers nonetheless.

  10. Hey all, I've just ran through all the forum posts about resolutions and everything and none of them seem to mention something that context:GetWidth and context:GetHeight don't do which is take into account the resolution at which the player is playing the game at.

     

    Here's an example of what I'm talking about:

    --Battery begin
    local battL =math.floor((context:GetWidth()))/2 - 775
    local battY =math.floor((context:GetHeight()))/2 + 425
    local battX =math.floor((context:GetWidth()))/2 - 800
     local battery_percent = self.battery_level / self.battery_max_level --calculate the percentage of battery power remaining
     context:SetColor( 1 - battery_percent, battery_percent, 0, 1) --as the battery dies the red component increases while the green decreases
     context:DrawRect( battX, battY, battL * battery_percent, 20) --rectangle width is dependent on the percentage of battery remaining. Wider with more power.
     --Battery end
    

     

    This is the post render part of the script I use for the flashlight bar.

    Here's how it looks in my native 1920x1080 display:

     

    post-13811-0-33684500-1458959836_thumb.png

     

     

     

    And here's how it looks in the native leadwerks display 1024x768

     

    post-13811-0-48779000-1458959949_thumb.png

     

     

     

     

    See the difference? The flashlight bar doesn't show up and the interaction text is way too close to the middle of the screen, so my question is, is there an easy way to take the player's resolution and dynamically change the draw functions so they fit the screen no matter the resolution used?

  11. I was looking to create a specific segment for my game that had a trigger happen when the player looked at something (it could be a model or a pivot, either would work).

    Thing is how would this be possible? Since we're talking about the player's vision and not collision I have no idea how to even start doing this.

     

     

    Here's an example, where you see the player running around everywhere, but only when he looks in a specific direction (in this case, up) does something happen.

  12. I was looking into improving the already implemented flashlight, but unfortunately my limited coding knowledge made me stuck pretty quickly, so here was my idea.

     

    post-13811-0-64812700-1457902223.png

     

    Have a flashlight model be a child of the fpsplayer (so it follows the mouses movement), line it up so it looks good, make a spotlight coming out of it, and then implement Hankinator's battery script to work with the new spotlight.

     

    Battery script:

    http://www.leadwerks.com/werkspace/topic/12783-flashlight-battery-tutorial/page__hl__flashlight

     

     

    Problem is, I can't really figure out how to make it so that when the player presses F, the new spotlight appears and not the current one, and also how to implement the battery part of the code to work with it. (Since the battery script interacts with the player and not a child of the player)

     

    Any guidance would be extremely helpful! Thanks!

×
×
  • Create New...