View Poll Results: What should I do?

Voters
21. You may not vote on this poll
  • Change R:position() to work like Lua's and create the two new LeftSolid functions for E2.

    12 57.14%
  • Leave it as it is and don't create the two new functions.

    3 14.29%
  • Leave it as it is and create 1 new function which returns the hit position like Lua (Possibly naming it R:pos())

    6 28.57%
+ Reply to Thread
Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: [E2] Built-in ranger changes?

  1. #11
    No u Divran's Avatar
    Join Date
    Jul 2008
    Location
    Sweden
    Posts
    4,582

    Default Re: [E2] Built-in ranger changes?

    Alright if no one has any objections by tomorrow (friday 20th) evening, I'm going to commit option nr 3 of the vote. I've decided to use that because it was the best idea I had, and it doesn't cause any compatibility issues at all.
    This means that if you start the trace inside the world, ranger:position() will equal to ranger:positionLeftSolid(), and if you DON'T start the trace inside the world, ranger:positionLeftSolid() will equal to 0,0,0 and ranger:position will equal to ranger:pos()
    SVN Tutorial
    My SVN:
    Code:
    http://divranspack.googlecode.com/svn/trunk/%20divranspack/
    Get dropbox and get 250 MB extra space: Dropbox

  2. #12
    Wire Sofaking immibis's Avatar
    Join Date
    Nov 2009
    Location
    Wellington, New Zealand
    Posts
    401

    Default Re: [E2] Built-in ranger changes?

    Was there any point in the poll then?

    0a3c696d6d696269733e092e2e2e7774662c20776879206973 20746865726520612068696464656e20666f72756d2063616c 6c6564206469783f200a3c4a6174476f6f6477696e3e093e2e 3e200a3c4a6174476f6f6477696e3e093c2e3c200a3c49616d 4d634c6f76696e3e094e4f200a3c49616d4d634c6f76696e3e 094e4f204e4f204e4f204e4f204e4f

  3. #13
    No u Divran's Avatar
    Join Date
    Jul 2008
    Location
    Sweden
    Posts
    4,582

    Default Re: [E2] Built-in ranger changes?

    At first, yes, because I didn't know which option was best. But then I came up with the third option later on.
    SVN Tutorial
    My SVN:
    Code:
    http://divranspack.googlecode.com/svn/trunk/%20divranspack/
    Get dropbox and get 250 MB extra space: Dropbox

  4. #14
    No u Divran's Avatar
    Join Date
    Jul 2008
    Location
    Sweden
    Posts
    4,582

    Default Re: [E2] Built-in ranger changes?

    Committed.
    New functions list:
    Code:
    #where R is a ranger trace
    R:pos() #Returns the position of the trace. This function is different from R:position() in the way that R:pos() works like Lua's trace and R:position() returns the positionLeftSolid() if it was started inside the world.)
    R:fraction() # Returns a number between 0-1 (this is like the percentage of the distance between the start/endpos of the trace that the trace went. Hard to explain)
    R:hitWorld() #Returns 1 if the trace hit the world, else 0
    R:hitSky() #Returns 1 if the trace hit the skybox, else 0
    R:positionLeftSolid() #Returns the position at which it left the world, if the trace was started inside the world. If it was started inside the world, this function returns the same position as R:position().
    R:fractionLeftSolid() #Same as R:fraction, but indicating the distance to the left solid position instead of the distance to the hitpos
    R:startSolid() #Returns 1 if the trace started inside the world, else 0
    R:matType() #Returns the material type (Can be used to see if a ranger hit water, for example)
    R:hitGroup() #If aimed at a player or bot (Possibly also works for NPCs, haven't tested), it returns the hit "group" that the trace hit (ie "stomach, head, left hand, right leg" etc)
    R:toTable() #Converts the trace data into an E2-style table. Remember that this returns the raw data, so for matType and hitGroup, I recommend using the functions instead of this table.
    I also made rangerFilter cost A LOT if you spam it, in order to prevent abuse (the function could previously be used to pretty much lag any server to death almost instantly - Now it'll just crash your E2 of tick quota.)

    We can has wiki update: http://wiki.garrysmod.com/?title=Wir...uilt-In_Ranger
    Last edited by Divran; 08-20-2010 at 04:42 PM.
    SVN Tutorial
    My SVN:
    Code:
    http://divranspack.googlecode.com/svn/trunk/%20divranspack/
    Get dropbox and get 250 MB extra space: Dropbox

+ Reply to Thread
Page 2 of 2 FirstFirst 12

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