Yay! cookies for you.![]()
When I found the function Util.PointContentson 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:
Returns 1 if the point V has any of the contents specified in S.Code:N = pointHasContent( V, S )
Available contents are the ones on the above wiki page, without the initial "CONTENTS_" bit. Lower or upper case does not matter. Example
Placing the E2 above water will print 1, anywhere else will print 0.Code:print(pointHasContent( entity():pos() - vec(0,0,50), "water" ))
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.
Placing the E2 above water OR the solid world will print 1, anywhere else will print 0.Code:print(pointHasContent( entity():pos() - vec(0,0,50), "water,solid" ))
This returns a string with all contents on the point V.Code:S = pointContents( V )
Last edited by Divran; 08-19-2010 at 11:14 AM.
SVN Tutorial
My SVN:Get dropbox and get 250 MB extra space: DropboxCode:http://divranspack.googlecode.com/svn/trunk/%20divranspack/
Yay! cookies for you.![]()
Comprehensive Gmod physics guide - Ballistic trajectory with drag - Autodyno engine performance test
Don't make the mistake these skydivers did and use any of my Gmod physics models for real life situations...
Oh nice, this will be useful.
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:Get dropbox and get 250 MB extra space: DropboxCode:http://divranspack.googlecode.com/svn/trunk/%20divranspack/
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.
Committed.
SVN Tutorial
My SVN:Get dropbox and get 250 MB extra space: DropboxCode:http://divranspack.googlecode.com/svn/trunk/%20divranspack/
Bookmarks