Jump to content

Phodex Games

Members
  • Content Count

    265
  • Joined

  • Last visited

Everything posted by Phodex Games

  1. Hi, no I am just calling it once. I am currently building my options menu and therefore have a class handling the options the function looks like this: function SysControl:SetLightingQuality(quality) --this is exactly the same as I found in the fps demo level code, to set light quality world:SetLightQuality(quality) System:SetProperty("lightquality",quality) end But what I found out is that it seems to work if I set the light quality in the main.lua before the main loop starts. But actually I see no diffrence between the diffrent lightning levels, but I dont think that it is not working, I just think the quality difference is minimal, therefore it would be best to keep it on 0, isn't it? Maybe it has some more drastical effect if you have volumeric lighting and enviorment probes, but I havent tried that yet. I mean if this option does not affect the visuals of my scene then I am thinking about keeping it away anyway. I should also mention, that I have just a point light and NO directional light in my scene. EDIT: I did some closer research, and yes it actually works if I set the light quality before the main loop starts. But on runtime the lights still go off. I also works for the FPS level, I just did not notice as the difference on the shadows is not that huge...
  2. Yeah I changed some stuff in the main lua, but the rendering & update stuff is untouched and default. If I start the Leadwerks FPS level it works, although i cannot really see a quality difference, but lights don't go off if I change the light quality in the game menu. @Josh In the editor it works just fine...
  3. @Rick very cool you took the time to gather this stuff together for me I really appreciate it :). I guess it will take a while until I understood all that, especially since I am not very much, into shaders yet...
  4. Hmm yeah that is what I am searching for, but does LW support this and if so where is the syntax for it? Is it documented somewhere? By circular I meant something diffrent, but still interesting. I mean I can work around my problem myself, but this just works for uncomplex rectangular healthbars. I would like to be able to implement something like this: And as you can imagine if I just scale the fill of the bar on the x-axis the whole structure gets malformed and does not fit info the bar anymore. I would need something like a mask moving from left to right hiding parts of the fill texture. I also though of kind of an animation, but then I would need like 100 images of the diffrent fill states, which I consider to be not optimal, I would like to do this via code...
  5. @Gonan Hmm I played around with it. GetLightQuality() returns 1, which is also the LW default. When I say world:SetLightQuality(1) it "works", but it stays the same anyway. If I set it to 0 or 2 the lights just go off...
  6. @GrozenDev Thanks for the answer :). Hmm, I do not use the LW GUI, but if I draw a rectangle its a single color area isnt it? Because I want a textured fill for my progress bar. I cant find DrawCircle or DrawPolygon in the Documentation where can I find that and how to use?
  7. Hi, I wonder how it is possible to create a more complex progress bar. Currently I do it with 2 images (one bar image & one fill image) and scale the fill image down propotionally to the fill status of the bar. But what if want a circular status bar for example, or if the structure of my fill texture gets malformed due to the scaling? How would I achieve something that overcomes that problem? Maybe you can help
  8. Hi, I make it short & simple. When I change the light quality with "world:SetLightQuality()" all Lights just disappear instead of changing the light quality. What am I doing wrong?
  9. Thank you thats what I wanted to know :), not it works perfectly. Just did not know that there is scene occlusion culling on and that you can access this through the camera.
  10. Hmm ok so I guess this means I cannot disable it right? Because in my actually scene (a dungeon) I personally noticed this behavior when playing. Any techniques to hide this from the user as good as possible? Maybe a normal user does not even notice, but I did as it sometimes appears even if I just turn around relatively slow...
  11. Hi, I recently encountered this problem, that if I move fast with my camera the models are visibly popping up as seen in the GIF below. Any ideas how to fix? Occlusion Culling is off and drawdistance is set to max. This weird? Sorry if you get headache of the gif by the way hahah
  12. Exactly, I have multiple systems which would have an advantage of this. For example I have a global character commands class giving my player & my AI access to all actions they need. This makes sense so as I want to change a mechanic I do not have to maintain this for both the AI & the player. As it is global (and I want it to be global so that you do not need to initiate it for any script (I initiate it in the main) and can call it from everywhere) I created a client management system that allows my command class to exectue its actions on as many entites as I desire, but I need to send the self "table" as an argument for every command, so the commands class knows on which entity the command should be executed, and this is what I would like to overcome. Eitherway I think having the functionality I explained would be a cool tool for creating systems...
  13. First of all thanks for your input. Well actually its just to make my code more error proof & simple. I would like to turn something like this: --Example Case --Script1 Script.health = 100 function Script:SomeFunction() Script2:IncreaseHealth(self, 10) end --Script2 function Script:ChangeMyVariable(target, healthAdd) target.health = callerSelf.health + healthAdd end Into this: --Example Case --Script1 Script.health = 100 function Script:SomeFunction() Script2:IncreaseHealth(10) end --Script2 function Script:ChangeMyVariable(healthAdd) --automatically get callerSelf here callerSelf.health = callerSelf.health + healthAdd end I am just asking because I though there may be an easy way of doing this, as debug.getinfo(2).name for example does print the function callers name. So can't you access the self of the caller function with this? All this is just for the sake of improving my code, it is not nessecary in the way of building a mechanic out of it. @Rick I already have such a Get/Set mechanic, for checking if an variable got changed since the last check, but I would not like to move all my variable management over to this system, I just use it for specific variables. However I guess I would be a good idea to do this longterm...
  14. Hmm ok thats not a bad idea to store this data directly inside the variable, but to make this work for every variable I would have to change the whole variable management, short, would need to change all variables, which would be a damn lot of work :D. Yeah I am not much into metatable as well, but I guess it would be a good idea to learn more... Thanks anyway, so for the moment I need to send this data as an argument, just searched for a way to do this automated.
  15. Hi Leadwerkers :), I am wondering for quiet a while now, if and how the two things, I will explain in a second, are possible. First can I grab the "self" value of an function caller WITHOUT using arguments? I would expect this to work with the lua debug.getinfo() functionality? Maybe I better explain it with pseudo code: --Script 1: function Script:Test() Script2:CallingThis() end --Script 2: function Script:CallingThis() --get self of caller end Btw I have no idea how you offically call a "caller" maybe its calle? I dont know Second how to grab an arguments root variable. What I am already aware of is accessing variables like this self["myVariable"] so I could send self as argument 1 and "myVariable" as string in argument 2, but I am looking for a way to prevent this to optimize the code and lower the error rate. Again some pseudo code: --Script 1: Script.myVariable = 10 function Script:Test() Script2:CallingWithArgument(self.myVariable) end --Script 2: function Script:CallingThis(argument) --if I do anything with the variable argument here it only changes the local "argument" variable of course --this is stupid but I guess it will explain what I mean: local rootVariable = argument:GetRoot() rootVariable = 20 --> myVariable is changed to 20 within the Script 1 end You would do me a great favor if you would give me some input on this. I would be able to improve my code even more Thanks in advance for answering and have a nice day
  16. EDIT: Well seems like we both answered at the same time xD haha To make the game turn off you need to access the main loop, you find within the main.lua (find it in: "Scripts/main.lua"). By default Leadwerks has a build in game menu where you can quit the game, so normally there is already code inside which gives you the ability to break the main loop (which makes your game quit). You have to try around your self a bit. This is how my main loop looks: while window:Closed()==false and RunGame do --this is the main loop "RunGame" is a global variable I created to handle whether the main loop is called or not --here is some code end --Now example code for exiting the game (script for any kind of entity) function Script:UpdateWorld() if window:KeyHit(Key.Escape) then RunGame = false end --Now the game exits if you press escape end --if you want to do any actions before quitting do this function Script:UpdateWorld() if window:KeyHit(Key.Escape) then self:ExitGame() end --Now it calls a function (not nessecarily needed but recommended) and this function does stuff before setting RunGame false end function Script:ExitGame() --Any code you want to apply before ending here System:Print("Game Quits NOW!") RunGame = false end
  17. Ah sorry, well I mean settings like normals calculation, physicsshape and scale, what you can set within the leadwerks model "editor".
  18. Phodex Games

    Two ideas I have

    I see Leadwerks growing and growing and getting better and better, this is really great. As far as I understood this game engine is essentially created only by you @Josh isnt it? If so, then what you created is really insane, in a positive way :), really keep it up, I love to use the engine. I wish you to best luck, better said endurance, to stay in the market and beeing able to compete against engines like unity, UE 4 etc.
  19. Hi I am currently working on a relativly huge project including about 1000 models and you can image that I dont want to adjust the model settings (like normal calculation, scale & physics shape) for every single one by hand, especially as they all need the same settings. It is very time consuming repetitive work. I know Leadwerks does not support such a thing, but maybe you have an idea or can help me working out something to do this. The only idea I had so far is copying the .meta file of a model I set up already and then overwrite all the other .meta files with this file, but this does not work unforunately.
  20. @Josh Would be very great to have vector image support :), because rasterizing all those images (if in vector format) and finding the perfect resolution, especially if you want to provide resolution independent results, can be annoying and slows down the workflow.
  21. Hi Rick thanks for your answer, you got me an idea. I do it very similar within my system, but I could implement something so my UI system calculates all needed font sizes and then I only load those font sizes, instead of loading all fontsizes at once. But then, if you ever resize during runtime, you may need to load a new font, which I would like to prevent if happening during runtime, but that is not such a big deal, I guess I am just a little bit too perfectionist :D. Either way thanks for your input. Have a nice day!
  22. Hi I am heavily working on my own user interface system at them moment and I wonder if there is a easy way to resize a loaded font. Example pseudo code for the functionality I am searching for: --Pseudo Code self.font = Font:Load("Arial", 6, Font.Smooth) --Load Font self.font:SetSize(10) --Change size during runtime I have a solution for this by preloading the font in all sizes and then change the rendered font. But this isn't memory efficient, or are Fonts so small that it makes no diffrence, either way it does create a lot of code Thanks for ideas in advance Markus from Phodex
  23. Great this works, totally forgot about the Detach function. Thank you you saved me a lot of time
  24. I just set up a simple scenario like this. Entity 1 with script: Script.target = nil --entity "Target" Script.name = "Test" function Script:Start() self.target.script:Insert(self.entity) end function Script:UpdateWorld() if keyHit.Z then self.entity:Release() end end And entity 2 with script: function Script:UpdateWorld() if self.target ~= nil then self.target:GetPosition(true) end end function Script:Insert(entity) self.target = entity end Entity 1 has Entity 2 as target, but if I press Z now, it crashes. So now I tried the "AddRef" function (most likely used it wrong though ) Entity 2 script now looks like this and gives me a object reference count error: function Script:UpdateWorld() if self.target ~= nil then self.target:AddRef() self.target:GetPosition(true) end if self.target ~= nil then self.target:Release() end --so the target can only be released from here end function Script:Insert(entity) self.target = entity end However the following code fixes the problem, for some reason without using AddRef: function Script:UpdateWorld() if self.target ~= nil and self.target.script ~= nil then self.target:GetPosition(true) end end function Script:Insert(entity) self.target = entity end Don't ask my how that came in my mind ^^ but why does it actually fix the crashing...
×
×
  • Create New...