Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by tipforeveryone

  1. image.png.20e7e92ca1d7c2df96e5aeed24090c67.png what a nice number

    1. gamecreator


      Nice and round.  You have a ways to go though...  😛

  2. Yeah it is not actually my goal, I want to place my character spawn position by using pivots. I place pivots in editor and when I run the game, my characters will be placed with pivots's position. Anyway, I found the solution, I put Script2 into UpdateWorld(), not in Start(), with a variable which can help execute character create code only one time.
  3. My goal is place some boxes at the position of some pre-placed pivots I have 3 pivots (pivot1, pivot2, pivot3) Scripts 1: which is attached to pivot1 and 2 function Script:Start() table.insert(global_table,self.entity) end (global_table was declared in main.lua, before the while loop) Script 2: which is attached to pivot3 function Script:Start() for key,value in ipairs(global_table) do local box = Model:Box() box:SetPosition(value:GetPosition(true)) end end Script 2 does not work, because there is nothing inside the global_table to execute, all Script:Start() function are started at the same time. How can I force the Start() function of script2 (attached to pivot3) to be executed after all others execution?
  4. Copy example code in https://www.leadwerks.com/learn?page=API-Reference_Object_Joint_Ball to Main.lua > Execute and get crash I can confirm this, 4.5 is ok
  5. Yes I remember that you explained this to me on discord months ago, I just totally forgot the answers and could not find it again on discord because Josh cancel discord once (I delayed my game development for almost 3 months and returned 1 weeks ago) Thank you again for a clear answer, and now I can bookmark it !
  6. Here is my custom module: local module = {} module.SetValue = function(value) module.v = value end return module and this is my code to call above module local variable1 = require("mymodule") variable1.SetValue(1) local variable2 = require("mymodule") variable2.SetValue(2) System:Print(variable1.v) System:Print(variable2.v) As my expectation, the console should display 1 2 but it displays this instead 2 2 That means the value of variable1.v is overwriten by the value of variable2.v. I used mymodule for 2 local variables, why dont they hold a independent value of module.v ?
  7. my suggestion is a "Room Escape" genre - simple logic, pick this to open that etc
  8. Hi Josh, when I change Projection Mode of a camera to get Othor view, it makes my scene become so tiny, how can I fix that ? SetFOV or SetZoom does not work
  9. https://www.leadwerks.com/learn?page=Tutorials_CPP_Variables There are duplicated "To convert a string to a float.."
  10. I will create my inventory in C++ instead. Using class to save information is a great idea, thanks but I think saving that list to file is better for me. !
  11. I want to create a game in which I can choose Weapons and add them into player's inventory in a sperated map (call "loadout.map") That loadout can be saved (player can name the saved one as "recon kit", "assault kit" etc..) or select as active loadout. When a mission map is loaded, player will load saved loadout to play Which is the best way to achieve this ? please give me a direction, and yes, C++ way. The main question is about save and load process, should I use database ?
  12. I find out that making "escape the room" game style is so easy in programing but extreme hard in graphic design

    1. Genebris


      That's pretty much all games to be honest.

    2. tipforeveryone


      And Puzzle games are opposite haha

    3. Marcousik


      Well we need artist not only for graphics but for but for a good story too. Anyway my first problem are not the artists but simply finding time is not easy anymore !

    4. Show next comments  9 more
  13. The line Player player2; is useless for this example. should it be removed ? https://www.leadwerks.com/learn?page=Tutorials_CPP_Classes
  14. More here, I think it should be "monster" in the second red rectangle https://www.leadwerks.com/learn?page=Tutorials_CPP_Classes
  15. Hi, I post this here instead of Discord, suggested Josh. https://www.leadwerks.com/learn?page=Tutorials_CPP_Operators and https://www.leadwerks.com/learn?page=Tutorials_CPP_Loops
  16. Hi @Marcousik Would you mind replacing 2 videos in your signature section with 2 youtube link instead ? Somehow it is harder to find information, when your signature is to big and getting others''s attention. Thanks
  17. Learning C++ for the first time just for game dev in Leadwerks, the more I know about C++, the more I feel I can control Leadwerks.

    1. gamecreator


      It is nice to be able to do a little more  It's a tricky tradeoff though: there are some helpful undocumented functions but they don't always work (like world->SetSize()).

  18. Is there any simple explaination why using C++ to make game in Leadwerks can help performance better than lua? (Explain like I am five) :D

    1. JMK


      Your bottleneck is likely to be the graphics on the CPU or the GPU, in which case the language your game code is written in doesn't make a big difference. However, Lua involves GC pauses while C++ does not, and C++ runs much faster overall.

      In Turbo your game logic has its own thread, which makes it okay to use Lua with VR even, and even GC pauses won't slow down the renderer.

    2. Slastraf



      Every C instruction corresponds to a very few assembler instructions. You are essentially writing higher level machine code, so you have control over almost everything the processor does. Many other compiled languages, such as C++, have a lot of simple looking instructions that can turn into much more code than you think it does (virtual functions, copy constructors, etc..) And interpreted languages like Java or Ruby have another layer of instructions that you never see - the Virtual Machine or Interpreter.


    3. tipforeveryone


      Thank you guys, I understood
      I am learning C++ hard :)

    4. Show next comments  9 more
  19. Finally, the solution is verysimple, just move the gun model far away from camera then adjust its FOV or Zoom, muhaallalala
  20. Yes that function WithManyCalculation have many thing inside thanks
  21. I am optimizing my game's frame per sec and wonder which way of code has better performance function Script:WithManyCalculation() --A ton of code end function Script:UpdateWorld() self:WithManyCalculation() end and function Script:Start() self.time = Time:GetCurrent() end function Script:WithManyCalculation() --A ton of code end function Script:UpdateWorld() if Time:GetCurrent() - self.time > 60 then self:WithManyCalculation() self.time = TIme:GetCurrent() end end
  22. This is a good idea but not perfect, in somecases, the scope model has detail when look from outside but some of its faces still visible inside Thanks for your suggestion. I will try it In old COD4, they really make an ACOG scope which player can see inside of it And then in Modern Warfare 2 or 3 when not in aiming mode, this ACOG look so strange, so what is the real technique
  23. hmmm... I mean that scope looks like it was projected on screen only visible part of it. I will do some research
  24. I guess there is something to do with scope model itself, but no suggestion, seems only that scope has orthor view
  25. Yeah I will try to make one, but I wonder how did they do in game like Irsurgency sandstorm and many FPS game outthere
  • Create New...