Super Forts

Anyone out there know of a mod the improves the AI's placement of forts? I just asked in the Kmod thread, but thought I would ask here too.

I am working on improving the AI of Super Forts some more. I have also been working with Tholal to integrate Super Forts into his mod for FFH2 as part of his Advanced Tactics option.
 
Spoiler :
1>CvDLLWidgetData.cpp
1>CvDLLWidgetData.cpp(2869) : error C2039: 'getDefenseDamage' : is not a member of 'CvPlot'
1> c:\Games\CivIV\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\K-Fallout\Assets\CvGameCoreDLL\CvPlot.h(30) : see declaration of 'CvPlot'
1>NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\cl.exe"' : return code '0x2'


hi ya I get this error when compiling the SDK, I think I see the problem, I just do not know what code to actually put at the start CvPlot.h line 30... needs something like an int or a void I think...

help! :D
 
Hi Lib - did you recompile everything? I forget what the Visual Studio calls it exactly and I can't check right now, but there are different compile options. If you don't recompile everything then changes to .h files don't get compiled. Thus, the compiler would not see that getDefenseDamage has been added to CvPlot.h. You do have getDefenseDamage() in CvPlot.h right?

It has been a while since I released an update for Super Forts, but I am planning on releasing one soon :)rolleyes: within a few weeks?). Super Forts has been merged into More Naval AI for FFH2, and along the way Tholal and I have improved it. One major change is that I have written code to detect and calculate the value of choke points and canal points, and made so the AI will build forts at those points. There are numerous small AI improvements too.
 
At line 29 it says it cannot find it, and when I looked it was not there in your file?
Spoiler :

class CvPlot
{

public:
CvPlot();
virtual ~CvPlot();


getdefensedamage is in at line 579 (my version not your)
// Super Forts begin *bombard*
int m_iDefenseDamage;
bool m_bBombarded;
// Super Forts end

like that, but the compiler says it is missing at line 30

ARGH I hate merging AI parts :D I am using kmod as a base, so AI stuff is so hard to line up and merge right :D

EDIT:
Something is not right... I just did a remerge, and I get 100 'local function definitions are illegal' errors in the CvPlot.cpp file...
 
Lib.Spi't, hi,

i once did a merge of this mod with kmods,

but i had to remove fort bombardment in order to get the mod to work.
kmod uses a different code for parts of bombarments.

thought if u do succeed. i would be realy happy if u can share ur merge.

thanks and good luck.
 
:dunno: Sorry but you just must be missing something. In some cases it might be easier to just search for the "Super Forts" comments and copy and paste rather than using a merging tool. You are using "Rebuild" to compile it as I mentioned earlier right? That is what I meant earlier because the normal "Build" doesn't seem to check for changes in .h files. At least that is what happens for me in VS2010.

Merging it with More Naval AI took some effort but was successful even with parts of BBAI and Kmod in it. I rewrote some of the bombard code to make it easier to merge in v1.11. I think that was after Keldath tried merging. I could merge it with Kmod sometime but there are lots of other things higher on my priority list right now.
 
yeah I do both, I start with a merger, and then I do a visual compare of the files if it doesn't work.. I have checked your plot.h file and I have merged everything that is in it.

'local function definitions are illegal' do you know what this means? I get confused by the different error messages, if I could know what the problem is I could look for what I have done wrong...

does it mean that it needs a reference in the .h file or is it code 'grammar and language' that is not right in the .cpp file? or does it need extra references in the .cpp file...
 
hey I have attached the cvplot files from your version, would you just be able to check that it has everything it is supposed to, particularly the header file.... I have just checked and rechecked, and I can't find anything that I have missed, so unless I need to look in one of the other files, I don't know what is going wrong....
 

Attachments

  • CvPlot.rar
    39.6 KB · Views: 135
'local function definitions are illegal' do you know what this means? I get confused by the different error messages, if I could know what the problem is I could look for what I have done wrong...

does it mean that it needs a reference in the .h file or is it code 'grammar and language' that is not right in the .cpp file? or does it need extra references in the .cpp file...

Here is what a google search turned up: http://msdn.microsoft.com/en-us/library/sba3hty9(v=vs.90).aspx - There is probably a missing brace or extra brace somewhere.

hey I have attached the cvplot files from your version, would you just be able to check that it has everything it is supposed to, particularly the header file.... I have just checked and rechecked, and I can't find anything that I have missed, so unless I need to look in one of the other files, I don't know what is going wrong....

I checked the files you attached and compared them against mine which have no trouble compiling. I didn't notice anything missing. I think it must be a missing or extra brace if the error is still "local function definitions are illegal".
 
If you still can't get it I would be willing to merge one or two files for you. Just attach both the Kmod and Super Forts version of the files you want merged.
 
Ok cool, I will hunt for a missing brace, and if I don't succed I will take you up on that offer, but now that I know I need to look for a bracket I can look closely at that, I probably cut one off the start of the list. I think a file that I might need help with is the so one, cause the ai files are where most of kmod change is.

To the bracket hunt!
 
ok I will take you up on your offer, I am going to keep trying to merge the plot files, but I think it is going to get too complicated for my brain, as I think something important may have been changed by kmod.. and I am not good enough to track the changes and make the right modification...

I will keep trying, but you may look at it and go 'oh it's that bit'

cvplot1 is my version and cvplot is your versionthere are some bits that are commented out by kmod, and i think some function may have been changed...

Thanks for the help, I really want this to be a part of the mod, as I have a lot of plans for it :D
 

Attachments

