+ Reply to Thread
Results 1 to 6 of 6

Thread: [E2] pointContents will be added soon. This is a tutorial thread.

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

    Smile [E2] pointContents will be added soon. This is a tutorial thread.

    When I found the function Util.PointContents on the wiki, I thought it could be useful for E2. I was then reminded of its usefulness in an E2 ranger thread, so I (with help from emspike) made it. I just have to ask emspike if he has anything to change about them when he comes online, then I will commit the functions.

    Ok this is no longer tricky to use, but I'll explain anyway since I already made this thread:

    Code:
    N = pointHasContent( V, S )
    Returns 1 if the point V has any of the contents specified in S.

    Available contents are the ones on the above wiki page, without the initial "CONTENTS_" bit. Lower or upper case does not matter. Example
    Code:
    print(pointHasContent( entity():pos() - vec(0,0,50), "water" ))
    Placing the E2 above water will print 1, anywhere else will print 0.

    Notice that you can specify several contents at once, seperated with a comma. The comma works like an "or" symbol, so the function returns 1 if any one of the strings given exist in the point.
    Code:
    print(pointHasContent( entity():pos() - vec(0,0,50), "water,solid" ))
    Placing the E2 above water OR the solid world will print 1, anywhere else will print 0.

    Code:
    S = pointContents( V )
    This returns a string with all contents on the point V.
    Last edited by Divran; 08-19-2010 at 11:14 AM.
    SVN Tutorial
    My SVN:
    Code:
    http://divranspack.googlecode.com/svn/trunk/%20divranspack/
    Get dropbox and get 250 MB extra space: Dropbox

  2. #2
    hurrr physics Tolyzor's Avatar
    Join Date
    Aug 2008
    Location
    England
    Posts
    1,020

    Default Re: [E2] pointContents will be added soon. This is a tutorial thread.

    Yay! cookies for you.
    Comprehensive Gmod physics guide - Ballistic trajectory with drag - Autodyno engine performance test
    Quote Originally Posted by janvos2506 View Post
    i just going to type the code over and over again and maybe il remeber it then
    Don't make the mistake these skydivers did and use any of my Gmod physics models for real life situations...

  3. #3
    Ursus maritimus Drunkie's Avatar
    Join Date
    Feb 2009
    Location
    Canada
    Posts
    5,662
    Blog Entries
    1

    Default Re: [E2] pointContents will be added soon. This is a tutorial thread.

    Oh nice, this will be useful.

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

    Default Re: [E2] pointContents will be added soon. This is a tutorial thread.

    Committed.
    Code:
    [E2] Added pointContents & related functions. Check http://www.wiremod.com/forum/developers-showcase/22050-e2-pointcontents-will-added-soon-tutorial-thread.html for more info.


    Edit: Scratch that. Talked to Syranide, and he had a much better idea for the implementation of these functions, and much simpler. So simple that this "tutorial" isn't needed.
    Update reverted. Me an emspike will work on getting Syranide's epic idea for tomorrow.
    Last edited by Divran; 08-17-2010 at 02:29 PM.
    SVN Tutorial
    My SVN:
    Code:
    http://divranspack.googlecode.com/svn/trunk/%20divranspack/
    Get dropbox and get 250 MB extra space: Dropbox

  5. #5
    Wire Sofaking emspike's Avatar
    Join Date
    Feb 2008
    Posts
    911

    Default Re: [E2] pointContents will be added soon. This is a tutorial thread.

    Actually its done but your not online so

    The new code is much more compact.

    EDIT: both the e2function code and the usage in E2
    Last edited by emspike; 08-17-2010 at 03:30 PM.

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

    Default Re: [E2] pointContents will be added soon. This is a tutorial thread.

    Committed.
    SVN Tutorial
    My SVN:
    Code:
    http://divranspack.googlecode.com/svn/trunk/%20divranspack/
    Get dropbox and get 250 MB extra space: Dropbox

+ Reply to Thread

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