SDK Component Requests:

I know C++, but I have never done coding in the SDK. Where would I start if I wanted to try my own additions?

Know C++, but not SDK?

Wait a min. SDK is comprised of C++ code. To see Afforess' code changes, you need to download TortoiseSVN then put the SVN of AND in your computer. In there, you will find the folder "Sources" and that is the place where you can check out all these .cpp and .h files. They are all C++.

For beginners in C++, use Refar's instruction PDF in the Modiki to learn how to compile a dll. Use Xienwolf's Idiot's Guide to C++ for rudimentary coding for Civ4. More than that, practice, practice, and more practice. Practice will make a skill :D.
 
I know C++, but I have never done coding in the SDK. Where would I start if I wanted to try my own additions?

It depends on what you want to do, but I would start with download my source code from the SVN, and following the Modiki guides to get it to compile first. I use VS 2008, but any version *should* work.

After that, it's up to what you want to mod. The files are laid out in a sensible manner, one for units, one for cities, one for players, etc...
 
I will try some small but interesting ideas if I get a good amount of spare time. I probably can work on something big over summer break in June.
 
I have a question for afforess. I am trying to compile the DLL but it says I am missing "boost/python/list.hpp" in the Sources file, and it isn't there.
 
You need to copy the Boost and Python folders from your CvGameCore folder, which is in the BTS folder to your source code folder. ;)
 
You need to copy the Boost and Python folders from your CvGameCore folder, which is in the BTS folder to your source code folder. ;)
Thanks. I got it to compile, but I'm still having some problems ("Assert Failed"s all over the place). Trying to figure out what I am doing wrong now. One strange thing I noticed it that MY CvGameCoreDLL (that I compiled) is over twice as big as the real one.
 
Thanks. I got it to compile, but I'm still having some problems ("Assert Failed"s all over the place). Trying to figure out what I am doing wrong now. One strange thing I noticed it that MY CvGameCoreDLL (that I compiled) is over twice as big as the real one.

There are different versions of the CvGameCoreDLL. The Release versions are the ones I ship, and are usually small. The Debug one is about 2.5x larger, but include the symbols for debugging, and includes Asserts, which are scattered all over the SDK. Asserts popup when something the original programmer never expected to occur in the game occurs, telling the line number, and occasionally what is happening. I've tried to remove most of the harmless ones. Anyway, a release dll is more of what you are looking for anyway.
 
I keep having a certain error whenever I try to run AND with my DLL.

Code:
Assert Failed

File:  CvGlobals.cpp
Line:  4174
Expression:  strcmp(szType, "NONE")==0 || strcmp(szType, "")==0
Message:  info type BUILDING_WORLDSFAIR not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml

I also had a similar one that was looking for an aboriginal civilization, or something like that, but it is still the same error. I keep getting this world fair one more often though. I looked through the XML file, and there is nothing about the Worlds Fair in the espionage file.

I don't NEED help, because I think I could figure this out with some time, but if you know what I am doing wrong without having to go through any trouble, I could use it.
 
Not really an error, you can ignore it. GetInfoTypeForString returns asserts when a building is not found, but they are harmless 99% of the time.
 
Anyways im not to sure where to put this, i found this thread for requests on what to include, and im nto to sure wether you do have it in your mod or not, but here goes. Can you include this in your next update it basicc changes to python and some are for SDK,. If you have it already on a new dawn let me know. Sorry for troubling:) The Links to the components are there aswell:)

Religion Decay:
This mod's main purpose is providing the chance of religions being removed from cities.
Based on config.ini options and other criteria, each city has a chance each turn to experience
a Turmoil Event, specificly a Religious Turmoil Event. You are able to set the min number of
turns between Turmoil Events, the min number of religions required in the city, the percent
chance of the even happening, and several others.

If all the factors are met then Religious Turmoil strikes your city and a
religion may be removed. As is now Religious Turmoil has no effect other then removing a
religion, but in future versions I am planning to incorporate other negative factors.
LINK

