Raised This Month: $51 Target: $400
 12% 

Get World Bounds


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Luke Penny
Senior Member
Join Date: Jan 2010
Location: Canada
Old 10-06-2010 , 19:44   Get World Bounds
Reply With Quote #1

I'm trying to get the world min and max bounds and store them in a vector, but I'm not sure where to start. All I know is there is an m_WorldMins and m_WorldMaxs but I'm not sure how I would get them.
__________________
Luke Penny is offline
McFlurry
Veteran Member
Join Date: Mar 2010
Location: RemoveEdict(0);
Old 10-06-2010 , 20:14   Re: Get World Bounds
Reply With Quote #2

To do this I would think you would need to get the entity data from edict 0 (world). Is that even possible?
__________________
McFlurry is offline
Send a message via Skype™ to McFlurry
Luke Penny
Senior Member
Join Date: Jan 2010
Location: Canada
Old 10-06-2010 , 20:32   Re: Get World Bounds
Reply With Quote #3

Quote:
Originally Posted by McFlurry View Post
To do this I would think you would need to get the entity data from edict 0 (world). Is that even possible?
Apparently, it is. Did a little tinkering, and this works.

PHP Code:
new Float:maxbounds[3];
GetEntPropVector(0Prop_Data"m_WorldMaxs"maxbounds); 
Before I was trying to get the worlds edict by classname (worldspawn), simply using 0 did the trick. Thanks!
__________________
Luke Penny is offline
necavi
Veteran Member
Join Date: Sep 2010
Old 10-06-2010 , 20:37   Re: Get World Bounds
Reply With Quote #4

Sorry to push in on your thread here, but a related topic is: Is it possible to get the coordinates (most likely just X and Y, not Z) of the spawn area easily and dynamically?
necavi is offline
Luke Penny
Senior Member
Join Date: Jan 2010
Location: Canada
Old 10-06-2010 , 20:46   Re: Get World Bounds
Reply With Quote #5

Quote:
Originally Posted by necavi View Post
Sorry to push in on your thread here, but a related topic is: Is it possible to get the coordinates (most likely just X and Y, not Z) of the spawn area easily and dynamically?
Depends on the game - If the spawn area is defined with a brush entity it's most likely possible using the same thing as above, if not then you could try defining a certain area around the info_player_spawn entities as the spawn area.
__________________
Luke Penny is offline
necavi
Veteran Member
Join Date: Sep 2010
Old 10-06-2010 , 21:22   Re: Get World Bounds
Reply With Quote #6

I'm afraid that I don't know how to find a property such as m_WorldMaxs Is it possible for you to either tell me what the property for spawns would be, or (more preferably) direct me to a tutorial on finding them?
necavi is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 10-07-2010 , 00:13   Re: Get World Bounds
Reply With Quote #7

What game?
FaTony is offline
necavi
Veteran Member
Join Date: Sep 2010
Old 10-07-2010 , 02:35   Re: Get World Bounds
Reply With Quote #8

Counter-Strike: Source
necavi is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 10-07-2010 , 02:49   Re: Get World Bounds
Reply With Quote #9

You mean buy area?
FaTony is offline
necavi
Veteran Member
Join Date: Sep 2010
Old 10-07-2010 , 02:52   Re: Get World Bounds
Reply With Quote #10

Well, this is to restrict a certain thing from happening within the same area that clients can spawn into (plus some, so I can't just do something like an in_spawn check or something similar).
necavi is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:13.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode