DLL - Various Mod Components

whoward. I just looked at my CvGameCoreSource folder. While most files were last modified 2012/11/1, some were modified 2012/12/19.
As i don't modify them myself, it should mean i got an sdk update that downloaded new versions.
I can't really hope it's the long awaited update for the hot patch source, but maybe you might want to check
maybe
maybe
maybe
maybe
 
whoward. I just looked at my CvGameCoreSource folder. While most files were last modified 2012/11/1, some were modified 2012/12/19.
As i don't modify them myself, it should mean i got an sdk update that downloaded new versions.
I can't really hope it's the long awaited update for the hot patch source, but maybe you might want to check
maybe
maybe
maybe
maybe

Yep, it appears to be the long awaited update :D - there were rumours of it on the 2K forums last night but every time I validated the SDK files nothing arrived - Steam reported 100% up-to-date! Saw this post, and manually checked and yes some files have been updated - very weird - almost as if the source files are "outside" of the system.

Right, off to see what has actually changed.
 
Right, off to see what has actually changed.

Quite a lot, but none of it where I've made changes :lol:

The mods are ported into the .21 code base ... and the DLL builds (which is a minor miracle - see other thread in the SDK/LUA sub-forum!)

Just need to test it, but as it's gone midnight (and as even code-trolls need to sleep sometime) that'll have to wait until the weekend.

Or I may just post it and let you lot try it out :mischief:
 
and as even code-trolls need to sleep sometime
Really, i thought you would just plug your toes into the USB port and recharge your batteries :borg:

Don't worry, we waited long enough for firaxis to update their sources, we can wait a couple more days :goodjob:

EDIT : nice work on the website
 
V8 for 1.0.2.21 attached

I'm still in the process of testing it, but there don't seem to be any issues, but I shall let it escape into the wild here first :)

EDIT: V9 attached further down the thread
 
Pretty much what was in V7, but based on the 1.0.2.21 code base (ie the stuff that came out on the 19th) and not the original 1.0.2.11 (or whatever it was) code
 
Downloaded.
I opened CustomModOptions.xml and found an entry for which i didn't found a description in this thread : EVENTS_CAN_MOVE_INTO
Is it an API for determining through Lua if a unit can enter a tile? Like we create a function and return true if we want the unit to be able to move, and false if we want to block it?
If so, it's really great : it would allow custom stacking from Lua, Social Policies to block foreign missionaries/great prophets on your borders, workers to move under city-states troops to complete roads ... :drool:
 
Downloaded.
I opened CustomModOptions.xml and found an entry for which i didn't found a description in this thread : EVENTS_CAN_MOVE_INTO
Is it an API for determining through Lua if a unit can enter a tile? Like we create a function and return true if we want the unit to be able to move, and false if we want to block it?
If so, it's really great : it would allow custom stacking from Lua, Social Policies to block foreign missionaries/great prophets on your borders, workers to move under city-states troops to complete roads ... :drool:

In theory - but it is called THOUSANDS of times in the first few turns for an 8 player game (I kid you not) and has a huge impact on performance.
 
Ah well, of course it's probably called by the pathfinder numerous times for every unit :rolleyes:
Better not overuse it then, but it's a very nice added feature, thanks.

An idea if you want to keep working on it and avoid too much of an impact. Maybe it would be possible to link it to an added database column for the Units or UnitClasses tables. Something like UseCanMoveEvent (boolean) could be added easily with SQLite, and if you can refer to this entry in the C++ code before fireing the event, it might be possible to check only for a couple units, and not all.
EDIT : not sure it's possible as this column wouldn't exist in a non-modded database. I have no clue whether or not the code can handle "might be" columns
Obviously this check can be made in Lua but i suppose even keeping a local table of unit IDs that needs checking and using Unit:GetUnitClassType() at the very beginning of the event to break it if the unit does not need the check would be much slower.
 
You can extend the DB and then use the modded DLL to pick up those changes - helps if the DLL is in the mod that adds the columns (or the latter at least depends on the former), but it was something I wrote as a "can this be done" rather than something I have an immediate need of. Feel free to lift the code and edit it for any of your own mods though
 
Well, maybe i'll see if i can follow some tuts on how to access database values, but when i mess with C++ code, i can't help but feel like a mad scientist mixing together various chemicals without knowing what they do. ;)
Now i know i could end up not blowing everything up of course :hammer2: but i try to stay on the safe side by not touching it.

