View Full Version : SDK problems


Lord Olleus
May 31, 2006, 06:12 AM
I am having a rather major problem editing the SDK.

I am trying to create a new mission called 'AirPower'. This causes the fighter to fly over to a particular square and engage with any enemy interceptor there. I have managed to do a lot of changes in the SDK (By copying and editing the AirBomb functions) and I can compile the SDK and launch the Game without any crashes. However, all of the icons and animations are completely screwed up.
I checked my error loggs and it said that I have an unidentifiable error in CvMainInterface.py line 1365, but I can't tell what it is.

EDIT:
Ok I fixed it, it was a problem with the enums being out of line. However, now the game CTD whenever a plane tries to do AIRPOWER (I have made it so that all units have the button (ATM). I really have no idea what is causing this. Any help is welcomed

http://www.civfanatics.net/uploads11/Air_and_Naval_Mod1.zip

Lord Olleus
May 31, 2006, 12:20 PM
I've managed to solve the crashing problem but, I now have another one. I can execute my mission normally, but I cant choose which tile I want the plane to go on. It just does 'Air Power' on the square its on, instead of going to another square like it would for bombing. I have absolutely no idea which file I should look at for this.

The Great Apple
May 31, 2006, 01:38 PM
Hmmm. Square selection. I wouldn't know how to go about it in the SDK - although there are a few python mods which I know do it.

Lord Olleus
May 31, 2006, 02:00 PM
The funny thing is that there must already be an SDK version of doing this as Mission_Airstrike and Mission_Airbomb need square selection.

Gerikes
May 31, 2006, 04:12 PM
The funny thing is that there must already be an SDK version of doing this as Mission_Airstrike and Mission_Airbomb need square selection.

I'm not sure on this, but I think you need to also add your "INTERFACEMODE_AIRPOWER" to the Civ4InterfaceModeInfos.xml. You can probably just copy the airbomb info.

Lord Olleus
May 31, 2006, 04:56 PM
Thank you sooooooooooooooooooooooooooooo much. This was driving me absolutely nuts. I spent so many hourse fine combing CvSelectionGroup.cpp trying to work out how to do this. I was just completely obliviate to the existance of that xml file. I didn't even know that there was an Interface file.

I know just have to get the function working properly, and I'll release this modcomp.

Thanks again, you have stopped me from becoming mad.

Lord Olleus
Jun 01, 2006, 03:37 AM
Just finished balancing the function and it works a treat! If someone wants to try it out, tell me and I'll upload it now, but otherwise I don't want to waste server space.

Now to the more serious buissness of editing the AI to use it. Anyone got any pointers on how to do this?

The Great Apple
Jun 01, 2006, 05:48 AM
First you'll need to find the bit where the AI decides on what air mission to do. You'll probably want to get something that judges how many aircraft are needed for defence (CvCity->getNumAirDefenders() or something similar), and then use any excess aircraft, or maybe a certain percentage of the defending aircraft which is either, dependant on how the war is going (very general... might be hard to do), or fixed, to conduct the mission.

Then you'll have to find a suitable target. Best ones would be near cities you have bombers and land troops in range of. There might already be some functoins in place which you may be able to use to help with this - I'm not sure.

You'll also have to fix the unit order in there somewhere so that the bombers don't do their bombing runs before the fighters have tried to clear the skies.... but the bombers need to do their bombing runs before the units move in.

Lord Olleus
Jun 01, 2006, 02:49 PM
Thanks everyone!

It seems that the AI uses it, but I'll have to wait 'till the testers have had a go.