// EaModding.h
// Precompiler instructions for adding Ea mod code
// Comment-out any blocks of code you don't want
//
// Paz: Welcome to my universe!
// All dll modifications are marked by pre-compiler defines below or by "Paz Bug Fix"
#pragma once
#define EA_DLL_VERSION 1
#define EA_CONFIGURATION 3 // 0, Compiles as unomdded dll
// 1, Compiles Isolation Code only
// 2, Compiles with civilian rules only - NMCTJs Mod
// 3, Compiles for Ea
#if (EA_CONFIGURATION > 0)
// Isolation Code - move define here and set EA_CONFIGURATION to 1 to test a change in isolation
#endif
#if (EA_CONFIGURATION > 1) // This is the No More Civilians Traffic Jams (NMCTJs) Mod!
// Civilian rules:
#define EA_BREAK_CIVILIAN_1UPT
#define EA_BREAK_CIVILIAN_OTHER_RESTRICTIONS // Can move into foreign units or cities if not at war
#endif
#if (EA_CONFIGURATION > 2)
// Ea GP Support
#define EA_PERSISTENT_SETTABLE_COMBAT //
#define EA_BREAK_GP_1UPT
#define EA_BREAK_GP_OTHER_RESTRICTIONS
#define EA_GP_SPECIAL_ATTACK_CONTROL // Modifies CvUnit::canMoveInto and CvUnit::isBetterDefenderThan [and CvDangerPlots::ShouldIgnoreUnit?] to handle special GP attack rules
#define EA_PERSISTENT_SETTABLE_INVISIBILITY
#define EA_INVISIBILITY_YOU_CANT_SEE
//#define EA_GP_MAX_HIT_POINTS
// Some of Gedemon's Combat Events
#define EA_COMBAT_EVENTS
// Civ & Leader changing:
#define EA_CIVILIZATION_TRAITS // Traits can be from Leader OR Civilization [Requires new Civilization_Traits table]
#define EA_CIV_LEADER_CHANGING // Adds player:ChangeCivilizationType() and player:ChangeLeaderType() with trait resets
// Civ contact:
#define EA_EVENT_CAN_MEET_TEAM // GameEvents.CanMeetTeam; prevents all contact including war state change, but can still start/end war via Lua
#define EA_EVENT_CAN_CONTACT_MAJOR_TEAM // GameEvents.CanContactMajorTeam; prevents UI and AI interaction after meeting
// Animal player support:
#define EA_ANIMAL_PLAYER // Add as player 62 (define ANIMAL_PLAYER, ANIMAL_TEAM enums); all spawning logic on Lua side
#define EA_ANIMAL_BEHAVIOR // Don't enter enemy borders; don't pillage trade route
// Gods
#define EA_RELIGIOUS_MINORS_DONT_DIE // These are gods in Ea and don't have cities
// Policy, Tech counting
#define EA_DONT_COUNT_UTILITY_POLICIES
// Promotions
//#define EA_PROMOTION_REQUIRE_GP
// Misc extended Lua support:
#define EA_EVENT_CANAUTOSAVE // GameEvents.CanAutoSave(bInitial, bPostTurn) CallTestAll
#define EA_EVENT_TECH_COST_MOD // GameEvents.PlayerTechCostMod(techID, iPlayer); CallAccumulator that uses return integer as percent cost modifier
#define EA_UNIT_MORALE // Set of Lua methods and persisted unit int for Ea's Morale system (needs UI Lua/XML support to show in unit panel)
#define EA_UNIT_PERSON_INFO // Just a persisted unit int used for GPs, with Get, Set Lua methods
#define EA_PLOTS // Persisted plot data for Ea's Living Terrain and plot methods
#define EA_EVENT_MINOR_FRIENDSHIP // GameEvents.PlayerMinorFriendshipAnchor(eMajor, eMinor); CallAccumulator
#define EA_PATHFINDING
// Macros
#define SHOW_PLOT_FLOATUP(pPlot, ePlayer, szMessage, fDelay) if (pPlot->isVisible(GET_PLAYER(ePlayer).getTeam())) DLLUI->AddPopupText(pPlot->getX(), pPlot->getY(), szMessage, fDelay)
// Work in progress:
//#define EA_LEADER_SCENE_BYPASS // This is insane! (needs support LeaderHead and related xml/lua)
//#define EA_PLAYER_DEAL_API // Needed for EA_LEADER_SCENE_BYPASS to work
#endif
// Depreciated, but should work if we ever need it again:
//#define EA_COMBAT_EVENTS_EXTRA
//#define EA_ALLOW_REDUNDANT_BARB_PLAYER_COLOR // DEPRECIATED
//#define EA_SET_FOUNDED_FIRST_CITY // Added but never tested
// Doesn't work or dangerous code
//#define EA_FOUND_RELIGION_NO_FOUNDER // Found religion without fouder or holy city or notification
For any C++ coders following the mod, I've finally uploaded the current phase 3 dll to GitHub.
Civ5-EaDLL repository
Compare to master
Compilation of all mod changes is controlled from EaModding.h, which also documents the changes. From here you can compile the mod with/without various changes by enabling/disabling defines:
Project files are available if anyone asks.Spoiler :Code:// EaModding.h // Precompiler instructions for adding Ea mod code // Comment-out any blocks of code you don't want // // Paz: Welcome to my universe! // All dll modifications are marked by pre-compiler defines below or by "Paz Bug Fix" #pragma once #define EA_DLL_VERSION 1 #define EA_CONFIGURATION 3 // 0, Compiles as unomdded dll // 1, Compiles Isolation Code only // 2, Compiles with civilian rules only - NMCTJs Mod // 3, Compiles for Ea #if (EA_CONFIGURATION > 0) // Isolation Code - move define here and set EA_CONFIGURATION to 1 to test a change in isolation #endif #if (EA_CONFIGURATION > 1) // This is the No More Civilians Traffic Jams (NMCTJs) Mod! // Civilian rules: #define EA_BREAK_CIVILIAN_1UPT #define EA_BREAK_CIVILIAN_OTHER_RESTRICTIONS // Can move into foreign units or cities if not at war #endif #if (EA_CONFIGURATION > 2) // Ea GP Support #define EA_PERSISTENT_SETTABLE_COMBAT // #define EA_BREAK_GP_1UPT #define EA_BREAK_GP_OTHER_RESTRICTIONS #define EA_GP_SPECIAL_ATTACK_CONTROL // Modifies CvUnit::canMoveInto and CvUnit::isBetterDefenderThan [and CvDangerPlots::ShouldIgnoreUnit?] to handle special GP attack rules #define EA_PERSISTENT_SETTABLE_INVISIBILITY #define EA_INVISIBILITY_YOU_CANT_SEE //#define EA_GP_MAX_HIT_POINTS // Some of Gedemon's Combat Events #define EA_COMBAT_EVENTS // Civ & Leader changing: #define EA_CIVILIZATION_TRAITS // Traits can be from Leader OR Civilization [Requires new Civilization_Traits table] #define EA_CIV_LEADER_CHANGING // Adds player:ChangeCivilizationType() and player:ChangeLeaderType() with trait resets // Civ contact: #define EA_EVENT_CAN_MEET_TEAM // GameEvents.CanMeetTeam; prevents all contact including war state change, but can still start/end war via Lua #define EA_EVENT_CAN_CONTACT_MAJOR_TEAM // GameEvents.CanContactMajorTeam; prevents UI and AI interaction after meeting // Animal player support: #define EA_ANIMAL_PLAYER // Add as player 62 (define ANIMAL_PLAYER, ANIMAL_TEAM enums); all spawning logic on Lua side #define EA_ANIMAL_BEHAVIOR // Don't enter enemy borders; don't pillage trade route // Gods #define EA_RELIGIOUS_MINORS_DONT_DIE // These are gods in Ea and don't have cities // Policy, Tech counting #define EA_DONT_COUNT_UTILITY_POLICIES // Promotions //#define EA_PROMOTION_REQUIRE_GP // Misc extended Lua support: #define EA_EVENT_CANAUTOSAVE // GameEvents.CanAutoSave(bInitial, bPostTurn) CallTestAll #define EA_EVENT_TECH_COST_MOD // GameEvents.PlayerTechCostMod(techID, iPlayer); CallAccumulator that uses return integer as percent cost modifier #define EA_UNIT_MORALE // Set of Lua methods and persisted unit int for Ea's Morale system (needs UI Lua/XML support to show in unit panel) #define EA_UNIT_PERSON_INFO // Just a persisted unit int used for GPs, with Get, Set Lua methods #define EA_PLOTS // Persisted plot data for Ea's Living Terrain and plot methods #define EA_EVENT_MINOR_FRIENDSHIP // GameEvents.PlayerMinorFriendshipAnchor(eMajor, eMinor); CallAccumulator #define EA_PATHFINDING // Macros #define SHOW_PLOT_FLOATUP(pPlot, ePlayer, szMessage, fDelay) if (pPlot->isVisible(GET_PLAYER(ePlayer).getTeam())) DLLUI->AddPopupText(pPlot->getX(), pPlot->getY(), szMessage, fDelay) // Work in progress: //#define EA_LEADER_SCENE_BYPASS // This is insane! (needs support LeaderHead and related xml/lua) //#define EA_PLAYER_DEAL_API // Needed for EA_LEADER_SCENE_BYPASS to work #endif // Depreciated, but should work if we ever need it again: //#define EA_COMBAT_EVENTS_EXTRA //#define EA_ALLOW_REDUNDANT_BARB_PLAYER_COLOR // DEPRECIATED //#define EA_SET_FOUNDED_FIRST_CITY // Added but never tested // Doesn't work or dangerous code //#define EA_FOUND_RELIGION_NO_FOUNDER // Found religion without fouder or holy city or notification
Edit: I'll be maintaining Lua/SQL/XML code for phase 3 development in a separate GitHub repository here.
The dll is a VS2010 project. For some reason, I don't see "Export Template" in the File menu (and google search suggests that maybe this isn't implemented for C++ projects). But I guess I can just zip up the sln and all relevant files. VS2012 is something you have to purchase, isn't it? That's why I'm working in VS2010.
I can't upload the Ea Media Pack to GitHub since it's 1 Gb of mostly media files. I'll probably just upload all three projects (EaDLL, Ea_Sword_and_Sorcery, and Ea Media Pack) to my ge.tt site.
I'm going to work on this for one more day and then upload the 3 projects and update GitHub code. I added a bunch of stuff this weekend and I want to work out some of the more blatant bugs first.
The project is a vc++ 2008 project, but in the SDK it comes with solutions for 2008, 2010, and 2012 (all of which use the same project). Adding the project file to the GitHub repo would work fine. I would recommend though that you keep the SQL/XML/Lua on Github though just from my experience using source control with C2C. That makes tracking gameplay and balance changes easy, and you can normally decouple those changes from the large art and media files.
I guess I'm violating this right now because I don't have Lua_51, FirePlace (whatever that is), and other base source code folders that (I assume) are needed to compile the dll. (I did remove the other two pre-expansion2 dlls since I'll never mod them.) I'll try to get this all sorted out this weekend. The test will be if someone else can compile a functioning mod from GitHub plus the Media Pack solution.I would recommend including enough of each project in the repositories so that if someone were to clone them, they could open it up and start working/compile a working version of the mod themselves. That's generally what you want to do for using a source control solution to help people collaborate on a shared code base. (So you include project and solution files, and presumably the other 2 game core dlls, unless you've actually removed them from the solution itself.)
When all our mods are out and functioning reasonably well, we should all take a weekend to play other modder's mods. I've been following yours and others in the posts. But I almost never play mods myself, not since FFH. (Problem is, when I play any video game then this mod halts development for a week or two.)I've only recently started following Ea (I've been aware of it for a while, but never looked much further) and I'm extremely impressed with the volume of content you're adding to the game!
Thanks for the tips.
I guess I'm violating this right now because I don't have Lua_51, FirePlace (whatever that is), and other base source code folders that (I assume) are needed to compile the dll. (I did remove the other two pre-expansion2 dlls since I'll never mod them.) I'll try to get this all sorted out this weekend. The test will be if someone else can compile a functioning mod from GitHub plus the Media Pack solution.
I'm still a bit unsure what I'm doing with GitHub. The way I created the "master" branch was to move my modded CvGameCoreDLL_Expansion2 folder out of my project (temporarily) and replace with the unmodded one. Then I committed to "master". Then I made a new branch "Ea" and committed again to that branch after restoring my modded CvGameCoreDLL_Expansion2 folder. I got things out of sequence several times and could only fix by fully deleting and re-creating my GitHub repository (overriding GitHub messages warning me not to do that). I'm sure there's a better way, but what I was doing was simulating what would have happened if I had started using GitHub before I started modding the code.
OK, I learned the hard way that not all modded C++ files are in CvGameCoreDLL_Expansion2. My addition of Animals as player 62 changes and adds defines in CvGameCoreDLLUtil/include/CvDLLUtilDefines.h.
Anyway, If I've done everything correctly, it should now be possible for a modder to reconstruct the current phase 3 build from my GitHub repositories plus the current Ea Media Pack (that's at an external file sharing site but linked from the GitHub readme). The current build should run without error, at least until your Thaumaturges start doing stuff.
For testing mod, always use the mod's Autoplay function rather than starting it from the Fire Tuner page. Just type:
Autoplay(<turns>) to start and Autoplay(1) to bring it to an end.