Jump to content

Jazz

Members
  • Posts

    265
  • Joined

  • Last visited

Posts posted by Jazz

  1. I don't get it sad.png My character skin still disappears.

    Is that "self.torso" a bone ?

     

    in start: self.child = self.entity:FindChild("Bone")

     

    Bone = top bone in the heirarchy

     

    In your Update loop:

     

    self.entity:SetPosition(self.child:GetPosition(true))

    • Like 1
    • Upvote 1
  2. What Aggror said. Also, I check if the source exists before trying to play it, just in case.

     

    if window:KeyHit(Key.F) then
     self.FLsource = Source:Create()
     self.FLsource:SetSound(self.sound.FLsound)
     self.FLsource:SetVolume(0.2)
     self.FLsource:SetLoopMode(true)
    end
    
    if self.torch1:Hidden() then
     self.torch1:Show()
     --check if source exists
     if self.FLsource ~= nil then
    	  --if it's not playing, play it
    	  if self.FLsource:GetState() == Source.Stopped then
    		   self.FLsource:Play()
    	  end
     end
    else
     self.torch1:Hide()
     --check if source exists
     if self.FLsource ~= nil then
    	  --if it's playing, stop it
    	  if self.FLsource:GetState() == Source.Playing then
    		   self.FLsource:Stop()
    	  end
     end
    end
    

  3. I did this pretty fast so I'm sure others will have a better way to do it, maybe using tables

    or something. I didn't want to have to rename sounds or material files, just drop the

    material on and it detects what the sound is automatically.

     

    Gravel, snow, dirt, and wood added as well.

     

    Using FPSPlayer.lua, in UpDateFootSteps() it calls function GetMaterialSound() which

    returns the randomized footstep sound for that material to play.

     

    Hacked up sounds are from www.freesfx.co.uk and www.freesound.org.

    Extra textures are from my public domain archives. Original images are not included,

    only the .tex files.

     

    Create a FPS project and extract the archive in the project's main directory.

    File is 20MB

     

    Now if we could just get the material of the terrain...

     

    https://www.dropbox.com/s/2bco2wr1dlou4gr/footsteps.zip?dl=0

    • Upvote 3
  4. Nice shader macklebee. Just made a (really) simple compass in PS for anyone to use/play with.

    I wrote the instructions out so new people can follow it.

    Extract the zip file into the Materials directory.

     

    This goes at the top of FPSPlayer.lua:

     

    Script.imageshader = Shader:Load("Shaders/drawimage_enhanced.shader")

    Script.Tx = Texture:Load("Materials/compass.tex")

    Script.Tx2 = Texture:Load("Materials/compasspointer.tex")

     

    This goes in FPSPlayer.lua's PostRender function after context:SetBlendMode(Blend.Alpha)

     

    context:DrawImage(self.Tx,100,100,200,200)

    local oldShader = context:GetShader()

    context:SetShader(self.imageshader)

    local angle = self.entity:GetRotation(true)

    self.imageshader:SetVec2("pivotposition", Vec2(100.0,100.0))

    self.imageshader:SetFloat("angle", angle.y)

    context:DrawImage(self.Tx2,100,100,200,200)

    context:SetShader(oldShader)

     

    If you're using the release version (4.2) where the SetInput bug exists change the following line or player rotation won't be updated when standing still:

    self.entity:SetInput(self.camRotation.y, playerMovement.z, playerMovement.x, jump , false, 1.0, 0.5, true)

     

    to

     

    self.entity:SetInput(self.camRotation.y, playerMovement.z + 0.0000001, playerMovement.x, jump , false, 1.0, 0.5, true)

    compass.zip

    post-12583-0-04642200-1485121050.gif

    • Upvote 3
  5. Please expose these commands to LUA. Ragdolls still need them.

     

    NEWTON_API dFloat NewtonJointGetStiffness (const NewtonJoint* const joint);

    NEWTON_API void NewtonJointSetStiffness (const NewtonJoint* const joint, dFloat state);

    • Upvote 3
×
×
  • Create New...