deanej
Deity
How do I make the SDK recognize a new XML file? I want the game to use the file Civ4CloakingInfos for my Star Trek mod, but I can't find anything about how to add it to the SDK.
EDIT: I think I managed to get it right, but it won't compile. I don't understand what I'm doing wrong.
CvXMLLoadUtilitySet.cpp
CvGlobals.cpp
CvGlobals.h
What am I doing wrong? My form is identical to that which Firaxis used.
EDIT: I think I managed to get it right, but it won't compile. I don't understand what I'm doing wrong.
CvXMLLoadUtilitySet.cpp
Code:
LoadGlobalClassInfo(GC.getCloakingInfo(), "CIV4CloakingInfos", "Misc", "Civ4CloakingInfos/CloakingInfos/CloakInfo", false);
CvGlobals.cpp
Code:
int CvGlobals::getNumCloakInfos()
{
return (int)m_paCloakingInfo.size();
}
std::vector<CvCloakingInfo*>& CvGlobals::getCloakingInfo()
{
return m_paCloakingInfo;
}
CvCloakingInfo& CvGlobals::getCloakingInfo(CloakTypes eCloakNum)
{
FAssert(eCloakNum > -1);
FAssert(eCloakNum < GC.getNumCloakInfos());
return *(m_paCloakingInfo[eCloakNum]);
}
Code:
deleteInfoArray(m_paCloakingInfo);
CvGlobals.h
Code:
class CvCloakingInfo;
Code:
DllExport int getNumCloakInfos();
std::vector<CvCloakingInfo*>& getCloakingInfo();
DllExport CvCloakingInfo& getCloakingInfo(CloakTypes eCloakNum);
Code:
std::vector<CvCloakingInfo*> m_paCloakingInfo;
Spoiler :
Error:
1>------ Build started: Project: CvGameCoreDLL, Configuration: Release Win32 ------
1>Performing Makefile project actions
1>Microsoft (R) Program Maintenance Utility Version 8.00.50727.42
1>Copyright (C) Microsoft Corporation. All rights reserved.
1> "C:/Program Files/Microsoft Visual C++ Toolkit 2003/bin/cl.exe" /nologo /MD /Gd /G7 /GR /O2 /W3 /EHsc /DWIN32 /DNDEBUG /D_WINDOWS /D_USRDLL /DCVGAMECOREDLL_EXPORTS /DFINAL_RELEASE /IBoost-1.32.0/include /IPython24/include /I"C:/Program Files/Microsoft Visual C++ Toolkit 2003/include" /I"C:/Program Files/Microsoft Platform SDK/Include" /c CvArea.cpp /FoFinal_Release/CvArea.obj
1>CvArea.cpp
1>c:\Documents and Settings\Jon Deane.JON\My Documents\My Games\CvGameCoreDLL\CvGlobals.h(616) : error C2061: syntax error : identifier 'CloakTypes'
1>c:\Documents and Settings\Jon Deane.JON\My Documents\My Games\CvGameCoreDLL\CvGlobals.h(616) : error C2556: 'CvCloakingInfo &CvGlobals::getCloakingInfo(void)' : overloaded function differs only by return type from 'std::vector<_Ty> &CvGlobals::getCloakingInfo(void)'
1> with
1> [
1> _Ty=CvCloakingInfo *
1> ]
1> c:\Documents and Settings\Jon Deane.JON\My Documents\My Games\CvGameCoreDLL\CvGlobals.h(615) : see declaration of 'CvGlobals::getCloakingInfo'
1>c:\Documents and Settings\Jon Deane.JON\My Documents\My Games\CvGameCoreDLL\CvGlobals.h(616) : error C2371: 'CvGlobals::getCloakingInfo' : redefinition; different basic types
1> c:\Documents and Settings\Jon Deane.JON\My Documents\My Games\CvGameCoreDLL\CvGlobals.h(615) : see declaration of 'CvGlobals::getCloakingInfo'
1>NMAKE : fatal error U1077: '"C:/Program Files/Microsoft Visual C++ Toolkit 2003/bin/cl.exe"' : return code '0x2'
1>Stop.
1>Project : error PRJ0019: A tool returned an error code from "Performing Makefile project actions"
1>Build log was saved at "file://c:\Documents and Settings\Jon Deane.JON\My Documents\My Games\CvGameCoreDLL\Release\BuildLog.htm"
1>CvGameCoreDLL - 5 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
1>------ Build started: Project: CvGameCoreDLL, Configuration: Release Win32 ------
1>Performing Makefile project actions
1>Microsoft (R) Program Maintenance Utility Version 8.00.50727.42
1>Copyright (C) Microsoft Corporation. All rights reserved.
1> "C:/Program Files/Microsoft Visual C++ Toolkit 2003/bin/cl.exe" /nologo /MD /Gd /G7 /GR /O2 /W3 /EHsc /DWIN32 /DNDEBUG /D_WINDOWS /D_USRDLL /DCVGAMECOREDLL_EXPORTS /DFINAL_RELEASE /IBoost-1.32.0/include /IPython24/include /I"C:/Program Files/Microsoft Visual C++ Toolkit 2003/include" /I"C:/Program Files/Microsoft Platform SDK/Include" /c CvArea.cpp /FoFinal_Release/CvArea.obj
1>CvArea.cpp
1>c:\Documents and Settings\Jon Deane.JON\My Documents\My Games\CvGameCoreDLL\CvGlobals.h(616) : error C2061: syntax error : identifier 'CloakTypes'
1>c:\Documents and Settings\Jon Deane.JON\My Documents\My Games\CvGameCoreDLL\CvGlobals.h(616) : error C2556: 'CvCloakingInfo &CvGlobals::getCloakingInfo(void)' : overloaded function differs only by return type from 'std::vector<_Ty> &CvGlobals::getCloakingInfo(void)'
1> with
1> [
1> _Ty=CvCloakingInfo *
1> ]
1> c:\Documents and Settings\Jon Deane.JON\My Documents\My Games\CvGameCoreDLL\CvGlobals.h(615) : see declaration of 'CvGlobals::getCloakingInfo'
1>c:\Documents and Settings\Jon Deane.JON\My Documents\My Games\CvGameCoreDLL\CvGlobals.h(616) : error C2371: 'CvGlobals::getCloakingInfo' : redefinition; different basic types
1> c:\Documents and Settings\Jon Deane.JON\My Documents\My Games\CvGameCoreDLL\CvGlobals.h(615) : see declaration of 'CvGlobals::getCloakingInfo'
1>NMAKE : fatal error U1077: '"C:/Program Files/Microsoft Visual C++ Toolkit 2003/bin/cl.exe"' : return code '0x2'
1>Stop.
1>Project : error PRJ0019: A tool returned an error code from "Performing Makefile project actions"
1>Build log was saved at "file://c:\Documents and Settings\Jon Deane.JON\My Documents\My Games\CvGameCoreDLL\Release\BuildLog.htm"
1>CvGameCoreDLL - 5 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
What am I doing wrong? My form is identical to that which Firaxis used.