How to compile the DLL

You're missing Service Pack 1, probably because you didn't use the download link in the first post.
I only have 2008 and 2010 express editions and both failed. I'll try reinstalling 2008 using the link. Edit: It worked
 
I only have 2008 and 2010 express editions and both failed. I'll try reinstalling 2008 using the link. Edit: It worked

Open the IDE first, then load the project.

Didn't read, dammit.
 
Urm do you "have" to have 2008 version installed for this or can it be done okay in 2012 version? I seem to be able to open the 2008 solution okay(load up both dll's) but the 2010 just throw an error at me.
 
AFAIK 2008 version must be installed.
 
I'm using VS 2010, but it refused to compile/link/build unless VS 2008 was also installed
 
SO basicly need 2008 to compile the dll?

Also cant find this in any of the 2 vcxproj files:

<DelayLoadDLLs>%(DelayLoadDLLs)</DelayLoadDLLs>

<ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<LargeAddressAware>true</LargeAddressAware>

Are lines 67, 68, 69

EDIT:

DelayLoadDLLs Cant find that refrence in ANY of the sourcecode provided. Stumped.
 
Got it to build. So all I need to do is grab the .dll that I need, put it in the root of my mod, add the file to the mod, load into VFS, and we're good to go?

Do I need both .dll files (CvGameCoreDLLFinal Release.dll, CvGameCore_Expansion1.dll) or just one?

This thread was amazingly helpful, btw, thank you to all involved.
 
I may be wrong, but the first one is used in vanilla and the second for G&K. So depending on the source files you change it will update one or the other or both. For example I only changed cpp files in the Expansion project section so only the Expansion DLL get generated.
 
and only the expansion DLL can be used from a mod.

the vanilla DLL need to replace the game core file to be loaded.
 
Do you know how to write messages to LUA tuner or other method from the cpp code?

I am going to try this afterwards, will let you know how it goes...

CvString szError;
szError.Format("Error1");
GC.LogMessage(szError.GetCString());
CvAssertMsg(false, szError);
 
You can write to your own log file under the logs sub-directory with code similiar to ...

place this in a .h file

Code:
// Comment this line out to switch off all custom mod logging
#define CUSTOMLOGDEBUG "CustomMods.log"

// Custom mod logger
#ifdef CUSTOMLOGDEBUG
#define CUSTOMLOG(sFmt, ...) {  \
  CvString sMsg;  \
  CvString::format(sMsg, sFmt, __VA_ARGS__);  \
  LOGFILEMGR.GetLog(CUSTOMLOGDEBUG, FILogFile::kDontTimeStamp)->Msg(sMsg.c_str());  \
}
#else
#define	CUSTOMLOG(sFmt, ...) ((void)0)
#endif

and then in your cpp code, call it like

Code:
CUSTOMLOG("Load: %s = %d", szName, iValue);
 
I successfully compiled my dll; however it generated thirty or so warnings. I prepared my mod in modbuddy. Added the dll, my xml file, and set "Import into VFS" property to true. When I loaded up my mod the changes were not implemented. The game did run normally.

Quick question:
Does a faulty dll cause the game to crash and burn? Or does the faulty dll get scrapped and the original reload?
 
I successfully compiled my dll; however it generated thirty or so warnings. I prepared my mod in modbuddy. Added the dll, my xml file, and set "Import into VFS" property to true. When I loaded up my mod the changes were not implemented. The game did run normally.

Quick question:
Does a faulty dll cause the game to crash and burn? Or does the faulty dll get scrapped and the original reload?

Don't worry about the warnings. I asked this question before and it turns out it's nothing.

I'm pretty sure that VFS = true a bad .dll results in game failure. You should doublecheck and make sure that the .dll file is named properly, because if it is not then you loaded a .dll into the VFS that the game engine will ignore.
 
doublecheck and make sure that the .dll file is named properly, because if it is not then you loaded a .dll into the VFS that the game engine will ignore.

Note that the default name for the dlls as generate by the build file are NOT the ones the game expects
 
When I get home I will double check. My mod, Adding +% YieldRateModifiers to Specialists, largely copied from the buildings implementation, failed to effect my change. I will have to reread through all of my code. Thanks whoward69 and trystero49.
 
I followed the guide on the first post, step by step but I am unsure if have have done it correctly. I have attached a picture of my mod buddy screen for review. The DLL files open up to something that does not look like C++ at all. In fact they are just sporadic numbers and letters. Is this correct? Am I meant to edit the dll files or open new files like with xml?

Also where can I find examples dll files so I can can model existing code. I wish to change the zone of control for navel units does any one have any idea where I can find this code?
 

Attachments

  • dll.jpg
    dll.jpg
    278.9 KB · Views: 170
You can't modifiy the DLL with modbuddy, you have to do the modifications before the compilation in visual studio.
 
I followed the guide on the first post, step by step but I am unsure if have have done it correctly. I have attached a picture of my mod buddy screen for review.

Step 8 - "Start Visual C++ 2008 Express Edition" - you shouldn't be anywhere near ModBuddy!
 
Back
Top Bottom