OPTIONAL CONTROLLING CITY LIMIT FOR CIVS
This mod allows you to limit the maxium number of Cities each Civilization can have in each Era of the game. A new tag has been added to the CivilizationInfo xml file that allows you to set each Civilization's iCityCountLimit for each Era. It is also possible to set iCityCountLimit to -1 to remove the limit on Cities in that Era.
Will be good if you want to imitate real world civilizations or countries for example the Vatican City, or Monaco. Or Singapore. If you can limit the amount of cities they can build. It will be a good feature. I would do this myself but unfortunately i dont know where to edit it in the EventsManager.py as theres no eventsmanager on RoM Phyton files. If you can help me in where i can slot the code in. Then no problem:D
LINK

Limiting Number of Units per Tile
This mod allows you to set a default amount of Space that a Tile has.
Bonuses, Features, Improvements, Routes, Terrain, City Buildings, City Culture Levels, City Population, and Cities themselves can be
configured to modify the default Tile Space with new tags in their Info.xml files.
Units ave a default Size set in the UnitClassInfo.xml.
A Unit's default Size can be modified by a tag in the UnitInfo.xml.
In the UnitInfos you can also set Units to ignore the Tile Space Rules or just
the Tile Space Limit.
This can be used to simulate a civ5 atmosphere. And may force the player to rethink strategy of how many units he can make aswell as can eliminate ctd's from stack of dooms. Obviously though if you can make it optional. It would be great. And i think this combined with the citylimit can greatly increase speed of the game.
LINK

Fort Zone of Control and Fort increasing cultural borders
This would be a good feature to have im not to sure wether you do have it. But it can help better instead of having cities you can instead create a fort especially for creating improvements in far of regions for e.g resources that your region dont have. Great feature. aswell as other neat stuf it got.
Link
Link

Anyway that is it. if you cant include in your next iteration please can do me a favour and slot it into the current sdk files of a new dawn aswell as the python files as i just cant seem to get around into making it possible (inexperience in python) and can you either upload it for me or send them to me . sorry for trouble:)
 
Limiting Number of Units per Tile

Spoiler :
This mod allows you to set a default amount of Space that a Tile has.
Bonuses, Features, Improvements, Routes, Terrain, City Buildings, City Culture Levels, City Population, and Cities themselves can be
configured to modify the default Tile Space with new tags in their Info.xml files.
Units ave a default Size set in the UnitClassInfo.xml.
A Unit's default Size can be modified by a tag in the UnitInfo.xml.
In the UnitInfos you can also set Units to ignore the Tile Space Rules or just
the Tile Space Limit.

This can be used to simulate a civ5 atmosphere. And may force the player to rethink strategy of how many units he can make aswell as can eliminate ctd's from stack of dooms. Obviously though if you can make it optional. It would be great. And i think this combined with the citylimit can greatly increase speed of the game.
LINK

this one sounds very interesting basically because it changes lot of military tactics especially on giant maps at slowest speed where large stacks of units are quite common. however i really wonder how the AI deals with it as it seems this would force it to split up forces and limit the garrison in cities. but something tells me that the AI wasn't much considered here.

if anyone has the time to test AI with this mod please tell us of your results.
 
I already have a way to limit units. Check the A_New_Dawn Global Defines. One of the values can be set to limit the number of units on a tile.
 
alright, and the city limiting thing? is it in a new dawn already? or is there a way to limit it:? and the other stuf to like religion decay(not important though) aswell as the forts feature.
 
Religion Decay:

LINK

I've had a quick look at this. There is a lot of code and it will need to be ported to BUG, time consuming but should not be too difficult unless i missed something. However it would need to be converted (have new code) to reflect RoM's religious civics. Religious decay for non-state religion should be faster for intolerant than for secular, and that faster than for free religion. I could give it a go if no one else wants to do it. I have to finish the subdue animals mod first (just needs a few messages added and the hunting lodge experiments concluded). I also need to do some tidy up on AAranda's religions, but that is mostly just adding one tag to some files.

I could at least start a new thread. Yes I know that there has been a discussion on this on the RoM thread but it did not reach any conclusions.
 
great:D will be interesting to see the done work, by the way whats the best tool to use for python ? well to edit it. and for the fort mod do i also have to port that into bug
 
The fort mod is unnecessary. If you use Fixed Borders, forts already can give culture and can be used to claim faraway tiles. ;)
 
Back
Top Bottom