Raised This Month: $ Target: $400
 0% 

Find all brushes in a map


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-02-2010 , 08:41   Find all brushes in a map
Reply With Quote #1

Hi

I want to know if it is possible to find all the brushes a map has without making a while for all the entity names. I want to find every wall, door, box, just everything. I tried using a 0 index but that doesn't work.

Thanks
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 06-02-2010 , 10:56   Re: Find all brushes in a map
Reply With Quote #2

Quote:
Originally Posted by drekes View Post
Hi

I want to know if it is possible to find all the brushes a map has without making a while for all the entity names. I want to find every wall, door, box, just everything. I tried using a 0 index but that doesn't work.

Thanks
You can, at plugin_init, iterate over all entities (from glb_maxClients+1 to glb_maxEntities). Check if it's a valid entity and then do whatever you want (store in array, print out info, etc).

You can get entity class using pev_classname.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-02-2010 , 12:36   Re: Find all brushes in a map
Reply With Quote #3

Could you make an example of it? I don't understand it very well.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 06-02-2010 , 13:10   Re: Find all brushes in a map
Reply With Quote #4

This is untested, but should work.

PHP Code:
#include <amxmodx>
#include <fakemeta>

public plugin_init()
{
    new class[
32]
    new 
maxents global_get(glb_maxEntities)
    for(new 
0<= maxentsi++)
    {
        if(!
pev_valid(i))
            continue

        
pev(ipev_classname, class, charsmax(class))
        
server_print("Found entity %i with classname of %s"i, class)
    }
    
server_print("Have a good day!")

__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-02-2010 , 13:13   Re: Find all brushes in a map
Reply With Quote #5

Thanks, i understand it now. I'll try it out.

EDIT: works on everything, except some walls, i guess the brushes that aren't an entity. Is it possible to do stuff with them to?
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.

Last edited by drekes; 06-02-2010 at 13:19.
drekes is offline
Send a message via MSN to drekes
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 06-02-2010 , 13:57   Re: Find all brushes in a map
Reply With Quote #6

the "walls" you know mostly have no classname, only special walls are "func_wall"
__________________
I am out of order!
grimvh2 is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-02-2010 , 13:59   Re: Find all brushes in a map
Reply With Quote #7

Quote:
Originally Posted by grimvh2 View Post
the "walls" you know mostly have no classname, only special walls are "func_wall"
Is it possible to find and do something with those to?
i tried "" and "worldspawn", but it didn't worl
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 06-02-2010 , 14:05   Re: Find all brushes in a map
Reply With Quote #8

Are you sure that they're entities?

Try with this tool

http://forums.space-headed.net/viewtopic.php?f=43&t=111

To list ALL entities issue the command "listent" at console
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-02-2010 , 14:07   Re: Find all brushes in a map
Reply With Quote #9

i'm pretty sure that they aren't entity's but just walls with no classname, like grimvh2 said. But is it possible to do stuff with those walls to? Like in this case render them?

Nice tool, gonna mess around with it now.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 06-02-2010 , 15:49   Re: Find all brushes in a map
Reply With Quote #10

Quote:
Originally Posted by drekes View Post
i'm pretty sure that they aren't entity's but just walls with no classname, like grimvh2 said. But is it possible to do stuff with those walls to? Like in this case render them?

Nice tool, gonna mess around with it now.
Unfortunately, no. You're not able to really do anything to the worldspawn brushes. Those are basically the map only and not entities. Since they aren't actual entities, you're not able to render them.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Reply


Thread Tools
Display Modes

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 05:16.


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