Jump to content

AggrorJorn

Members
  • Posts

    4,816
  • Joined

  • Last visited

Everything posted by AggrorJorn

  1. Looks nice. as for the projectile not directly exploding: without seeing the script for the projectile we can only gues. As for the force to apply. Since you use an angular mortar, all you need to do is play with the angle you fire and the maximum fire power. First experiment with the angle of the mortar. With a force of 1000, which angle will get you the furthest? When you have gotten the furthest distance, ask yourself if this is the maximum required distance of the mortar. Adjust the force of the mortar to match the maximum distance. As for a basic adjustment. Try something like this (I haven't tried it): Force is 1000 Lets say an angle of 45 gives you a distance of 80 meters Lets say an angle of 80 gives you a distance of 10 meters If an enemy is at 60 meters: 80-10 = 70. (max dist-shortest dist = gapDist) 60-10= 50. (enemy dist - shortest dist = distRange) 50/70=0.7. (distRange / gapDist = distRatio) 80-45 = 35 (maxAngle - minAngle = angleGap) 35* 0.7 = 24.5 (angleGap * distRatio = additionalAngle) 24.5 + 45= 70.5 (additionalAngle + minAngle = newAngle) You can add an additional random value to the force or the angle to get some more random results.
  2. Can you try it in the webbrowser instead of the steam client?
  3. Don't forget to credit Shadmar, it is all his shader work that made it possible.
  4. There doesn't seem to be information about buffers in the API documentation.
  5. That is the cool thing about game development. Things can magically work their way around in your game. I will have a look this weekend. I expect that a buffer needs to get cleared at some point. I can't find it in the API docs though.
  6. That is really cool. This should really help attract more people when it comes to the tournaments as well.
  7. Not per se, but it can't hurt to upgrade your graphics card. From a bright side: your game is developed against the lowest specs. If it runs on your pc, anything with better hardware will certainly work. A cheap graphics card with a good bang for buck is the GT 1030.
  8. If you are really new I would start of with Lua, because you can get results a little bit faster. Plus you can make use of the editor scripts. You can do everything that you mention in your post using the Sprite class. They can automatically face the player camera. You don't have to worry about performance. This also affects the GPU rather than the CPU. https://www.leadwerks.com/learn?page=API-Reference_Object_Entity_Model_Sprite You could do your level design with CSG brushes and use enemies/pickups using sprites.
  9. Are you using Leadwerks widgets or just drawimage etc? Can you post a screenshot of what is going wrong? I can't see the hud being drawn in the minimap. So during the update, your player camera is placed in the sky, rotated so that it looks down and then what the camera sees is being stored in a buffer. this buffer will result in to the minimap texture drawn on to the screen.
  10. Sorry hadn't had time to look at the project yet. As for the UI being drawn inside the minimap: disable all UI widgets before rendering the world for the minimap. In you minimap script do something like: DisbaleUI() world:Render() EnableUI() The documentation contains a Hide and Show function for widgets you can use for this. https://www.leadwerks.com/learn?page=API-Reference_Object_Widget_Hide
  11. Okay so the white screen is a good sign. The original in game menu code is still in place and also reacts to the escape key being pressed. The easiest solution at that point is to use another key. Or you have to make sure that the mainmenu script doesn't work when you have initiated the ending screen. The reason you are seeing a white screen is because white is the active color. Use the SetColor() command right before drawing a rect to set the color. I would recommend following the tutorials in the docs and possibly the lua basics. https://www.leadwerks.com/learn?page=
  12. AggrorJorn

    Lobbies

    Looks very straightforward. So does this command Lobby::Count(); or CountLobbies() fetch a count of all existing lobbies? Can you also pass in a name or id of your game, so that you only get lobbies that belong to your game?
  13. You can go the project manager and press export. After the export is made simply exclude files that are not used by the map you want me to open. Think about sounds, models, terrain textures. This reduces the files you want to send to me significantly.
  14. First off I would recommend watching some tutorials about how lua scripting works in combination with Leadwerks. Some usefull tutorials: Secondly: Pasting in the code from the previous posts isn't going to work because they are not object scripts, but adjustments to the main.lua script. Create a new script and call it something like endscreen.lua and attach it to your pivot. Drag this pivot in to the flowgraph as well. Use the code below for the endscreen.lua script. (warning: I have not tested this.) --This function is used to connect to in the flowgraph editor. function Script:EnableEndScreen()--in self.drawEndScreen = true end --Draw some text that the game is closing and that they need to press escape again. function Script:PostRender(context) if self.drawEndScreen then --Draw a black screen context:DrawRect(0,0,context:GetWidth(),context:GetHeight()) --Draw red text context:SetColor(1,0,0) context:SetBlendMode(Blend.Alpha) context:DrawText("Thanks for playing. Press escape to quit)",0,200,512,512) context:SetBlendMode(Blend.Solid) end end
  15. Glad you found it. These things can be the main cause for hair loss.
  16. I actually meant a zip file so that I can import the project and try out the map.(minus unnecessary models, sounds etc). I would have to build up a scene from scratch to try out your code.
  17. A real basic approach would be something like this (pseudo code) while gameIsActive do --Start the ending phase of the ending if window:KeyHit(Key.Escape) then closingGameInitiated = true end -- The game is closing and by pressing escape again, you close the game completely if closingGameInitiated and window:KeyHit(Key.Escape) then return false if Time:Update() world:Update() world:Render() --Draw some text that the game is closing and that they need to press escape again. if closingGameInitiated then --Draw a black screen context:DrawRect(0,0,context:GetWidth(),context:GetHeight()) --Draw red text context:SetColor(1,0,0) context:SetBlendMode(Blend.Alpha) context:DrawText("Thanks for playing. Press escape to quit)",0,200,512,512) context:SetBlendMode(Blend.Solid) end context:Sync(false) end
  18. Ah that would not work I see now. Can you undo the if statement with the last changes and make a screenshot of what your are currently seeing. That last if statement is also confusing me a little since I would not expect any enemies to found outside the drawing rectangle. But perhaps with an offset here and there, some enemies might slip through. Alternatively the calculation for drawing the enemy pos is not correct. Everything so has been from the top of my head. If you want I can have a look at your project. Can you send the project via pm? (excluding assets I do not need.)
  19. Note that this line (self.radar / 2 / self.radar) will always return the same value, if self.radar is above 1. For instance: (20/2) /2 = 0.5 or (80/2) / 80 = 0.5. It is probably unlikely you will use a value smaller than 1, so I would just do self.miniMapSize.y / 2. No need for Vec4 (can be used for colors, uv coordinates etc). You are very close to achieving this btw. If you look at your if statement you can see that you only check the most outer right and outer bottom of the minimap coordinates. I believe you have the drawing coordinates of the minimap stored in x and y right? Only thing left is checking if the enemy pos lies further than those x and y coordinates. You can expand your if statement like this: if enemyDrawX >= x and enemyDrawX < self.miniMapSize.x and enemyDrawY < self.miniMapSize.y and enemyDrawY >= y and then I would also recommend renaming the variables 'x' and 'y' to something more clear, because there are a lot of variables in this script that do somehting with x and y. After a while you will have no idea what those x and y are referring to. Something like: Vec2 miniMapDrawPos(x, y), but that is up to you.
  20. Well done. Some feedback: The calculation for the draw width is now taking place within the loop. With 10 enemies you would be doing that calculation 20 times. Instead calculate it once before the loop and store it in a variable. This makes your drawing code also easier to read. You will not notice an actual difference in performance but it is good practice to do so. local miniMapEnemySize = Vec2(self.miniMapSize.x/25,self.miniMapSize.x/25) The same thing can be done for calculating the enemy pos. --these lines: (self.radar / 2 / self.radar * self.miniMapSize.y) (self.radar / 2 / self.radar * self.miniMapSize.x) -- Can be shortened and stored in a variable before the loop: local radarHalf = Vec2(self.miniMapSize.x / 2, self.miniMapSize.y / 2) --and in the loop: local enemyDrawX = (enemy.x - pos.x) + radarHalf.x local enemyDrawY = (enemy.y - pos.y) + radarHalf.y As for your zoom in scaling. The radar variable, should adjust to the zoom level. Your radar has a start value of 60 and your zoom is 0.6. So when you in (zoomInc is 0.5), then you need to decrease the radar value. If you would zoom out, the radar value needs to increase. Note that this should also affect the minimapSphere where you perform the GetAABB() on.
  21. What is your current script? Note that the values I used are merely to demonstrate the calculation. For your enemies this could any arbitrary value.
  22. All answers are found scattered throughout the company blogs. Josh said in his blog that it would be available as a subscription as well as a single purchase. not sure. I know Josh is looking for other options because Steam was changing their policies. I don't think so. There might be a special license that includes full source but I doubt that would be cheap. It was mentioned that the editor was going to be opensource, but that is just speculation. No royalties No, apart from the blogs.
  23. That is not going to work since you are using the 3d position of the player and you use that as the 2d drawing coordinates. I assume you want to draw it on your minimap right? I will do my best to explain because it is a little tricky. Luckely I have access to high quality programmer art to aid in this process. I am going to calculate X. Try to see if you can do it for Y. Lets say the player is at x coordinate 50 The sphere has a size of 60. That means the outerleft of the sphere is at 20 Enemy X is at 35. Subtract enemyX - outerLeftX = 15 divide 15 by the spheresize: 15/60=0.25 This 0.25 is the ratio to draw with. So if your minimap is 200 pixels width, multiply it with the ratio of 0.25 and you get 40. That is the enemyDrawX coordinate inside the map. So the first argument in DrawRect: (x + enemyDrawX, - - ,
×
×
  • Create New...