-
Posts
275 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Phodex Games
-
@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...
-
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...
-
Set Light Quality disables lights?
Phodex Games replied to Phodex Games's topic in Leadwerks Engine Bug Reports
@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... -
@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?
-
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
-
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?
-
Model visibly reloading on fast camera movement
Phodex Games replied to Phodex Games's topic in General Discussion
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. -
Model visibly reloading on fast camera movement
Phodex Games replied to Phodex Games's topic in General Discussion
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... -
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
-
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...
-
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...
-
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.
-
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
-
Applying settings to multiple assets
Phodex Games replied to Phodex Games's topic in General Discussion
Has nobody an idea -
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
-
Applying settings to multiple assets
Phodex Games replied to Phodex Games's topic in General Discussion
Ah sorry, well I mean settings like normals calculation, physicsshape and scale, what you can set within the leadwerks model "editor". -
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.
-
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.
-
@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.
-
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!
-
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
-
Great this works, totally forgot about the Detach function. Thank you you saved me a lot of time
-
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...
-
Yes thats the point, or simpler I want my game not to crash when my player grabs an item, which is referenced somewhere else. However I was not aware of the "AddRef" function and I guess it helps me overcome some problems. I am pretty sure I can come up with a system that handels that problem, just did not know, releasing an entity can be such a complex thing. I will play around with the new knowledge doing some tests. It just some very awful work to find the error source now, as I get no error message and it just crashes
-
Hmm ok, this is going to be tricky as I don't exactly now what relatonship is causing the error and it just crashes. Have to learn some more about this topic I guess, but thank you for the information will read through it and hopefully get this fixed...