-
Posts
63 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by Shirk
-
-
That sounds awesome, how do you load and save though? Just hitting a button like F6 and F7? And I agree, I wish more tutorials would explain what everything is doing in detail, I don't like simple copy and paste scripts.
-
Here is a simple tutorial for a crouch function. I wouldn't say its very good, but at least its a start for someone.
Open up FPSPlayer.lua from your assets folder and navigate to the function UpdateWorld around line 230. Right after the end of
if window:KeyHit(Key.E)
add another window.KeyHit for the crouch button (In this case I used C)
if window:KeyDown(Key.C) then end
This checks to see if a key ( the C button) is pressed down within the window. In that add the following code
self.camera:SetPosition(self.entity:GetPosition(true)+Vec3(0,self.eyeheight * 0.5,0))
That sets the current cameras position to half the height of the players eye height.
Just under that add
self.moveSpeed = 2
This sets the current move speed to 2 (your speed may differ) so you don't walk as fast as you would standing up.
Now to check when the key isn't being pressed so you can continue walking at a normal speed.
if not window:KeyDown(Key.C) then self.moveSpeed = 4 end
That almost looks like the code above, except for the addition of not before the window:KeyDown. This checks to see when the key is not pressed down, and sets the speed back to the normal walking speed.
Also, can anyone help me figure out a simple viewbobbing? I dont really know where to begin.
-
Id be interested in finding a way to get that to work too.
-
Ive been trying to figure out the headbobbing in the last few days, but cant get anything to work.
-
Id like to learn more about the player movement, like how to add crouch, headbobing and ect.
-
Im talking about replacing the autopistol with my own model an animations. I know how to change the viewmodel in fpsweapon.lua, but Im not sure how do go about everything else (Animations and such are already present)
-
I know how to animate, and model. Im just unfamiliar with setting up a gun for leadwerks.
-
I have 70gb on dropbox,
-
Hmm, I tried playing with the view distance setting and I think I broke something, because now my shadows fade out when the camera moves away from them, regardless of what value I choose.
That's exactly my problem. I don't recall it not being like that though.
-
Im not quite sure how to replace the gun, as well as its animations.
-
This is a problem with deferred lighting, its hard to solve. Personally Id love to see baked lighting to calculate radiosity.
-
The thing is, if I dont use alpha, then the texture looks terrible. And I do have a light source, its just very dim because its night.
-
-
The range setting for a directional light doesn't do anything.
-
Personally Id love to see calculated baked lighting like Source or Unreal because its cheaper, and can be rendered at any distance and not have an impact on performance, unlike the deferred lighting.
-
Imported a tree with transparent leaf textures, but I noticed that the texture doesn't receive any lighting and is just glowing. How do I fix this?
-
Im talking about how you can visually see the shadows ending and not rendering anymore, leaving a lit portion.
-
Ive noticed that there is a really small render distance for the shadows produced by the sun. Is there any way to increase this?
-
Are there any tutorials or references I can use to figure out how to change the viewmodel of the gun?
-
Im not sure if decals are supported, but Id like to see some sort of decals with weapons, maybe with the included fpsweapon?
-
The health is displayed from FPSPlayer.lua, where as the ammo is displayed from FPSWeapon.lua, and Im assuming fpsweapon.lua is ran before fpsplayer.lua. Im not sure how to get the variables I used in fpsweapon.lua to work in fpsplayer.lua.
Thats kind of confusing, basically Im assuming one file is ran before the other, and so the vignette is displayed above. I cant use the ammo variables defined in fpsweapon.lua in fpsplayer.lua, if I could, then I would know how to fix the problem.
-
Alright so I got my basic HUD working, displays health and ammo. I decided to try and add vignette, which I have successfully except one small problem, the vignette layer is above the ammo layer so so it gets displayed above it, where as I would prefer it displayed below. The health displays above it (because I have the code written after the vignette in fpsplayer.lua).
Here is what Im talking about. How do I get my ammo to display above the vignette layer?
-
Editing App.lua works for me too, but I want to edit the fpsweapon.lua to be able to display an ammo counter.
-
Thanks for the response, but that doesn't seem to do anything. I added a simple print ("Test") to the loop function, but it appears that the whole function isn't even called.
Head bobbing problem
in Programming
Posted
Ive been trying to figure out why my headbobbing only really works when moving in a certain direction; east to west.
Heres a video of the problem. Notice that when I move in the direction of the crawler that it is working fine, but when I turn 90 degrees either way it stops working correctly.
here is my code