[ H3LP ] Get All entity keyvalues
Hello. Is there any way to get all keyvalues of entities from the bsp file? I want to get for each entity, every keyvalue because I'm working on an EntMod and that seems to be the trickier part in SourceMod. Any help would be appreciated. Thanks !
|
Re: [ H3LP ] Get All entity keyvalues
Thing is that they're not actually stored as KeyValues internally. They're just a bunch of string compares that (usually) map the key/value to member variables of the entity. If you want to find what keys are accepted by an entity, go to the CEntityType::KeyValue function and follow those string compares, I'm not sure if theres an easier way to do this. This can be seen here: https://mxr.alliedmods.net/hl2sdk-sd...shared.cpp#320
nosoop does have a plugin that reads the entity lump from OnLevelInit, which contains the raw entity data as it is from bsp (looks like this: https://developer.valvesoftware.com/..._Format#Entity) and converts it into KeyValues, so that might be what you're looking for. Also if you're trying to add your own custom keyvalues into the bsp and reading them from a plugin, I made an extension that makes that easy to do: https://github.com/SlidyBat/CustomKeyValues Hope this H3LPs. |
Re: [ H3LP ] Get All entity keyvalues
Quote:
|
Re: [ H3LP ] Get All entity keyvalues
Quote:
|
Re: [ H3LP ] Get All entity keyvalues
Show us the code you're using that causes that error.
|
Re: [ H3LP ] Get All entity keyvalues
Quote:
Code:
Code:
L 03/03/2018 - 08:58:05: [SM] Exception reported: Property "m_iHammerID" not found (entity 23/ff_entity_system_helper) |
Re: [ H3LP ] Get All entity keyvalues
And what game are you on? Would also be good if you could send the bsp file of map you're doing this on.
|
Re: [ H3LP ] Get All entity keyvalues
Quote:
|
Re: [ H3LP ] Get All entity keyvalues
Guess you can't use the nosoop plugin out of the box then, since the hammerid is needed to uniquely identify the entity in the entity lump :(
Would still be good to see the bsp file to see what kind of values entities have in case there is possibly something else you could use to id the all the entities. |
Re: [ H3LP ] Get All entity keyvalues
My plugin assumes entities have a Hammer ID that can be accessed (to associate them with the entity lump data); if you can dump your map's entities with, say, Stripper:Source I could verify whether or not Fortress Forever fits those assumptions.
Otherwise you can just grab the OnLevelInit forward and ParseEntityList functions and iterate the resulting KeyValues structure yourself. Unless you have some unique key per entity, you may have some trouble getting the key/value pairs associated with actual entities. You could probably jump into C++ and iterate over entities' external names; nothing comparable in SourceMod at this time though, and out of my scope of development. |
All times are GMT -4. The time now is 17:11. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.