Lua Help

Aidence

The Archduke
Joined
Nov 23, 2013
Messages
224
I'm back from the dead! But that is enough of that, on to the help I need. I'm wondering, how would I do this UA: "For every 5 military units under your control, receive 1 delegate to the World Congress. Unable to use spies." I already have the first part, but I require the second. Thanks in advance.
 
Just a shot in the dark here, but would you be able to use the tag from England's UA that grants and additional spy and make it apply negative number of spies so total number is always zero? Or does the tag from England's UA only trigger once, upon entering renaissance, or does it not accept negative numbers?
 
@kaspergm It did not work, but thanks for the effort. I still require help.
 
For the human player, you can just block the espionage interface. But it won't work for the AI, so to block spies fully you will probably need DLL changes.
 
You can add extra spies through dummy buildings as well (using the code from the National Intelligence Agency, I think). Again, I'm not sure if a negative number would work in that slot or not, though.
 
It won't work with the standard DLL.
Code:
		if(pBuildingInfo->GetExtraSpies() > 0)
		{
			CvPlayerEspionage* pEspionage = GetEspionage();
			CvAssertMsg(pEspionage, "pEspionage is null! What's up with that?!");
			if(pEspionage)
			{
				int iNumSpies = pBuildingInfo->GetExtraSpies();
				for(int i = 0; i < iNumSpies; i++)
				{
					pEspionage->CreateSpy();
				}
			}
		}

(CvPlayer.cpp)
 
Back
Top Bottom