-
Posts
333 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by lxFirebal69xl
-
-
Hello, I've been looking at the API and experimenting a bit, but I haven't really figured out a good way to restart the app.
It's nothing overly complicated, just have a trigger that makes the app return to it's original state (menu screen in LEX to be specific).
Anyone have a good way of doing this? I don't mind having the game close and open instantly that works too.
-
Works just fine for me. Other than the weird clamp you have on the camera rotations that prevent it from looking past certain angles, the camera only rotates based on mouse movement.
The clamps are supposed to be there, but I don't get why it works well for you but not for me.
What kind of resolution?
Maybe round the window width and heigth.
Just tried rounding the window width and height, no dice, still same problem.
EDIT: Managed to fix it, switched
local cx=window:GetClientWidth()/2 local cy=window:GetClientHeight()/2
To
local cx=Math:Round(window:GetWidth() / 2) local cy=Math:Round(window:GetHeight() / 2)
-
I just exported a small project where this issue is present, give it a try.
-
Try it on the new project.
Also, I see now that Turn is actually worse for this.
Tried it on a new project, still same issue.
-
Did you just replace SetRotation with Turn? No wonder it spins like a tornado. You need to rotate by the needed difference.
EDIT: Your script works fine for me too.
I don't get what you mean by "You need to rotate by the needed difference."
How come the script is working fine for you guys but not for me...
-
I guess you should use http://www.leadwerks.com/werkspace/page/api-reference/_/entity/entityturn-r29 instead of setrotation.
Using Turn makes it so the camera spins around like a tornado.
I have tried this and i am not experiencing the problems you are stating. For me, the camera doesn't rotate unless I move the mouse cursor.
That is weird, did you spawn a camera and attached this script to it?
-
Hey folks, recently I ran into trouble with a camera script I'm working on, here's the code:
function Script:Start() self.camerarotation=Vec3(0) self.mouseposition=Vec2(0,0) self.lookspeed=0.1 self.looksmoothing=5 self.mouseposition=Vec2() self.mousespeed=Vec2() local window = Window:GetCurrent() local cx=window:GetClientWidth()/2 local cy=window:GetClientHeight()/2 window:SetMousePosition(cx,cy) end function Script:UpdatePhysics() local window = Window:GetCurrent() local cx=window:GetClientWidth()/2 local cy=window:GetClientHeight()/2 local camerarotation = self.entity:GetRotation() local mousepos=window:GetMousePosition() window:SetMousePosition(cx,cy) self.mousespeed.x = Math:Curve(mousepos.x-cx,self.mousespeed.x,self.looksmoothing) self.mousespeed.y = Math:Curve(mousepos.y-cy,self.mousespeed.y,self.looksmoothing) camerarotation.x = Math:Min(camerarotation.x+self.mousespeed.y*self.lookspeed,30) camerarotation.x = Math:Max(camerarotation.x+self.mousespeed.y*self.lookspeed,-35) camerarotation.y = Math:Min(camerarotation.y+self.mousespeed.x*self.lookspeed, -55) camerarotation.y = Math:Max(camerarotation.y+self.mousespeed.x*self.lookspeed, -130) self.entity:SetRotation(camerarotation) end
The goal is to just have a camera with the mouse's movement, and while it does work beautifully for what I'm going for, if you try it you'll see a problem which as said in the title is that the camera looks down indefinitely. How could I solve this issue?
-
Welp, the git is shot now due to my branch conflicts. So here is the exe's via zip.
https://dl.dropboxusercontent.com/u/16218991/Requests/lex1.zip
What will help is if you post your log as we don't know what's happening. It shouldn't be the application. As for the template (LEX1), I'm thinking about nuking the git and uploading a lighter version of it. It was a bad idea to add shaders and scripts that get outdated and no one seems to be using anyway,
This fixed my problem thankfully.
-
Does the program log say something like "Map version 42 not supported"?
Nope, everything loads fine.
-
Sounds like you might have an old EXE that can't load the new map file version?
I'm currently waiting on a new update for LEX, hopefully that fixes the issue.
-
Bump, still haven't found a fix
-
This issue started happening since the latest update where I would load a level, and if I tested it in the editor immediately, it would work without problems, but, if I just moved a single piece of code in the flowgraph it would make the level crash when loading completely, from then on out, the level wouldn't work anymore, no matter what I did.
Here's a short 2 minute video showing the problem.
Things I have tried:
-Re-loading the level.
-Re-installing the engine.
-Make a new project.
I'm using the latest version of LEX 1.
-
Maybe setting the ambient light colour in any script could fix this, even if its the exact same as in the editor.
Also if one could get the graphics card name and if its amd or nvidia set the colour a little darker in the script, so it looks the same for every card, you would need to experiment with both cards ,then.
Is there any easy way to find out what type of GPU the player has? This seems like an ideal fix for my problem but I don't even know where to begin.
-
Different brand? I know when I switch from AMD and Nvidia, I always saw a brightness/contrast level difference in games.
Yeah, you're correct, still makes it really awkward since you have to find a good balance of lighting that look decent on Nvidia and AMD
-
There are several games on the game launcher which are too dark on my pc.The only thing I can suggest is to increase the ambient light providing it does not spoil your game idea.
That kind of sucks since it's way too bright on where I usually work, making it a lot harder to create the levels. Oh well.
-
I've been noticing this more and more often, instead of maintaining the same "darkness" on all computers, my game appears to be a lot brighter on my pc for no reason.
This is what the game looks on my portable computer:
That is how it's meant to look, dark but with enough light to see where you can go.
This is the exact same scene (same settings and all) on my main computer:
At first I thought my monitor had its brightness up, but nope, that isn't the issue.
I realize that the game will look brighter or darker on some computer because of a variety of things, but I find it really weird that it looks darker on anything that isn't my main computer (it also makes it very hard to make the levels since I can see really well but the final product turns out really dark.)
Anyone have any clue how I could fix this "issue"?
-
I found out that this was a LEX Template problem due to the exe's being outdated. After an update, the decals now work again as intended.
- 1
-
Did you update your project to get the revised shaders?
Yes I did, I even made a new project just to make sure, and this issue happens on both of them.
-
-
This issue seems to be something that shouldn't be an issue from the get go, like rick mentioned. But since it is, I find it interesting how all of you have a different way of dealing with it.
At this point in time, I've messed around with all of your answers, and to be honest, all of them work, some more than others of course.
To be honest the ones I understand the most is Hankinator's and Rick's second option, and since Leadwerks doesn't have any kind of CSS compatibility I'll be sticking to Hank's method for now.
Thank you for all your answers nonetheless.
-
Hey all, I've just ran through all the forum posts about resolutions and everything and none of them seem to mention something that context:GetWidth and context:GetHeight don't do which is take into account the resolution at which the player is playing the game at.
Here's an example of what I'm talking about:
--Battery begin local battL =math.floor((context:GetWidth()))/2 - 775 local battY =math.floor((context:GetHeight()))/2 + 425 local battX =math.floor((context:GetWidth()))/2 - 800 local battery_percent = self.battery_level / self.battery_max_level --calculate the percentage of battery power remaining context:SetColor( 1 - battery_percent, battery_percent, 0, 1) --as the battery dies the red component increases while the green decreases context:DrawRect( battX, battY, battL * battery_percent, 20) --rectangle width is dependent on the percentage of battery remaining. Wider with more power. --Battery end
This is the post render part of the script I use for the flashlight bar.
Here's how it looks in my native 1920x1080 display:
And here's how it looks in the native leadwerks display 1024x768
See the difference? The flashlight bar doesn't show up and the interaction text is way too close to the middle of the screen, so my question is, is there an easy way to take the player's resolution and dynamically change the draw functions so they fit the screen no matter the resolution used?
-
I was looking to create a specific segment for my game that had a trigger happen when the player looked at something (it could be a model or a pivot, either would work).
Thing is how would this be possible? Since we're talking about the player's vision and not collision I have no idea how to even start doing this.
Here's an example, where you see the player running around everywhere, but only when he looks in a specific direction (in this case, up) does something happen.
-
I just got it and it's not worth it for us that use leadwerks, most of the files are .ma or .mb
There are a few .fbx here and there but they're quite scarce in comparison.
-
I was looking into improving the already implemented flashlight, but unfortunately my limited coding knowledge made me stuck pretty quickly, so here was my idea.
Have a flashlight model be a child of the fpsplayer (so it follows the mouses movement), line it up so it looks good, make a spotlight coming out of it, and then implement Hankinator's battery script to work with the new spotlight.
Battery script:
http://www.leadwerks.com/werkspace/topic/12783-flashlight-battery-tutorial/page__hl__flashlight
Problem is, I can't really figure out how to make it so that when the player presses F, the new spotlight appears and not the current one, and also how to implement the battery part of the code to work with it. (Since the battery script interacts with the player and not a child of the player)
Any guidance would be extremely helpful! Thanks!
Restarting the game.
in General Discussion
Posted
That does the trick, it sticks the loading screen in the background which is kind of weird, but nothing too bad for what I need right now.
Thanks.