DLL - Various Mod Components

You're probably not taking requests, but I'll put this one out there anyway. I'll do this at some point myself if no one else does:

How about the ability for civilian units to stack and to pass through (and even coexist on) plots with foreign units or foreign cities. I'm a big fan of 1upt for military units, but I see no good from it for civilian units, and one heck of a lot of annoyance. It's interesting that your units can already "path" through a foreign city ... but your poor civilian unit has to detour through the forest if a foreign unit is sitting on your own road. My recommendation would be to remove all restrictions from civilian unit movement that are not terrain based.

(I would suggest disabling worker builds on tiles that already have a unit building something. In Civ4, this was possible and lead to the optimal but micromanaging strategy of "stack building" all improvements.)
 
Well done:thumbsup:
Tested your mod and wow, all works without any problems.:old:
 
My recommendation would be to remove all restrictions from civilian unit movement that are not terrain based.

I assume you can't stack with a unit you're at war with. Would all the rules go back to default if you're at war with the foreign unit's civ (e.g., the zone of control movement penalties, etc.)?

I like it, but I dunno... I think this should only be available if you have open borders with the civ.

Plus, since you don't want to allow for hurrying improvements, I'm not sure I like civilians being able to stack, mostly because of what occurs in war zones. Protecting civilians is an interesting (though, yes, sometimes frustrating) part of the 1-unit-per-tile-per-type dynamic when, e.g., building roads to military staging areas and moving Great Generals around.
 
@Nutty. I should edit to say "not terrain based or when at war". The whole point is that 1upt is a new element in the game that was meant to enhance tactical military gameplay. It does nothing for civilians except add headache.

I feel bad now for hijacking the thread. I should have put this in a new dll suggestions thread. We probably should cease discussion here unless whoward69 is interested...
 
whoward69 is interested...

Not really, I have too many other things I need to do first with the DLL to get my own mods working/enhanced first
 
It's not just coding ... people will still post walls of text using txtspk and no capitals or punctuation wiv por speling even gramma and stuff and still xpect replies

Literacy in computer languages is no different to that in spoken/written langauges ;)

cn ne1 hlp me plz i dun no wat 2 do i lkd @ thred but tl;dr lol plz hlp i ono how 2 do plz

OK I see your point.
 
Version 2 is now attached to the first post

  • Global - CS Gift Ships: City States will gift ships
  • Events - New Era: Sent when the team/player enters a new era - GameEvents.TeamSetEra.Add(function(eTeam, eEra) end)
  • Events - Diplo Events: Sent during Game.DoFromUIDiploEvent - GameEvents.UiDiploEvent.Add(function(eEvent, eAIPlayer, iArg1, iArg2) end)
  • API - Espionage API: Adds various Lua methods to the Player object for controlling spies
  • BugFix - Free Food Building: Fixes the NumCitiesFreeFoodBuilding (policy finisher) bug where the civilization has a UB for the Aquaduct
  • BugFix - Range 3 Targetting: Fixes the Range-3 targetting bug - code by DaveMcW
 
There is an experimental "easter-egg" in v2, the attached enables it.

Great People can construct Free Buildings

  • Engineer (production) Workshop --> Factory --> Spaceship Factory
  • Artist (culture) Monument --> Amphitheater --> Opera House --> Museum --> Broadcast Tower
  • Prophet (happiness) Colosseum --> Theatre --> Stadium
  • Scientist (science) Library --> University --> Public School --> Research Lab
  • Merchant (gold) Market --> Bank --> Stock Exchange
  • General (combat) Barracks --> Armory --> Military Academy
  • Admiral (naval combat) Barracks --> Armory --> Military Academy

EXPERIMENTAL - The AI will NOT attempt to use Great People to construct free buildings, so this mod gives a significant advantage to the Player.
 
Simple example of GameEvents.TeamSetEra and pPlayer:EspionageCreateSpy()

Grants bonus spies to the team that is first to reach specific eras
 
This is awesome! I wonder why firaxis never fixed the range 3 bug, gifting ships to citystates or freefood bug fix.
 
So G&K gave us spies ... spies that steal techs from major civs or ones that rig elections in minor civs ... and nothing else. But worse yet, there is ZERO usable Lua API for mods to extend/change what spies can/cannot do.

First problem, let's say I want to write a mod that makes the race to the Renaissance era more interesting by giving a bonus spy to the first civ to get there - can't be done as there is no API to grant new spies.

Second problem, let's say I write a mod that does something "risky" with a spy - but what's the point as there is no API to give rewards/penalties to spies

Third problem, let's say I want to have the spies just gather intel, and not upset the neighbours by stealing techs or rigging elections - again no API to do this.

