to Final_Release_GLOBAL_LDFLAGS=$(GLOBAL_LDFLAGS)?
Because, currently, both those lines in my Makefile end at the ")"...
Unrelated:
It had occurred to me earlier today that maybe having CvCity::setHasReligion call updateGlobalReligionYield() was causing a loop, so I commented out the whole bit. Unsurprisingly, that didn't work...
Oh, and what's the difference between "YieldTypes eYield", and "YieldTypes eIndex"? Does the first call the individual F/P/C and the latter the array?
Ah, I see I got the name of the library wrong. I have no idea what the library is, but I don't exclude it in my debug build and it works, so I recommend removing it and testing.
The only difference is the name of the parameter (variable). Variable names have no syntactic meaning in C++ (nor most languages). You could use "YieldTypes fred" if you wanted so long as you used "fred" throughout.
The SDK uses eIndex as a general variable name indicating a value that indexes in some array, such as building, unit, yield type. These values go from 0..N-1 where N is the total number of that type of object. Some places specifically name the type of thing it is such as eYield or eCommerce or ePlayer, usually where it has two such variables like (CommerceTypes eIndex, BuildingTypes eBuilding). The only difference is in readability.
Not Fall from Heaven, just a mod based on it (Fall Further).
If you used MY makefile, you should have a problem with the fact we split one of the python files into 2 parts (I think it was CyMapInterface.cpp, split into CyMapInterface1.cpp and CyMapInterface2.cpp) so that we could successfully compile a debug DLL. If you haven't split that same file, then it shouldn't compile for you at all.
Hi. I've decided to take another crack at this. Oddly though, although I haven't touched the project, or even Civ IV, since March when I was last working on it, I now can't start the game with my mod. Trying to start Civ IV now results in an immediate CTD...
Even weirder, I can't compile a new DLL. When I try, VS2008 just says:
"========== Build: 0 succeeded, 0 failed, 1 skipped =========="
Confusion reigns supreme...
EF, would you have the opportunity to double-check the makefile I had uploaded in post #274? I checked to make sure I had included your changes listed in post #278, and I have, but I can think of no other reason why VS 2008 will not compile.
Thank-you... Hopefully I can get all the through to the end this time...
Sorry EF, what command line? I just use Build -> Build Solution, or hit [F7] (which is the same thing). Doing either of those results in the same. Effectively, no response from VS 2008.
I found a different Makefile tho: View attachment BTS319Makefile.zip. Supposedly designed for BtS 3.19. But building a solution with it instead results in errors being thrown for line 14714 of CvGameTextMgr.cpp, where it doesn't recognize the variable "i". Which deosn't make sense for two reasons:
I've never been anywhere near that part of CGTM
and, "i" IS declared in that function...
And then it throws a bunch more errors, all about undeclared variables that are declared, and in parts of files I never touched...
So, that Makefile doesn't work either. OR, I shouldn't have tried to merge my mod with 3.19...
It sounds a lot like VS is doing the compiling itself using its own internal compiler. This will never work for producing a DLL that works with BTS. You must install VC++ Toolkit 2003.
By using the command line, I mean using Start : Run... in Windows and typing "cmd.exe". See this post for the rest of the details.
That's weird... I distinctly remember following the install procedure that included the VC++ Toolkit 2003... That's so weird... Is it possible one of the Windows XP updates that got installed screwed up whatever ties VS 2008 to the Toolkit? Could I reset it somehow?
...
Yes, of course I could. By re-installing it. Duh.
Ok, I'll try the command line this weekend. Thanks EF.
I don't really think and XP update would have done that. In your VS 2008 project you specify that you want it to use nmake to do the build. From here, it should use your system path to find nmake, I think.
Under Tools : Options... : Project and Solutions : VC++ Directories there is a list of folders to search for tools such as nmake. The odd thing for me is that it references variables that I cannot find a definition for: VCInstallDir, WindowsSdkDir, etc. The last one is $(PATH) which pulls from your System path, but I don't have VC++ or the PSDK (which contains nmake) on it.
You can check your system path by going to Control Panel : System : Advanced tab. Click Environment Variables and look for Path in the System list (bottom one). Make sure VS 2008 isn't on the path.
You might want to try recreating the VS project if none of this stuff helps.
So, on the upside, I got VS compiling again. Recreating the VS Project finally did the trick.
Now, however, I'm getting an error I'd never had before. And it doesn't make sense to me, cause I haven't changed any of the referenced code. What I have done, is to integrate my mod into 3.19. I figure that's what messed things up. So, does the following error mean anything to you?
CvPlayer.cpp(9402) : error C2039: 'isBarbarianGreatGenerals' : is not a member of 'CvGameAI'
c:\Documents and Settings\Richard Langlois\Desktop\Civ IV Mods\CvGameCoreDLL\CvGameAI.h(10) : see declaration of 'CvGameAI'
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual C++ Toolkit 2003/bin/cl.exe"' : return code '0x2'
EF, can you help me go back to basics here? I'm suspicious that my Makefile isn't any good. So, I wanted to ask:
1. What exactly is a Makefile?
2. How does it work?
3. How do I write one? Or rather, how do I make sure that the one I have is built correctly?
I've kinda been treating the whole compiling process like magic; just leave it alone and everything will just work on its own, without any understanding of how it works. I've decided I really need that if I'm going to make any progress.
I would start with Wikipedia's Makefile entry. It starts with a little history and background, so feel free to skip down to the Makefile Structure section, but it's pretty short. After you've read that, post again with any questions you have. Makefiles can get very complicated with their rules as the number of files increases, but the ultimate structure is pretty simple: a series of build rules that tell nmake what to do when file dates differ:
Each output can be an actual file or a name that can be passed on the command line such as Final_Release. In this case it's referred to as a target, and you can use targets as inputs to other rules.
One thing not mentioned is the use of macro definitions which are at the top of Refar's makefile. These are just like #defines in C++ or variables in Python.
Thanks EF. So, reading that, I can now safely say that if that Makefile I have compiles the plain v3.19 SDK properly, then it should also work just fine for my mod. And that this would remain true so long as I wasn't adding entirely new files. Correct?
Also, how would you go about trouble-shooting a mod that causes an immediate CTD? And by immediate, I mean even before the little loading pop-up that shows it pre-loading all the XML and Python etc.
Yes, if you haven't added any new files, then the base BtS makefile works for your DLL.
To troubleshoot something that early, you need to either launch a debug DLL with instant attachment in Visual Studio, or use some text output to a file at points of the DLL which you know to come that early and try to narrow down where/when it happens.
Have I mentioned that I'm an idiot? I just want to make perfectly clear here, that I am a stone-cold, wool-headed, brain-dead MORON.
Oh, and Xienwolf? Thank-you for writing the second-to-last paragraph in post #15 of your An Idiots Guide to Editing the DLL. It turns out, that the most likely culprit of all my problems is that I was assuming that Visual Studios was doing everything right, and I didn't have to question it in any way. I don't think I ever did a clean build of my DLL once I started using it, which is about the same time I started trying to get the Shrine Yields added in. So, none of the header files got compiled properly. Which would explain my repeated CTD's...
OK, so, it appears that, as written, the game loads. I can build cities, I can even build things in cities. I can even found religions and build shrines! And, the 'Pedia does show the planned changes commerce: granted instead of ). But, at the moment, the although everything (including the floating tags above a built shrine inside the cityview) shows that I should be gaining from Shrines, I am not. Only . For now.
I suspect I need to re-think how I have things written in CvCity.cpp. That seems most likely to me, and so I 'll look through that first. But, in case I'm way off, here's my UTD code just in case.
yeesh....
Below are all my changes. Changes are in bold, ~ ~ ~ to seperate different sections in the same file, before and after lines included of course. I've also attached the whole thing in a RAR. For the RAR, find my inserts by searching "RichMod Shrine Yields Start". View attachment Shrine Bonus.rar
Now that you've got a working DLL it's time to learn how to use VS to debug your code. Can you build a Debug DLL? Can you attach to the running game from VS? Can you set breakpoints in the key places in your additions, for example when you build the shrine and when your religion spreads?
How would you go about determining where the game has originally got those events written though? I'm sure that you can just read the code and see "Ah, this goes here, and that goes there, so this must be that!" but I'm not that skilled. Do you think it's worth the effort to just attack breakpoints where I think the game is doing those things and just keep trying? (btw, not being sarcastic)
When you add/remove a building, it goes through CvCity:rocessBuilding(). In there you should have a call that you added to check for the religious yield. There should be a similar function that adds/removes a religion from a city. Look for a CvCity function that takes a ReligionTypes and a boolean. This should also have a call that adjusts the religious yields.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.