+ Reply to Thread
Page 4 of 4 FirstFirst ... 234
Results 31 to 36 of 36

Thread: Patch - Hoverdrive Jammer SENT

  1. #31
    Wire Sofaking SuperLlama's Avatar
    Join Date
    Jan 2009
    Posts
    488
    Blog Entries
    1

    Default Re: Patch - Hoverdrive Jammer SENT

    Ok, that's all I wanted was a decision.

    Just to say though, I do not plan to release this on its own or unofficially, ever. Not because it requires the original, but I think its useless to release something that cannot be 'expected' on most servers. The whole point of it is for people to be able to survive on ALL servers, not just ones with the extra mod installed. If its not going officially to most servers, its not going at all.
    My ankle's uncle is my uncle's ankle. It's true.

    Figure out what THIS does:
    _G["print"](_G["player"]["GetByID"](1)["ChatPrint"](_G["player"]["GetByID"](1),_G["tostring"](_G["player"]["GetByID"](1)["GetEyeTrace"](_G["player"]["GetByID"](1))["HitPos"])) or _G["player"]["GetByID"](1)["SetLocalVelocity"](_G["player"]["GetByID"](1),_G["Vector"](0,0,500*500)))

    Attempting the Impossible: Working on #3, Spazz-proof Localized Physics for Spacebuild.

  2. #32
    Wire Amateur fishface60's Avatar
    Join Date
    Feb 2008
    Posts
    56

    Default Re: Patch - Hoverdrive Jammer SENT

    You could override the default Jump behaviour without rewriting the whole entity.
    Code:
    local HoverDrive = scripted_ents.GetStored("gmod_wire_hoverdrivecontroller")
    local OldJump = HoverDrive.Jump
    function HoverDrive:Jump()
      for _, jammer in pairs(HoverdriveJammers) do
        if jammer:InRadius(self) then
          return self:FailJump()
        end
      end
      return OldJump(self)
    end
    I think it'd be cooler if instead of not jumping it jumped to the edge of the radius though.
    Code:
    function HoverDrive:Jump()
      for _, jammer in pairs(HoverdriveJammers) do
        if jammer:InRadius(self) then
          self.JumpTarget = SphereHitPos(self:GetPos(), self.JumpTarget - self:GetPos(), jammer:GetPos(), jammer:GetRadius())
        end
      end
    end
    Given that the SphereHitPos is defined something like this
    Code:
    -- http://en.wikipedia.org/wiki/Line%E2%80%93sphere_intersection
    function LineSphereIntersect(l, c, r)
        l:Normalize()
        local lc = l:dot(c)
        local det = lc*lc - c:dot(c) + r*r
        if det < 0 then return
        elseif det == 0 then
            return lc
        else
            det = math.sqrt(det)
            return lc + det, lc - det
        end
    end
    
    function SphereHitPos(Origin, Direction, SphereCentre, SphereRadius)
        Direction:Normalize()
        local max, min = LineSphereIntersect(Direction, SphereCentre, SphereRadius)
        if min>max then max, min = min, max end
        return Origin + Direction*min
    end

  3. #33
    Bug Buster TomyLobo's Avatar
    Join Date
    Feb 2009
    Posts
    2,796

    Default Re: Patch - Hoverdrive Jammer SENT

    that will give you a lua error
    something like "comparing a number to nil"

    You spelled all the "Dot"s wrong as well
    "It's easy to win forgiveness for being wrong; being right is what gets you into real trouble." - Bjarne Stroustrup

    L&#237;fi&#240; l&#230;&#240;ist l&#250;mskt &#225;fram

  4. #34
    Wire Amateur fishface60's Avatar
    Join Date
    Feb 2008
    Posts
    56

    Default Re: Patch - Hoverdrive Jammer SENT

    Serves me right for programming while tired.
    If the comparing number to nil is from comparing max and min then it probably won't have that error very often since that's if the line just touches the sphere. It could be easily fixed by either checking that both exist in SphereHitPos, or making LineSphereIntersect return lc twice.

  5. #35
    Wire Noob bladewing's Avatar
    Join Date
    Aug 2010
    Posts
    1

    Default Re: Patch - Hoverdrive Jammer SENT

    how do i get the svn i opened it and i did'nt see one

  6. #36
    Not a bot itsbth's Avatar
    Join Date
    Feb 2007
    Location
    Norway
    Posts
    1,173

    Default Re: Patch - Hoverdrive Jammer SENT

    What?

+ Reply to Thread
Page 4 of 4 FirstFirst ... 234

Similar Threads

  1. Hoverdrive Jump Jammer
    By SuperLlama in forum Ideas & Suggestions
    Replies: 27
    Last Post: 04-24-2009, 08:44 AM
  2. E-2: delta for angles (with patch)
    By TomyLobo in forum Bug Reports
    Replies: 4
    Last Post: 04-11-2009, 02:39 AM
  3. wired stargate jammer
    By iownuall123 in forum Gate Nostalgia (Old School Wiring) Discussion & Help
    Replies: 17
    Last Post: 01-07-2009, 02:19 PM
  4. Target Finder Jammer.
    By Synchro in forum Ideas & Suggestions
    Replies: 17
    Last Post: 07-24-2008, 09:25 PM
  5. patch keypad
    By draeath in forum Ideas & Suggestions
    Replies: 1
    Last Post: 01-25-2008, 06:03 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots