Jump to content

Vaelek

Members
  • Posts

    46
  • Joined

  • Last visited

Posts posted by Vaelek

  1. Posts like this I think should have a special section on the forum. Anything that offers helpful information, tips, tricks, etc. There is a lot of this kind of stuff strewn across multiple sections between all the questions that are nice for those that regularly keep up on the forums, but that newcomers may never stumble across, or that even those that saw them may lose once they get buried under dozens of other topics.

     

    Or if not a dedicated section, perhaps a stickied thread that is actively updated serving the only purpose of indexing and linking to threads such as this.

    • Upvote 3
  2. Wanting a better overview of the FPS my map was getting, I came up with the following. Thought I would offer it up in case anyone else may find it useful.

     

    In app.lua, at the top add

     

    local FPSTable = {}

     

    Somewhere add these 2 functions

     

    function f(a, b, ...)
     if (B) then return f(a+b, ...) else return a end
    end
    
    function Average(n)
     if #FPSTable == 200 then table.remove(FPSTable, 1) end
     FPSTable[#FPSTable + 1] = n
     return f(unpack(FPSTable)) / #FPSTable
    end

     

    Last, replace the original DrawText line with

     

    self.context:DrawText("FPS: "..Math:Round(Average(Time:UPS())),2,2)

     

    Instead of showing the FPS as it is calculated at every frame, it will show a rolling average over the last 200 frames. The number of frames to use can be changed in the first line of the Average function.

    • Upvote 3
  3. For #1, I can confirm this and I have a workaround.

     

    This block of code in FPSPlayer.lua

     

    --Throw object if holding one
    if self.carryingEntity then
      if window:MouseHit(1) then

     

     

    needs to be changed to

     

    --Throw object if holding one
    if window:MouseHit(1) then
      if self.carryingEntity then

     

    as it is, if the left mouse button is clicked, when you hit E on a box afterwards, the MouseHit(1) triggers immediately after the item is picked up, causing it to be dropped. While the above change does work around it, I think there may be some other underlying bug causing the need for this in the first place as I don't believe the mouse click should be "held" as it seems to be until that block executes.

  4. I think it would be very nice if even short changelogs were posted when LE updates are pushed out to Steam. Since we already have to copy the default scripts to avoid being overwritten whenever there is an update, it would reduce the need to also go through and try to figure out what exactly changed so those changes can then be incorporated into our existing copies. My current workflow is before taking any updates, to copy the default assets to a new folder, take the update, and then run a diff between the folders. Especially with frequent small updates, this becomes tedious.

     

    I'm sure I don't speak for everyone, but as developers, taking updates blindly without knowing what was actually changed is a huge turnoff, especially when it involves an SDK/API. This would also enable better feedback and bug reporting if we knew when something was supposedly fixed, added, changed, etc.

    • Upvote 3
  5. I played around with your blend and it looks like you did not assign the 2nd material to anything on the plane. Once I assigned it to the outer faces it appeared fine in LW. One way to catch this in Blender is to switch to GLSL shader mode. I'm still pretty novice in Blender so perhaps there is another way to go about this, but is how I was able to fix it.

  6. I'll chime in here with a slightly related comment. In a fairly simple scene at 1024x768 I get 60fps, I light my campfire and it drops to about 35. Now at first I would think this is maybe perfectly normal. However, when turning off vsync, even at 1920x1080, I get 500fps without and 200 with the fire lit. If the engine/my system is capable of 200fps without vsync, why in the world would it ever drop below 60fps in this scenario with vsync?

  7. I see. My first attempt was to use the sliding door script, but it seemed to get stuck on the building model and would just kind of shake in place so I made my own. My Lua skills have increased since I made that so I guess I will revisit that and try to come up with a better solution or try to understand the problem with the built in script in my setup.

     

    Thanks!

  8. Is there an easy way to prevent a child object from being able to trigger the Use() function of its parent?

     

    Also, is there a way to make an object invisible to this? For example if I have an object that partially obstructs another, and the one behind it is what needs the Use() trigger. Just for example say you have an iron fence in front of an object with a trigger, to make it so you don't have to position the crosshair between the bars to interact with it.

  9. This thread compliments another that I was asked to start a new report for.

     

    A map/project showing the issue can be found at https://drive.google.com/file/d/0B6I7ft5g9GMfaVBUeV9oak0ya2M/view?usp=sharing

     

    To reproduce the problem, open the barn door, stand in it's path, and close the door while staying still. The door will pass through the player, and upon moving afterward, the player will be ejected out of the way, sometimes even being killed in the process. If the player is moving in any way, even just with the mouse, when the door hits, he is pushed out of the way as expected even if you stop moving after you begin being pushed. (Occasionally a directional key has to be hit before physics kick in, but most of the time just looking around works)

     

    Edit: I am using the beta

  10. LW when idle sits between 0% and 0.2% CPU usage. When the Flowgraph window is open, and idle, that jumps to (and stays at) about 17%. Enough to keep my fan at a medium speed by itself. This isn't really a big issue, but seems a little severe for what I imagine it should be, especially when compared to realtime render which uses about 5%.

    • Upvote 1
  11. I'm putting this here because I'm not sure if it is a bug or just an effect of a very basic carry system in the Player script that is provided.

     

    So when the player is carrying something. If you move in a way that the object collides with another, it has a full on seizure. Is this something that can be dealt with or just an issue of the internal physics engine that has to be lived with? It becomes a rather annoying issue for example if you want to have the player place an object somewhere with any precision. As well if walking near a wall it is real easy to lose the object behind the wall as it eventually just passes right through it.

  12. The Release() function in FPSGun.lua has a breaking error

     

    function Script:Release()
    if self.emitter~=nil then
    self.emitter[0]:Release()
    self.emitter[1]:Release()
    self.emitter=nil
    end
    ReleaseTableObjects(self.sound)
    self.sound=nil
    end
    
    ReleaseTableObjects(self.sound)
    end

     

    The last 2 lines should not be there and cause '<eof>' expected near 'end'

  13. I haven't been using LW for long and this was my first foray into Lua, but I would love to be involved in something like this if I am able to contribute. I do have the standard edition but my C++ is not good (I come from mainly a C# background and haven't used C++ since the TurboC++ days). I've gone through lots of tuts and worked out some things on my own I just fear I may be too novice to be of substantial use. It's been said these projects are meant to be educational but it's not clear if that is meant toward those involved, or that others can learn from the finished project (or both).

  14. I've hit a road block that I believe is a bug in Math:Max.. This is in the beta

     

    I started a new project and used the following bare bones code in a pivot to test/reproduce it

     

    Script.MyFont = Font:Load("Fonts/Arial.ttf", 12)
    
    function Script:Start()
    local FontWidth1
    local FontWidth2
    local FontWidth3
    
    FontWidth1 = Math:Max(self.MyFont:GetTextWidth("A string"), 1)
    FontWidth2 = Math:Max(1, FontWidth1)
    FontWidth3 = Math:Max(1, self.MyFont:GetTextWidth("A string"))
    end
    

     

    The last line throws error in function 'Max'.; argument #4 is 'string'; '[no object]' expected.

     

    There is no argument #4.. This seems to happen whenever the 2nd argument is a call to GetTextWidth.

  15. This is something that irks the hell out of me. In basically every text editor there is, control + left/right arrow will jump the cursor to the previous/next word in the line. In the script editor, this works as expected if you Shift+Control+Left/Right, being that it selects up through the previous/next word, but without Shift it does nothing.

     

    Two other editor enhancements I would love to see at some point are the ability to split the window horizontally to view 2 different parts of a script simultaneously, and selection highlighting, where for example if I select a variable, all other instances of that variable are shaded. These would be nice bonuses, but for the love of god please add/fix the control+left/right feature.

    • Upvote 2
  16. I didn't mean from Lua, I meant within the editor.. ie I make a small change to a doorway, and have a way to recalculate (in the editor) the navmesh for only that particular area and not have to sit through building the entire 1024x1024 navmesh for 10 minutes.

  17. I don't know the behind the scenes of how navmesh is generated to know if this is even possible, but it would be very nice to be able to regenerate navmesh for only an area within and around the active model or a selection area. Especially when working with large terrain maps, making small changes and regenerating can be rather time consuming. Going one step further, some type of manual manipulation or painting of navmesh would be doubly awesome.

×
×
  • Create New...