Raised This Month: $ Target: $400
 0% 

Solved Entity real name


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ZaX
Senior Member
Join Date: Jan 2015
Old 11-13-2019 , 01:01   Entity real name
Reply With Quote #1

Hey,
Is it possible to get the entity real name? Such as func_breakable, mappers name each entity on the map in VHE, or another program.
Is it possible to get the name?

Classname returns the entity class, globalname doesnt work and same for targetname

Last edited by ZaX; 11-14-2019 at 23:44.
ZaX is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 11-14-2019 , 06:48   Re: Entity real name
Reply With Quote #2

I assume it's retrieved in fakemeta using pev_targetname
__________________
@Jailbreak Main Mod v2.6.6 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 11-14-2019 , 07:06   Re: Entity real name
Reply With Quote #3

Quote:
Originally Posted by Natsheh View Post
I assume it's retrieved in fakemeta using pev_targetname
He already mentioned that targetname doesn't work.
__________________
edon1337 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 11-14-2019 , 10:57   Re: Entity real name
Reply With Quote #4

Such as func_breakable ?

That is a class name if he named the class name to something different it may not even function it wouldn't be an entity just an object.
__________________
@Jailbreak Main Mod v2.6.6 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
JocAnis
Veteran Member
Join Date: Jun 2010
Old 11-14-2019 , 11:12   Re: Entity real name
Reply With Quote #5

It is possible to do, what exactly do you need?
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-14-2019 , 11:18   Re: Entity real name
Reply With Quote #6

Quote:
Originally Posted by Natsheh View Post
Such as func_breakable ?

That is a class name if he named the class name to something different it may not even function it wouldn't be an entity just an object.
No. Each entity can be assigned a name in VHE.

It should indeed be targetname. Take a look at this BaseBuilder mod - https://forums.alliedmods.net/showthread.php?t=144287
It uses entities named "barrier" to do stuff.

PHP Code:
g_iEntBarrier find_ent_by_tname( -1"barrier" ); 
And entities named "ignore" for other things. Here the guy got the name like this:

PHP Code:
new szClass[10], szTarget[7];
entity_get_string(entEV_SZ_classnameszClass9);
entity_get_string(entEV_SZ_targetnameszTarget6);
if (!
equal(szClass"func_wall") || equal(szTarget"ignore"))
    return 
PLUGIN_HANDLED
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
JocAnis
Veteran Member
Join Date: Jun 2010
Old 11-14-2019 , 11:35   Re: Entity real name
Reply With Quote #7

i have been fighting with these names from VHE for 2man kz maps, and how i remember it was a little confusing, like target in .sma was name in VHE or something like that, try these things:
Code:
1)
entity_get_string( ent, EV_SZ_target, target, charsmax( target ) )
entity_get_string( ent, EV_SZ_targetname, target2, charsmax( target2 ) )

and i had this also:

2)
new targetent = FM_NULLENT;

//this below was done in plugin_init, cant remember if it must be there, but just to let you know:
while(( targetent = engfunc(EngFunc_FindEntityByString, targetent, "name", target ) != 0))
{
//your code
}
i dont have time to test it again, but i think second one is more accurate, you can test it
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)

Last edited by JocAnis; 11-14-2019 at 11:38.
JocAnis is offline
Old 11-14-2019, 14:25
gabuch2
This message has been deleted by gabuch2. Reason: nvm
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 11-14-2019 , 17:40   Re: Entity real name
Reply With Quote #8

Quote:
Originally Posted by ZaX View Post
Hey,
Is it possible to get the entity real name? Such as func_breakable, mappers name each entity on the map in VHE, or another program.
Is it possible to get the name?

Classname returns the entity class, globalname doesnt work and same for targetname
Pizza Hut's Entity Info.

TO DO: Find_sphere_class_highlighting.


Secret Door from Crossfire


Entity 258
EV_INT_movetype = 7
EV_INT_solid = 4
EV_INT_modelindex = 64
EV_INT_spawnflags = 768
EV_INT_rendermode = 1
EV_FL_ltime = 2.940000
EV_FL_nextthink = -1.000000
EV_FL_speed = 200.000000
EV_FL_renderamt = 150.000000
EV_VEC_movedir = (-0.000000,0.000000,-1.000000)
EV_VEC_absmin = (638.000000,1438.000000,-1858.000000)
EV_VEC_absmax = (658.000000,1522.000000,-1758.000000)
EV_VEC_mins = (639.000000,1439.000000,-1857.000000)
EV_VEC_maxs = (657.000000,1521.000000,-1759.000000)
EV_VEC_size = (18.000000,82.000000,98.000000)
EV_VEC_rendercolor = (0.000000,255.000000,0.000000)
EV_ENT_pContainingEntity = 258
EV_SZ_classname = func_door
EV_SZ_model = *63
EV_SZ_targetname = secret_door
EV_SZ_noise1 = common/null.wav
EV_SZ_noise2 = doors/doorstop4.wav


Others:
Entity Network Monitor.
Entity Lab (Engine based) [Final]
Entity Tool
Ent Fun: unlock door!

