Hi all, is there a method to get map brush model info?
I'm trying to get all models used by a map. But I can only get prop_xxxx's model using the code below:
Code:
// 0=worldspawn, skip
for (int i=1; i<=GetEntityCount(); i++)
{
// invalid entity
if (!IsValidEntity(i))
continue;
// Ent has this property
if (HasEntProp(i, Prop_Data, "m_ModelName"))
{
// Success?
if (GetEntPropString(i, Prop_Data, "m_ModelName", sName, sizeof(sName)))
{
// modelname is ptr?
if (sName[0] == '*' && (hModelTable != INVALID_STRING_TABLE))
{
// Process stringtable
ReplaceString(sName, sizeof(sName), "*", "", false);
int iTableIdx = StringToInt(sName);
ReadStringTable(hModelTable, iTableIdx, sName, sizeof(sName));
}
PrintToServer("m_ModelName -> %s", sName);
}
}
}
How ever, I still got "*xx" in modelprecache StringTables. When I dumped the whole modelprecache table I got these:
Quote:
maps/de_elysion.bsp
*1
*2
*3
*4
*5
*6
*7
*8
*9
*10
*11
*12
*13
*14
*15
*16
*17
*18
*19
*20
*21
|
So.. Is there a method can let me reach the model path by this pattern looks like ptr?
Thank you for helping.
__________________
aka. EmeraldGhost / eeeeeG ^^