Adding 3rd Road Graphic

ripple01

Emperor
Joined
Mar 7, 2006
Messages
1,254
Location
New York City
In the Civ4RouteModelInfos file, there is a ModelFile tag and a LateModelFile tag that defines the regular roads and modern roads respectively. I am looking to add a third (MiddleModelFile) tag that will add a 3rd type of graphic in the medieval and renaissance eras. I can do the SDK changes to add a new XML tag, but could some one point me to the code where I could find the code that defines the ModelFile and LateModelFile tags respectively?

Thanks,
ripple01
 
I don't know for sure, but if you can't find a file with a name that corisponds to what you are looking for, then I would recomend looking in the CvInfo.cpp. Lots off different stuff is in there and I think all the loading of objects from xml is done in that file.
 
In most info files, it is stated which schema it follows... in the case of CIV4RouteModelInfos it is CIV4ArtDefinesSchema.xml. In that file, look for:

Code:
<ElementType name="RouteModelInfo" content="eltOnly">
		<element type="ModelFile"/>
		<element type="LateModelFile"/>
 
In most info files, it is stated which schema it follows... in the case of CIV4RouteModelInfos it is CIV4ArtDefinesSchema.xml. In that file, look for:

Code:
<ElementType name="RouteModelInfo" content="eltOnly">
		<element type="ModelFile"/>
		<element type="LateModelFile"/>

I beleive the question is where in the SDK can you put code to use a new RouteModel tag, not where are the tags defined in xml.
 
Oh... then it's CvInfos.cpp:

Code:
//------------------------------------------------------------------------------------------------------
//
//  FUNCTION:   ~CvRouteModelInfo()
//
//  PURPOSE :   Default destructor
//
//------------------------------------------------------------------------------------------------------
CvRouteModelInfo::~CvRouteModelInfo()
{
}

RouteTypes CvRouteModelInfo::getRouteType() const		// The route type
{
	return m_eRouteType;
}

const TCHAR* CvRouteModelInfo::getModelFile() const	
{
	return m_szModelFile;
}

void CvRouteModelInfo::setModelFile(const TCHAR* szVal)				// The model filename
{
	m_szModelFile=szVal;
}

const TCHAR* CvRouteModelInfo::getLateModelFile() const	
{
	return m_szLateModelFile;
}

void CvRouteModelInfo::setLateModelFile(const TCHAR* szVal)				// The model filename
{
	m_szLateModelFile=szVal;
}

const TCHAR* CvRouteModelInfo::getModelFileKey() const	
{
	return m_szModelFileKey;
}

void CvRouteModelInfo::setModelFileKey(const TCHAR* szVal)				// The model filename Key
{
	m_szModelFileKey=szVal;
}

bool CvRouteModelInfo::isAnimated() const
{
	return m_bAnimated;
}

const TCHAR* CvRouteModelInfo::getConnectString() const
{
	return m_szConnectString;
}

const TCHAR* CvRouteModelInfo::getModelConnectString() const
{
	return m_szModelConnectString;
}

const TCHAR* CvRouteModelInfo::getRotateString() const
{
	return m_szRotateString;
}

bool CvRouteModelInfo::read(CvXMLLoadUtility* pXML)
{
	CvString szTextVal;
	if (!CvInfoBase::read(pXML))
	{
		return false;
	}

	pXML->GetChildXmlValByName(szTextVal, "ModelFile");
	setModelFile(szTextVal);
	pXML->GetChildXmlValByName(szTextVal, "LateModelFile");
	setLateModelFile(szTextVal);
	pXML->GetChildXmlValByName(szTextVal, "ModelFileKey");
	setModelFileKey(szTextVal);

	pXML->GetChildXmlValByName(&m_bAnimated, "Animated");

	pXML->GetChildXmlValByName(szTextVal, "RouteType");
	m_eRouteType = (RouteTypes)(pXML->FindInInfoClass(szTextVal));
	pXML->GetChildXmlValByName(m_szConnectString, "Connections");
	pXML->GetChildXmlValByName(m_szModelConnectString, "ModelConnections");
	pXML->GetChildXmlValByName(m_szRotateString, "Rotations");

	return true;
}
 
I beleive the question is where in the SDK can you put code to use a new RouteModel tag, not where are the tags defined in xml.

Yes, this is correct. I would even settle if someone would tell me where the current ones are defined. I've searched (admittedly, not super in depth) but have not had any luck.

Cheers,
ripple01
 
Back
Top Bottom