DLL - Various Mod Components

Ooops! It should indeed be -10

In my defense, I'll also fix Firaxis' bug in the C++ source code

Code:
    // WH - This is a bug, it should be -5
    m_iWARMONGER_THREAT_PER_TURN_DECAY(5),

Hehe, okay. :D
So for now we just change it in the v2-mod to
<Replace Name="WARMONGER_THREAT_PER_TURN_DECAY">
<!-- Default 5 -->
<Value>-10</Value>
</Replace>

and everything should be fine?

Or do we also need the update/ fix in the DLL you just mentioned?
I'm a bit confused atm. ;)
 
Short: Just change it in the XML

Long: My XML value was based on the (incorrect) value in the C++ code, I didn't look in the core XML - just assumed they were the same.
 
I would like some function such as Unit:CanFoundCity(playerid, plottype, etc) so that I can trigger ability to found a city based upon a technology or policy.

You mean event (not function) - like City/PlayerCanTrain - but along the lines of PlayerCanFoundCity(iPlayer, iPlotX, iPlotY)

I'm currently going through all the C++ code looking for "CvObject::CanXyz()" methods to ascertain which ones could usefully get associated events.

I'll post back when I've compiled the list

W
 
No promises ... potential v68 events (edit, those in bold will be in v68)

Code:
[B]CvTradeClasses		- ALL	- PlayerCanCreateTradeRoute(iPlayer, iCity, iDestPlayer, iDestCity, iDomain, iConnectionType)[/B]

[B]CvPlayer		- ANY	- PlayerCanFoundCityRegardless(iPlayer, iPlotX, iPlotY)[/B] (Note: Called before any other tests)
[B]CvSiteEvaluationClasses	- ALL	- PlayerCanFoundCity(iPlayer, iPlotX, iPlotY)[/B] (Note: Called after all other tests)
[S]CvSiteEvaluationClasses	- HOOK	- PlayerFoundedCity(iPlayer, iPlotX, iPlotY)[/S] (Note: PlayerCityFounded already exists)

[S]CvTeam			- ALL	- TeamCanChangeWarPeace(iTeam, iOtherTeam)[/S] (Note: Can achieve the same effect with PlayerCanDeclareWar and PlayerCanMakePeace events)

[B]CvBarbarians		- ALL	- BarbariansCanFoundCamp(iPlotX, iPlotY)[/B]
[B]CvBarbarians		- HOOK	- BarbariansCampFounded(iPlotX, iPlotY)[/B]
[B]CvBarbarians		- HOOK	- BarbariansCampCleared(iPlotX, iPlotY, iPlayer)[/B]
[B]CvBarbarians		- ALL	- BarbariansCampCanSpawnUnit(iPlotX, iPlotY)[/B]
[B]CvBarbarians		- ACC	- BarbariansCampGetSpawnUnit(iPlotX, iPlotY, iPrefUnitType)[/B]
[B]CvBarbarians		- HOOK	- BarbariansSpawnedUnit(iPlotX, iPlotY, iUnitType)[/B]

[B]CvEspionageClasses	- ALL	- PlayerCanMoveSpyTo(iPlayer, iDestPlayer, iDestCity)[/B]
[B]CvEspionageClasses	- ALL	- PlayerCanStageCoup(iPlayer, iDestPlayer, iDestCity)[/B]

[B]CvMinorCivAI		- ALL	- PlayerCanBullyGold(iPlayer, iCS)[/B]
[B]CvMinorCivAI		- ALL	- PlayerCanBullyUnit(iPlayer, iCS)[/B]
[B]CvMinorCivAI		- HOOK	- PlayerBullied(iPlayer, iCS, iGold, iUnitType)[/B]
[B]CvMinorCivAI		- ALL	- PlayerCanGiftGold(iPlayer, iCS)[/B] (Note: AI only, human needs to be done in CityStateDiploPopup.lua)
[B]CvMinorCivAI		- ALL	- PlayerCanGiftUnit(iPlayer, iCS, iUnit)[/B] (Note: AI only, human needs to be done in CityStateDiploPopup.lua)
[B]CvMinorCivAI		- ALL	- PlayerCanGiftImprovement(iPlayer, iCS)[/B]
[B]CvMinorCivAI		- HOOK	- PlayerGifted(iPlayer, iCS, iGold, iUnitType, iPlotX, iPlotY)[/B]
[B]CvMinorCivAI		- ALL	- PlayerCanProtect(iPlayer, iCS)[/B]
[B]CvMinorCivAI		- HOOK	- PlayerProtected(iPlayer, iCS)[/B]
[B]CvMinorCivAI		- ALL	- PlayerCanRevoke(iPlayer, iCS)[/B]
[B]CvMinorCivAI		- HOOK	- PlayerRevoked(iPlayer, iCS)[/B]
[B]CvMinorCivAI		- ALL	- PlayerCanBuyOut(iPlayer, iCS)[/B]
[B]CvMinorCivAI		- HOOK	- PlayerBoughtOut(iPlayer, iCS)[/B]

[B]CvCity			- ANY	- CityCanAirlift(iPlayer, iCity)[/B]

[B]CvPlayer		- ALL	- PlayerCanLiberate(iPlayer, iOtherPlayer)[/B]
[B]CvPlayer		- HOOK	- PlayerLiberated(iPlayer, iOtherPlayer, iCity)[/B]
 
No promises ... potential v68 events
You created an Event, that is triggered when a unit is captured. But during improving the Prospector unit, I noticed that it returns not the player who captured the unit.

And if you have some time left, you could check my improvements of your mods (Units-Prospectors and UI-CityExpansion), see my profile for download.
I think my improvements are quite good, but maybe not good coded (although everything works well). So feel free to use my ideas and include them with better code in a new version of the mods ;)
 
You created an Event, that is triggered when a unit is captured. But during improving the Prospector unit, I noticed that it returns not the player who captured the unit.

That's because it is not a "this unit was captured" event, but an event to determine what unit type a captured unit should transform into (eg settlers transform into workers)
 
Code:
[B]CvSiteEvaluationClasses	- ALL	- PlayerCanFoundCity(iPlayer, iPlotX, iPlotY)[/B]

Will this be able to override limits such as the minimum distance between cities, or -- most importantly to me -- a NoAnnexing trait?
 
Like all of the other Player/CityCanXyz events it fires after all the standard checks, so no ...

... but ...

... it's easy enough to add another event that fires before all the standard checks for those occasions.

(Actually, the hardest part is coming up with a name for the event!)
 
Today's teaser ...

attachment.php


Spoiler :
attachment.php

Something I forgot to ask:

all these new and shiny features will be optional, right? :D
So we can disable them just in case they cause any desync-issues in multiplayer?
 
Found a bug with the Terrain Crossing mod:

When you upgrade a unit to a gunship while being embarked in ocean tiles, it will remain embarked even when entering land tiles (ships moving through land).

WM0aMbf.jpg


Is there a way to fix this?
 
V68 is up on my web site and GitHub ...

...the events release ...

Code:
// Events sent on interaction with City States (v68)
//   GameEvents.PlayerCanProtect.Add(function(iPlayer, iCS) return true end)
//   GameEvents.PlayerProtected.Add(function(iPlayer, iCS) end)
//   GameEvents.PlayerCanRevoke.Add(function(iPlayer, iCS) return true end)
//   GameEvents.PlayerRevoked.Add(function(iPlayer, iCS, bPledgeNowBroken) end)
//   GameEvents.PlayerCanBuyOut.Add(function(iPlayer, iCS) return true end)
//   GameEvents.PlayerBoughtOut.Add(function(iPlayer, iCS) end)
//   GameEvents.PlayerCanBullyGold.Add(function(iPlayer, iCS) return true end)
//   GameEvents.PlayerCanBullyUnit.Add(function(iPlayer, iCS) return true end)
//   GameEvents.PlayerBullied.Add(function(iPlayer, iCS, iGold, iUnitType, iPlotX, iPlotY) end)
//   GameEvents.PlayerCanGiftGold.Add(function(iPlayer, iCS) return true end)
//   GameEvents.PlayerCanGiftUnit.Add(function(iPlayer, iCS, iUnit) return true end)
//   GameEvents.PlayerCanGiftImprovement.Add(function(iPlayer, iCS) return true end)
//   GameEvents.PlayerGifted.Add(function(iPlayer, iCS, iGold, iUnitType, iPlotX, iPlotY) end)
#define MOD_EVENTS_MINORS_INTERACTION               gCustomMods.isEVENTS_MINORS_INTERACTION()

// Events sent by Barbarians (v68)
//   GameEvents.BarbariansCanFoundCamp.Add(function(iPlotX, iPlotY) return true end)
//   GameEvents.BarbariansCampFounded.Add(function(iPlotX, iPlotY) end)
//   GameEvents.BarbariansCampCleared.Add(function(iPlotX, iPlotY, iPlayer) end)
//   GameEvents.BarbariansCampCanSpawnUnit.Add(function(iPlotX, iPlotY) return true end)
//   GameEvents.BarbariansCampGetSpawnUnit.Add(function(iPlotX, iPlotY, iPrefUnitType) return iPrefUnitType end)
//   GameEvents.BarbariansSpawnedUnit.Add(function(iPlotX, iPlotY, iUnitType) end)
#define MOD_EVENTS_BARBARIANS                       gCustomMods.isEVENTS_BARBARIANS()

// Event sent as ascertain if a trade route can be created (v68)
//   GameEvents.PlayerCanCreateTradeRoute.Add(function(iFromPlayer, iFromCity, iToPlayer, iToCity, iDomain, iConnectionType) return true end)
#define MOD_EVENTS_TRADE_ROUTES                     gCustomMods.isEVENTS_TRADE_ROUTES()
	
// Event sent about city founding (v68)
//   GameEvents.PlayerCanFoundCity.Add(function(iPlayer, iPlotX, iPlotY) return true end)
//   GameEvents.PlayerCanFoundCityRegardless.Add(function(iPlayer, iPlotX, iPlotY) return false end)
#define MOD_EVENTS_CITY_FOUNDING                    gCustomMods.isEVENTS_CITY_FOUNDING()
	
// Event sent to ascertain if a player can liberate another player (v68)
//   GameEvents.PlayerCanLiberate.Add(function(iPlayer, iOtherPlayer) return true end)
//   GameEvents.PlayerLiberated.Add(function(iPlayer, iOtherPlayer, iCity) end)
#define MOD_EVENTS_LIBERATION                       gCustomMods.isEVENTS_LIBERATION()
	
// Event sent to ascertain if a city can perform airlifts (v68)
//   GameEvents.CityCanAirlift.Add(function(iPlayer, iCity) return false end)
#define MOD_EVENTS_CITY_AIRLIFT                     gCustomMods.isEVENTS_CITY_AIRLIFT()

// Events sent during combat (v68)
//   GameEvents.BattleStarted.Add(function(iType, iPlotX, iPlotY) end)
//   GameEvents.BattleJoined.Add(function(iPlayer, iUnitOrCity, iRole, bIsCity) end)
//   GameEvents.BattleFinished.Add(function() end)
#define MOD_EVENTS_BATTLES                          gCustomMods.isEVENTS_BATTLES()
//   GameEvents.BattleDamageDelta.Add(function(iRole, iBaseDamage) return 0 end)
#define MOD_EVENTS_BATTLES_DAMAGE                   (MOD_EVENTS_BATTLES && gCustomMods.isEVENTS_BATTLES_DAMAGE())
 
There is a small typo in the XML of the Terrain Crossing mod, where it says 'UNITCOMBAT_NAVALLMELEE' for the Icebreaker-Promotion.
 
Cool, does it already address the Gunship-upgrade by chance?
That's next weekend's task!

There is a small typo in the XML of the Terrain Crossing mod, where it says 'UNITCOMBAT_NAVALLMELEE' for the Icebreaker-Promotion.
Edit: Must be a mod-mod, as the Ice-Breaker promotion in my mod is an unearnable promotion (ie it has to be given as a free promotion with a unit or via Lua)


I fixed the other one in the Air Bases mod
 
The source code now has a new home - https://github.com/whoward69/DLL-VMC - it is no longer a fork of Gedemon's repository

I am now using VS-2015 to build the DLL and all other solution files have been deleted.
Note: VS-2015 is a free download from the Microsoft web-site. You will still need VS-2008 installed (it's part of the CivV SDK as it's what ModBuddy is built into) to be able to build the DLL.

There should be no build files missing now - it should be possible to grab the entire repository, open CvGameCoreDLL.vs2015.sln file with VS-2015 and build all three sub-projects (although only CvGameCoreDLL_Expansion2 has any significant changes)

Edit: And yeah! I can finally use Tortoise-Git instead of the gawd-awful command line :D
 
Hey Whoward, I'm not actually sure if this is the right place to ask, but, in the City Working Distance mod, when you say the min value of 2 rings is hard-coded in the DLL, I assume that means limiting work to a single ring isn't an option without major DLL changes?
 
Back
Top Bottom