point_template and template objects

Hi gyus, i’m looking for work with entity point_template. It contains 16 spaces for templates “<Template>01-16” when entity inicialized it makes ents from list to “TemplateEntities” class where storages all data about this entities. As i know, this informations saves to the map cache:



void CPointTemplate::StartBuildingTemplates( void )
{
	// Build our list of template entities
	for ( int i = 0; i < MAX_NUM_TEMPLATES; i++ )
	{
		if ( m_iszTemplateEntityNames* != NULL_STRING )
		{
			CBaseEntity	*pEntity = NULL;
			int iOldNum = m_hTemplateEntities.Count();
			// Add all the entities with the matching targetname
			while ( (pEntity = gEntList.FindEntityByName( pEntity, STRING(m_iszTemplateEntityNames*) )) != NULL )
			{
				m_hTemplateEntities.AddToTail( pEntity );
			}

			// Useful mapmaker warning
			if ( iOldNum == m_hTemplateEntities.Count() )
			{
				Warning( "Couldn't find any entities named %s, which point_template %s is specifying.
", STRING(m_iszTemplateEntityNames*), STRING(GetEntityName()) );
			}
		}
	}
}


after this entity become nill in lua, and in save table of entity “point_template” Template01 become name of teplated entity.
So there is the answer:
How to make template entity object?
To make point_template work just need to add template object to map data, but i don’t know how to add this…