  • CvPlot.rar
    72.8 KB · Views: 147
I won't be able to do it this weekend because I am going to a hackathon to learn about making apps, but will do the merge in a few days if you haven't already completed it before then.
 
cvplot1 is my version and cvplot is your versionthere are some bits that are commented out by kmod, and i think some function may have been changed...

Thanks for the help, I really want this to be a part of the mod, as I have a lot of plans for it :D

I had a look at it and there is indeed a problem with a bracket in the function: void CvPlot::doImprovementUpgrade()

If you use Notepad++, you know that clicking next to a bracket makes a red line appear joining the corresponding brackets (opening and closing). If the line seems unfinished, you have a problem...

But here it seems that K-Mod has nothing to do with it and that Super Forts has re-written a bit the code and in your file, the lines from 564 to 573 included are redundant and should be deleted (or commented out). Look for example the part of code setImprovementType(eImprovementUpdrade); which is repeated in Red Key's code below.

Sorry, but I didn't bother looking further...
 
Thanks Isenchine, I made the change you suggested, and I now get these errors, further along which is a good start :D

Spoiler :

1>CvPlot.cpp(941) : error C2065: 'bErased' : undeclared identifier
1>CvPlot.cpp(951) : error C2059: syntax error : 'if'
1>CvPlot.cpp(952) : error C2143: syntax error : missing ';' before '{'
1>CvPlot.cpp(952) : error C2447: '{' : missing function header (old-style formal list?)
1>CvPlot.cpp(996) : error C2059: syntax error : '}'
1>CvPlot.cpp(996) : error C2143: syntax error : missing ';' before '}'
1>CvPlot.cpp(996) : error C2059: syntax error : '}'
1>CvPlot.cpp(1001) : error C2143: syntax error : missing ';' before '.'
1>CvPlot.cpp(1001) : error C2501: 'bumped_groups' : missing storage-class or type specifiers
1>CvPlot.cpp(1003) : error C2059: syntax error : 'for'
1>CvPlot.cpp(1003) : error C2143: syntax error : missing ')' before ';'
1>CvPlot.cpp(1003) : error C2143: syntax error : missing ';' before '<'
1>CvPlot.cpp(1003) : error C2501: 'i' : missing storage-class or type specifiers
1>CvPlot.cpp(1003) : error C2143: syntax error : missing ';' before '++'
1>CvPlot.cpp(1003) : error C2501: 'i' : missing storage-class or type specifiers
1>CvPlot.cpp(1003) : error C2086: 'int i' : redefinition
1> CvPlot.cpp(1003) : see declaration of 'i'
1>CvPlot.cpp(1003) : error C2059: syntax error : ')'
1>CvPlot.cpp(1004) : error C2143: syntax error : missing ';' before '{'
1>CvPlot.cpp(1004) : error C2447: '{' : missing function header (old-style formal list?)
1>CvPlot.cpp(1012) : error C2059: syntax error : '}'
1>CvPlot.cpp(1012) : error C2143: syntax error : missing ';' before '}'
1>CvPlot.cpp(1012) : error C2059: syntax error : '}'
1>CvPlot.cpp(1019) : error C2143: syntax error : missing ';' before '{'
1>CvPlot.cpp(1019) : error C2447: '{' : missing function header (old-style formal list?)


sorry for being such a pain guys! I can track these kinds of issues so far and then my brain just melts!
 
This has nothing to do with Super Forts anymore so you might want to start a thread of your own in the SDK/Python section or continue an existing one.

I don't understand the first error on line 941 as it looks correct to me (I've also merged K-Mod) but I've noticed a bracket to be deleted on line 978, just after one of the //K-Mod end.

Also, but I have no idea if it matters, on line 878, in a section commented out by Karadoc, there is a "/" at the beginning that I don't have - delete it.

Hope it helps.
 
ok moving to here

isen, if you have successfully merged kmod and super forts, would you be willing to give me your cvplot file so I could take a look and compare it, see if i can locate what I messed up?

Isen managed to fix that file for me, I am stuck on unitai now, but I was fairly sure I messed that one up :D
 
One thing I wish would be added, is the defense % be displayed on the map tile. (similar to city defenses).

I looked at how cities display it and I don't think it is possible for improvements if I understand correctly. Cities do it in CvGameTextMgr::buildCityBillboardIconString() but this function is not used anywhere in the DLL provided to modders. I think that means a part of the game engine that was not released for modding must handle it.
 
Top Bottom