Solution 1 - Player:EspionageCreateSpy() - gives the player a new spy
Solution 2 - Player:espionagePromoteSpy(iSpy) (the reward) and Player:EspionageSetOutcome(...) (the penalty)
Solution 3 - EspionageSetPassive(iSpy, bPasive) - disables/enables the standard steal/rig code (so the mod can do something different)
 
Version 3 is now attached to the first post

  • Global - CS Upgrades: Units in allied militaristic City States can upgrade
  • Events - Goody Techs: Sent when a Goody Hut that grants a free tech is being processed

Note: The UI will incorrectly report that a unit can't upgrade because it's not in friendly territory when it's within an allied CS if it can't upgrade for another reason (lack of funds/resources) - to fix this requires a patch to UnitPanel.lua as all the "can I upgrade now" C++ code is duplicated in Lua as the CvUnit class doesn't modularise (and expose) the decision making process.
 
Example of how the two Goody Hut tech events can be used

Goody Huts will not grant techs from column N (GridX=N) of the tech tree, if there are still unresearched techs in columns 1 thru N-1 - so you can't get Writing (column 2) if you haven't researched Mining (column 1)

If the Goody Hut grants the tech you are currently researching, some of the "lost" research will be put towards a dependant tech. For example, if you're researching Writing and the Goody Hut gives you that tech, some of the "lost" research will be put towards either Drama or Philosophy (the two dependant techs of Writing)

The refund percentage decreases from 100% for Settler and Chieftain to 0% for Immortal and Deity
 
Note: The UI will incorrectly report that a unit can't upgrade because it's not in friendly territory when it's within an allied CS if it can't upgrade for another reason (lack of funds/resources) - to fix this requires a patch to UnitPanel.lua as all the "can I upgrade now" C++ code is duplicated in Lua as the CvUnit class doesn't modularise (and expose) the decision making process.

Are you planning on releasing a patch to UnitPanel.lua that fixes this?
 
Are you planning on releasing a patch to UnitPanel.lua that fixes this?

I wasn't planning to, as most scenarios, total conversions, mega-mods already edit this file heavily.
 
I've added a function to the Lua API (will be in v4) that will make the required change to UnitPanel.lua a lot easier - pUnit:CanUpgradeInTerritory()

Code:
-- Can't upgrade because we're outside our territory
if (pPlot:GetOwner() ~= unit:GetOwner()) then

will become

Code:
-- Can't upgrade because we're outside our or an allied CS territory
if (not unit:CanUpgradeInTerritory()) then
 
I wasn't planning to, as most scenarios, total conversions, mega-mods already edit this file heavily.

That's a good point. I guess it's up to individual modders to fix this one for their own mods if they choose to include your .dll components. I can't imagine it is particularly hard (or really, particularly important).
 
My CiV crash randomly... not sure if it's related to this mod or my hardware (I got new RAM)

Windows event log:
Spoiler :
Fault bucket -1038228185, type 1
Event Name: APPCRASH
Response: Not available
Cab Id: 0

Problem signature:
P1: CivilizationV_DX11.exe
P2: 1.0.2.13
P3: 508a311c
P4: CvGameCore_Expansion1.dll
P5: 3.0.3.0
P6: 50a16a9f
P7: c0000005
P8: 00020ead
P9:
P10:

Attached files:
C:\Users\fadya_000\AppData\Local\Temp\WER6D1B.tmp.WERInternalMetadata.xml

These files may be available here:
C:\Users\fadya_000\AppData\Local\Microsoft\Windows\WER\ReportArchive\AppCrash_CivilizationV_DX_7673a0183dafc527ce3d25e6a131231149d96058_17b380b3

Analysis symbol:
Rechecking for solution: 0
Report Id: 0d119fd8-2f4c-11e2-bea8-bcaec57c65b4
Report Status: 16
Hashed bucket: 8bed81bc2805167f77c444bb26aaa313

Spoiler :
Faulting application name: CivilizationV_DX11.exe, version: 1.0.2.13, time stamp: 0x508a311c
Faulting module name: CvGameCore_Expansion1.dll, version: 3.0.3.0, time stamp: 0x50a16a9f
Exception code: 0xc0000005
Fault offset: 0x00020ead
Faulting process id: 0x1b24
Faulting application start time: 0x01cdc34eae4bac01
Faulting application path: C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization V\CivilizationV_DX11.exe
Faulting module path: F:\Documents\My Games\Sid Meier's Civilization 5\MODS\DLL - Various Mod Components (GK) (v 3)\CvGameCore_Expansion1.dll
Report Id: 0d119fd8-2f4c-11e2-bea8-bcaec57c65b4
Faulting package full name:
Faulting package-relative application ID:
 
Top Bottom