Suggestions are just that. I was curious when i saw this entry and got over-excited about the possibilities.
 
V9 attached - fixes an issue with nukes, and also randomises religions

EDIT: V9 is now on my mod web site (actually it should be V10 as it includes some new stuff, but I forgot to change the version number while doing the build!)
 
Can you please tell us what happens with your Ships are able to use forts code when:

A. a Melee Ship tries to move into a hex that has an enemy unit in it.
B. a Ranged Ship tries to move into a hex that has an enemy unit in it.
C. a Melee Unit tries to move into a hex that has an enemy ship in it.
D. a Ranged Unit tries to move into a hex that has an enemy ship in it.
E. How about civilians? Can chips capture those?

Is it possible to make this an improvement that workers can build that has only the canal effects and not the fort effects? Custom Artwork?

Sorry for the slow response

> A. a Melee Ship tries to move into a hex that has an enemy unit in it.
Melee Ship will attack the unit

> B. a Ranged Ship tries to move into a hex that has an enemy unit in it.
Ranged Ship can't enter occupied tile

> C. a Melee Unit tries to move into a hex that has an enemy ship in it.
Can't happen, can only enter forts in tiles you own

> D. a Ranged Unit tries to move into a hex that has an enemy ship in it.
Can't happen, can only enter forts in tiles you own

> E. How about civilians? Can ships capture those?
Yes

> Is it possible to make this an improvement that workers can build that has only the canal effects and not the fort effects? Custom Artwork?
If someone makes the artwork (like the airfield) then yes.
 
A short question/suggestion:

as the passable forts are passable only if they are coastal tiles, the canals can only be two tiles long.

Is there a chance to remove that restriction? Looking at the c-code, the usage of a (to be created) method "isCoastalLandOrFort()" instead of "isCoastalLand()" where you already made your changes for MOD_GLOBAL_PASSABLE_FORTS may be a simple solution?
 
William, I tried to compile your DLL (v7) but I failed. I alway get the output below.

Any Hints:

PHP:
1>CvAStar.cpp
1>.\CvAStar.cpp(915) : error C2660: 'CvPlot::movementCost' : function does not take 3 arguments
1>.\CvAStar.cpp(1405) : error C2660: 'CvPlot::movementCost' : function does not take 3 arguments
1>.\CvAStar.cpp(1405) : error C2780: 'const _Ty &std::max(const _Ty &,const _Ty &,_Pr)' : expects 3 arguments - 2 provided
1>        C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xutility(3390) : see declaration of 'std::max'
1>.\CvAStar.cpp(1405) : error C2780: 'const _Ty &std::min(const _Ty &,const _Ty &,_Pr)' : expects 3 arguments - 2 provided
1>        C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xutility(3405) : see declaration of 'std::min'
1>.\CvAStar.cpp(1554) : error C2660: 'CvPlot::MovementCostNoZOC' : function does not take 3 arguments


EDIT: its the "CvGameCoreDLL_Expansion1". The other DLL is compilable
 
