Jump to content

Shirk

Members
  • Posts

    63
  • Joined

  • Last visited

Everything posted by Shirk

  1. I would like to see how to make recoil and random accuracy for the pistol.
  2. Although that is one way to do it, I feel that its limiting and would be a bad decision for performance, unless the model would be an instance and in that case wouldn't really be expensive at all. You also run into the problem of what happens when you get close, it will be a perfect outline of all the detail on the model, if it is lit it will still receive light (unless the texture is emmisive or doesnt receive shadows)
  3. You have to define what shadow mode it is, use self.flashlight:SetShadowMode(Light.Dynamic+Light.Static+Light.Buffered)
  4. I feel like that would limit me for when I want to run or something.
  5. Thanks for the reply! But that doesn't seem to change anything.
  6. 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 function Script:Headbob() local bob = 0; local jumpbob = 0 local speed = math.max(1,self.entity:GetVelocity():xz():Length()) if self.entity:GetAirborne() then speed = 0.1 end self.swayspeed = Math:Curve(speed,self.swayspeed,10) self.swayspeed = math.max(0.5,self.swayspeed) self.amplitude = math.max(2,Math:Curve(speed,self.amplitude,20)) self.timeunits = self.timeunits + self.swayspeed*4*Time:GetSpeed() local sway = math.sin(self.timeunits/120.0) * self.maxswayamplitude * self.amplitude bob = (1-math.cos(self.timeunits/60.0)) * self.maxswayamplitude * 0.1 * self.amplitude local campos = self.camera:GetPosition(true) self.smoothedposition.x = campos.x self.smoothedposition.y = Math:Curve(campos.y,self.smoothedposition.y,2) self.smoothedposition.z = campos.z self.camera:SetPosition(self.entity:GetPosition(true)+Vec3(sway*self.entity.scale.x,self.eyeheight + bob * 0.1,0)) self.entity:Translate(self.offset.x,self.offset.y,self.offset.z) end
  7. 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.
  8. 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.
  9. Id be interested in finding a way to get that to work too.
  10. Ive been trying to figure out the headbobbing in the last few days, but cant get anything to work.
  11. Id like to learn more about the player movement, like how to add crouch, headbobing and ect.
  12. 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)
  13. I know how to animate, and model. Im just unfamiliar with setting up a gun for leadwerks.
  14. That's exactly my problem. I don't recall it not being like that though.
  15. Im not quite sure how to replace the gun, as well as its animations.
  16. This is a problem with deferred lighting, its hard to solve. Personally Id love to see baked lighting to calculate radiosity.
  17. 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.
  18. The range setting for a directional light doesn't do anything.
  19. 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.
  20. 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?
  21. Im talking about how you can visually see the shadows ending and not rendering anymore, leaving a lit portion.
  22. Ive noticed that there is a really small render distance for the shadows produced by the sun. Is there any way to increase this?
  23. Are there any tutorials or references I can use to figure out how to change the viewmodel of the gun?
×
×
  • Create New...