Code:
new entlist[513]; find_sphere_class(0,"classname_to_find",radius_float,entlist,512,origin_vector);



https://developer.valvesoftware.com/...-Life_entities
https://wiki.alliedmods.net/Finding_Entities_(AMX_Mod_X)
Attached Images
File Type: jpg crossfire0003.jpg (93.1 KB, 149 views)
__________________
DJEarthQuake is offline
ZaX
Senior Member
Join Date: Jan 2015
Old 11-14-2019 , 21:02   Re: Entity real name
Reply With Quote #9

Quote:
Originally Posted by OciXCrom View Post
No. Each entity can be assigned a name in VHE.

It should indeed be targetname. Take a look at this BaseBuilder mod - https://forums.alliedmods.net/showthread.php?t=144287
It uses entities named "barrier" to do stuff.

PHP Code:
g_iEntBarrier find_ent_by_tname( -1"barrier" ); 
And entities named "ignore" for other things. Here the guy got the name like this:

PHP Code:
new szClass[10], szTarget[7];
entity_get_string(entEV_SZ_classnameszClass9);
entity_get_string(entEV_SZ_targetnameszTarget6);
if (!
equal(szClass"func_wall") || equal(szTarget"ignore"))
    return 
PLUGIN_HANDLED
It didnt work aswell, im trying to get the entity name and print it in chat after it gets destroyed/killed
Correct me if i was mistaken
PHP Code:
        new szTargetname[7], szName[32]
        
get_user_namekillerszNamecharsmax(szName))
        
entity_get_string(entEV_SZ_targetnameszTargetname6)

        
client_print(0print_chat"*%s* was broken by *%s*"szTargetname szName
BTW, im not sure if targetname gets the entity name after it gets destroyed/killed, i think it gets the name when you aim on the entity

Quote:
Originally Posted by JocAnis View Post
i have been fighting with these names from VHE for 2man kz maps, and how i remember it was a little confusing, like target in .sma was name in VHE or something like that, try these things:
Code:
1)
entity_get_string( ent, EV_SZ_target, target, charsmax( target ) )
entity_get_string( ent, EV_SZ_targetname, target2, charsmax( target2 ) )

and i had this also:

2)
new targetent = FM_NULLENT;

//this below was done in plugin_init, cant remember if it must be there, but just to let you know:
while(( targetent = engfunc(EngFunc_FindEntityByString, targetent, "name", target ) != 0))
{
//your code
}
i dont have time to test it again, but i think second one is more accurate, you can test it

I have tried both of these, not working
PHP Code:
entity_get_stringentEV_SZ_targettargetcharsmaxtarget ) )
entity_get_stringentEV_SZ_targetnametarget2charsmaxtarget2 ) ) 
Whats the 'target'? the 4th arg in engfunc
PHP Code:
while(( targetent engfunc(EngFunc_FindEntityByStringtargetent"name"target ) != 0)) 



Quote:
Originally Posted by DJEarthQuake View Post
Pizza Hut's Entity Info.

TO DO: Find_sphere_class_highlighting.


Secret Door from Crossfire


Entity 258
EV_INT_movetype = 7
EV_INT_solid = 4
EV_INT_modelindex = 64
EV_INT_spawnflags = 768
EV_INT_rendermode = 1
EV_FL_ltime = 2.940000
EV_FL_nextthink = -1.000000
EV_FL_speed = 200.000000
EV_FL_renderamt = 150.000000
EV_VEC_movedir = (-0.000000,0.000000,-1.000000)
EV_VEC_absmin = (638.000000,1438.000000,-1858.000000)
EV_VEC_absmax = (658.000000,1522.000000,-1758.000000)
EV_VEC_mins = (639.000000,1439.000000,-1857.000000)
EV_VEC_maxs = (657.000000,1521.000000,-1759.000000)
EV_VEC_size = (18.000000,82.000000,98.000000)
EV_VEC_rendercolor = (0.000000,255.000000,0.000000)
EV_ENT_pContainingEntity = 258
EV_SZ_classname = func_door
EV_SZ_model = *63
EV_SZ_targetname = secret_door
EV_SZ_noise1 = common/null.wav
EV_SZ_noise2 = doors/doorstop4.wav


Others:
Entity Network Monitor.
Entity Lab (Engine based) [Final]
Entity Tool
Ent Fun: unlock door!

Code:
new entlist[513]; find_sphere_class(0,"classname_to_find",radius_float,entlist,512,origin_vector);



https://developer.valvesoftware.com/...-Life_entities
https://wiki.alliedmods.net/Finding_Entities_(AMX_Mod_X)
Im not sure if I understood all of it, but it seems your method shows the name when you aim on it

Quote:
Originally Posted by JocAnis View Post
It is possible to do, what exactly do you need?
Print the entity name after it gets killed/destroyed

Last edited by ZaX; 11-14-2019 at 21:03.
ZaX is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-14-2019 , 21:36   Re: Entity real name
Reply With Quote #10

Show us the code in which you're trying to get the name. You may be using it on a wrong entity index. Also, are you sure the entity even has a name?
__________________

Last edited by OciXCrom; 11-14-2019 at 21:36.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 07:59.


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