CvPlot::movementCost() DOES take three parameters (and I've not made any changes to that signature) so it must be something else.

Can you recompile the DLL without any changes (always a good place to start)
 
Yes of cause. Thats the first thing I made before starting with your mod. As I made a copy of the org file I can say its still compilable.

After this, I copied all the files (except rc and proj) from your mod overwriting everything. Then clean build-> build all -> failed.

Looking into the source, the CvPlot.h and CvPlot.cpp file contains a CvPlot::movementCost() taking only TWO arguments.

Maybe you accidently shipped the wrong source with the mod zip?

BTW: I downloaded it from your mod hp.
 
Maybe you accidently shipped the wrong source with the mod zip?

Possible. V9 is attached about 5 posts higher up, it fixes a couple of bugs in V7 and V8 so I recommend using that one anyway
 
OK, changed to v9. Wasn't aware that the most actual version isn't on your HP.

Now picture has changed. Now there some linker errors. Some resource files/objects missing (as far as I understand those cryptic messages)


PHP:
2>"..\BuildTemp\VS2008_CvGameCoreDLL_Expansion1ModWin32\CvGameCoreDLL.res" 
2>   Creating library C:\Users\MyVerySecretRealName\Documents\Visual Studio 2008\Projects\CvGameCoreSource\\BuildOutput\VS2008_ModWin32\/CvGameCore_Expansion1.lib and object C:\Users\MyVerySecretRealName\Documents\Visual Studio 2008\Projects\CvGameCoreSource\\BuildOutput\VS2008_ModWin32\/CvGameCore_Expansion1.exp
2>CvTeam.obj : error LNK2001: unresolved external symbol "public: int __thiscall CustomMods::getOption(char const *)" (?getOption@CustomMods@@QAEHPBD@Z)
2>CvUnit.obj : error LNK2001: unresolved external symbol "public: int __thiscall CustomMods::getOption(char const *)" (?getOption@CustomMods@@QAEHPBD@Z)
2>CvLuaPlayer.obj : error LNK2001: unresolved external symbol "public: int __thiscall CustomMods::getOption(char const *)" (?getOption@CustomMods@@QAEHPBD@Z)
2>CvMinorCivAI.obj : error LNK2001: unresolved external symbol "public: int __thiscall CustomMods::getOption(char const *)" (?getOption@CustomMods@@QAEHPBD@Z)
2>CvPlayer.obj : error LNK2001: unresolved external symbol "public: int __thiscall CustomMods::getOption(char const *)" (?getOption@CustomMods@@QAEHPBD@Z)
2>CvPlot.obj : error LNK2001: unresolved external symbol "public: int __thiscall CustomMods::getOption(char const *)" (?getOption@CustomMods@@QAEHPBD@Z)
2>CvReligionClasses.obj : error LNK2001: unresolved external symbol "public: int __thiscall CustomMods::getOption(char const *)" (?getOption@CustomMods@@QAEHPBD@Z)
2>CvBuilderTaskingAI.obj : error LNK2001: unresolved external symbol "public: int __thiscall CustomMods::getOption(char const *)" (?getOption@CustomMods@@QAEHPBD@Z)
2>CvCity.obj : error LNK2001: unresolved external symbol "public: int __thiscall CustomMods::getOption(char const *)" (?getOption@CustomMods@@QAEHPBD@Z)
2>CvCityCitizens.obj : error LNK2001: unresolved external symbol "public: int __thiscall CustomMods::getOption(char const *)" (?getOption@CustomMods@@QAEHPBD@Z)
2>CvGame.obj : error LNK2001: unresolved external symbol "public: int __thiscall CustomMods::getOption(char const *)" (?getOption@CustomMods@@QAEHPBD@Z)
2>CvTeam.obj : error LNK2001: unresolved external symbol "class CustomMods gCustomMods" (?gCustomMods@@3VCustomMods@@A)
2>CvUnit.obj : error LNK2001: unresolved external symbol "class CustomMods gCustomMods" (?gCustomMods@@3VCustomMods@@A)
2>CvLuaPlayer.obj : error LNK2001: unresolved external symbol "class CustomMods gCustomMods" (?gCustomMods@@3VCustomMods@@A)
2>CvMinorCivAI.obj : error LNK2001: unresolved external symbol "class CustomMods gCustomMods" (?gCustomMods@@3VCustomMods@@A)
2>CvPlayer.obj : error LNK2001: unresolved external symbol "class CustomMods gCustomMods" (?gCustomMods@@3VCustomMods@@A)
2>CvPlot.obj : error LNK2001: unresolved external symbol "class CustomMods gCustomMods" (?gCustomMods@@3VCustomMods@@A)
2>CvReligionClasses.obj : error LNK2001: unresolved external symbol "class CustomMods gCustomMods" (?gCustomMods@@3VCustomMods@@A)
2>CvBuilderTaskingAI.obj : error LNK2001: unresolved external symbol "class CustomMods gCustomMods" (?gCustomMods@@3VCustomMods@@A)
2>CvCity.obj : error LNK2001: unresolved external symbol "class CustomMods gCustomMods" (?gCustomMods@@3VCustomMods@@A)
2>CvCityCitizens.obj : error LNK2001: unresolved external symbol "class CustomMods gCustomMods" (?gCustomMods@@3VCustomMods@@A)
2>CvGame.obj : error LNK2001: unresolved external symbol "class CustomMods gCustomMods" (?gCustomMods@@3VCustomMods@@A)
 
Back
Top Bottom