Jump to content

Einlander

Members
  • Posts

    778
  • Joined

  • Last visited

Everything posted by Einlander

  1. I started playing around with the networking in Leadwerks and found that I needed enums. So I wrote a function that will allow you to enumerate a table. function enumerate(array,indexstart) -- indexstart is optional if array == nil then return nil end local array2 = {} local count = tonumber(indexstart) ~= nil and tonumber(indexstart) or 0 for key,value in pairs(array) do array2[value] = count count = count + 1 end return array2 end This will take an array of strings and output a named table array. enum_netchat = enumerate({ "client", "team", "all", "servertoclient", "servertoteam", "servertoall" },1) This is the simplest way to make an enum enum_netchat.all
  2. Here is some pseudo-code of how i did it in the explosions workshop item Creates a unit vector pointing in the direction we want to push. Needs to be in the GLOBAL space. force_direction = ( destination_entity:GetPosition(true) - source_entity:GetPosition(true) ):Normalize() Check if object is airborne. If it is, leave it alone. If there is more than one explosion close together, it will cause the entity to no clip since the force will become cumulative. if destination_entity:GetAirborne() == false then force_direction y = 1 else force_direction = Vec3(0) end Push the object while attempting to cancel out the objects gravity. (we multiply by the worlds inverse gravity.). We push in the GLOBAL space. destination_entity:AddForce(force_direction * Vec3((-world:GetGravity().y / destination_entity:GetMass())) * blast_force, true)
  3. Yeah windows hates when things write outside the users folder. You will have better luck putting the game saves in the documents folder like other games.
  4. Because I don't want all my games to run at that resolution.I have 2 games that i run at that resolution Gta5 and Left 4 dead 2. I also change the resolution when I am editing photo's or scans. So while it's not on all the time (the screen is only 24 inches) I have specific uses for them.
  5. > ConsoleApplication1.exe 1920 1080 That's the output I get.
  6. Also the settings window should resize if the screen resolution is smaller than the window size and all the controls should scroll. I selected 640x480 res just to see how it looks, but I was unable to change the resolution again since the apply button was off screen.
  7. Problem. It selects the Maximum resolution instead of the current resolutions. I have Virtual Super Resolution enabled in radeon settings, so my max res is 3200 x 1800 instead of my current resolution of 1920 x 1080. So main.lua needs to get the current resolution, then try to set the window to the current resolutions. If it fails either find a graphics mode closest to the current resolution but smaller, or try the smallest resolution available. In fact, can we get a lua command to get the desktop resolution? I would like to be able to center the window on the screen, or if making an application be able to properly place windows around the screen properly. I ran it from commandline to avoid the "devmode" branching.
  8. To get rid of the checkered boxes you need to do 2 things. In the water.mat that it comes with enable zsort. So the selected options will be, 2 sided, Depth test, Depth mask, and zsort. On the shader tab, switch the shader to refraction.shader. To make it more or less transparent, on the Properties tab in the diffuse section, the first 3 are your colors. The last one is the transparency. The higher the number the more transparent.
  9. This is what i get if I count the graphics mode from c++ and getting the dpi scaling before and after the count > guitest.debug.exe Error: No debugger hostname supplied in command line. DPI Scaling0.000000 (0,0) (0,0) (0,0) (0,0) (0,0) (0,0) (0,0) (0,0) (0,0) (0,0) (0,0) (0,0) (0,0) (0,0) (0,0) (0,0) (0,0) (0,0) (0,0) (0,0) DPI Scaling0.000000
  10. window=Window:Create("Test window",0,0,1920,1080,Window.FullScreen) --Create the graphics context context=Context:Create(window,0) if context==nil then return end while window:KeyDown(Key.Escape)==false do end As simple as I can make it. It will fail at any resolution. System Specs: http://i.imgur.com/46t02gl.png Gfx Card Specs: http://i.imgur.com/wsaj0bL.png
  11. Triple Monitor 1920x1080 on all 3, landscape orientation, (default) 96dpi Even if I didn't use ntGraphicsModes()-1, every resolution except the out of bounds one should have printed correctly.
  12. Nope. The update from today broke it. It was always working for me until today.
  13. See if this helps you:
  14. When trying to run a fullscreen window you will get a Asser Failed error. <gamename.exe> will simply appear to fail to run. Attempting to run it from explorer or command line will give the same results.
  15. in menu.lua add this after line 249: gfxmode = {tostring(tonumber(gfxmode[1]) <= 0 and 1280 or gfxmode[1]) , tostring(tonumber(gfxmode[2]) <= 0 and 720 or gfxmode[2])} Does the same as the above. it will only catch if the screenres is (0,0) or lower then set it to 720p. This is just a failsafe for when a screen resolution is unable to be selected. Think gta 4 for people with more than 2gb of video ram iirc. The game was unable to see all the ram and was unable to see the screen resolutions.
  16. The solution that I found is to use a ternary operator to fix it. add this after line 21: gfxmode = Vec2( (gfxmode.x <= 0 and 1280 or gfxmode.x) , (gfxmode.x <= 0 and 720 or gfxmode.x)) This will make sure the window is > (0,0), if not it will set it to 720p(16:9) . This will not effect the game if it is running properly. Think of it as safe mode like gta5 has, except it doesn't start at the absolute safest resolution (640,480). I need to do some looking into menu.lua to make sure it doesn't mess up when you select the non existent screen modes. (It gives you the option to select 0x0 screen res :/ )
  17. Further experimentation on my amd system (r9 390) System:GetGraphicsMode() returns vec2(0,0) for all screen modes for i=0 , System:CountGraphicsModes() do System:Print(i) System:Print(System:GetGraphicsMode(i).x .." " .. System:GetGraphicsMode(i).y) end
  18. With the last update the new default main.lua causes crashes when run. The old main.lua still works though. --edit-- Simply commenting out all the gui related related lines causes the game to 'Assert Failed' at world:Render()
  19. I would suggest that you have for the server:publish API you have a mandatory key string parameter. This way you can separate games of the same name and even the same game but different versions.
  20. Any chance we can publish to our own masterserver? Like if I want to test internally or was making a private game?
  21. Here's my entry to the contest. It is a pipebomb but the grenade script is generic so you can use it for a regular grenade. I think I might add in 1 more feature to it later. There is also a generic exploding barrel script too. Let me know if you want me to post the scripts here instead of the the steam workshop. http://steamcommunity.com/sharedfiles/filedetails/?id=932421043
  22. Updated Opening Post. Found that there was a lot of badly thought out code, unused variables and questionable math. Did a complete rewrite to make it cleaner and use better time tracking.
×
×
  • Create New...