Super Spies (BTS 3.19)

I thought that the mission had worked and tested it out.
The mission will still succeed, removing any building yield modifications provided by power, but the code to define that a building should cease to function at all without power is incomplete.

In CvInfos.cpp
Spoiler :
Code:
bool CvBuildingInfo::read(CvXMLLoadUtility* pXML)
{
	...
	pXML->GetChildXmlValByName(&m_bPrereqPower, "bPrereqPower");
	...
}
In the CIV4BuildingsSchema.xml you need to include the tag definition
plus add the element in the BuildingInfo block
Spoiler :

Code:
<ElementType name="bPrereqPower" content="textOnly" dt:type="boolean"/>

Code:
<ElementType name="BuildingInfo" content="eltOnly">
	...
	<element type="bPrereqPower" minOccurs="0"/>
	...
</ElementType>

and obviously some buildings need to have the tag added if they should be disabled
 
I see, thanks.

I made a new mission to bribe a barbarian to go away (defeats unit). I was thinking of adding as a seperate mission also available to spies, but not as overpowered. The Great Diplomat mission consumes the unit and can "bribe" any and all barbarian units in a tile. The Spy mission should IMO just bribe one one unit. I think that if I just adapt the bribe spy unit mission and take out the hasmoved check, I will get the result I want. It seems silly to make the bribe barbarian mission dependant on moving, because barbarians never seem to settle.

Here is what I was thinking:
Code:
	if (kMission.getBuyUnitCostFactor() > 0)
	{
		if(pSpyUnit->canBribe(pPlot, false))
		{
			CvUnit* pTargetUnit;
			if (pPlot->plotCheck(PUF_isOtherTeam, getID(), -1, NO_PLAYER, NO_TEAM, PUF_isVisible, getID()))
			{
				for (int i = 0; i < pPlot->getNumUnits(); i++) 
				{
					pTargetUnit = pPlot->getUnitByIndex(i);
					if (NULL != pTargetUnit && [COLOR="Blue"]pTargetUnit->isBarbarian()) [/COLOR]
					{
						if (pTargetUnit->getTeam() == eTargetTeam) break;
						pTargetUnit = NULL;
					}
				}
			}

Does that look OK? Any thought?
 
You don't normally accumulate any espionage points against the barbarians so I'm not sure that it is a valid concept, regardless of that there are also some other changes that would be required.

The lack of espionage points would need to be dealt with here
Spoiler :
PHP:
bool CvPlayer::canDoEspionageMission(EspionageMissionTypes eMission, PlayerTypes eTargetPlayer, const CvPlot* pPlot, int iExtraData, const CvUnit* pUnit) const
{
	...
	int iCost = getEspionageMissionCost(eMission, eTargetPlayer, pPlot, iExtraData, pUnit);
	if (iCost < 0)
	{
		return false;
	}

	if (NO_PLAYER != eTargetPlayer)
	{
		int iEspionagePoints = GET_TEAM(getTeam()).getEspionagePointsAgainstTeam(GET_PLAYER(eTargetPlayer).getTeam());

		if (iEspionagePoints < iCost)
		{
			return false;
		}

		if (iEspionagePoints <= 0)
		{
			return false;
		}
	}
	...
}

You would also need to update canBribe as that has the following code:

Spoiler :
PHP:
bool CvUnit::canBribe(const CvPlot* pPlot, bool bTestVisible) const
{
	...
	if (kTarget.isBarbarian())
	{
		return false;
	}
	...
}
There are probably other places that would need to be dealt with trying to perform espionage against barbarians, but these are ones I saw quickly
 
I think that you are right about espionage against barbarians as being a bit unsusual. Maybe I can adapt my Great Diplomat bribe barbarian stack mission to pick only one unit. Not sure how to do that unless possible add a buttonpopup code to it similar to the lead or load buttonpopup C++ code.

Anyway, here is my bribe barbarian code as it is. If you have any suggestions please let me know:
Code:
bool CvUnit::canBribeBarbarian(const CvPlot* pPlot, bool bTestVisible) const
{
	CvUnit* pLoopUnit;
	if (!m_pUnitInfo->isBribeBarbarian())
	{
		return false;
	}

	if (isBarbarian())
	{
		return false;
	}

	// Can't buy units if they are not in a legal plot
	CLLNode<IDInfo>* pUnitNode = pPlot->headUnitNode();
	while (pUnitNode != NULL)
    {
        pLoopUnit = ::getUnit(pUnitNode->m_data);
        pUnitNode = pPlot->nextUnitNode(pUnitNode);
		if (NULL != pLoopUnit) 
		{
			if (pLoopUnit->isBarbarian())
			{
				if (pLoopUnit->getTeam() != getTeam())
				{
					return true;
				}
			}
		}
    }	
  
   return false;
}


bool CvUnit::BribeBarbarian()
{
	FAssertMsg(pUnit != NULL, "City is not assigned a valid value");
	int iPass;
    CvPlot* pPlot = plot();

    if (!canBribeBarbarian(pPlot))
    {
        return false;
    }

	for (iPass = 0; iPass < 2; iPass++)
	{
		CLLNode<IDInfo>* pUnitNode = pPlot->headUnitNode();
		CvUnit* pLoopUnit;

		while (pUnitNode != NULL)
		{
			pLoopUnit = ::getUnit(pUnitNode->m_data);
			pUnitNode = pPlot->nextUnitNode(pUnitNode);
	  
			if (pLoopUnit->isBarbarian())
			{
				if (iPass == 0)
				{
					CvWString szBuffer;
					pLoopUnit->kill(true);
																
					szBuffer = gDLL->getText("TXT_KEY_MISC_BRIBE_BARBARIAN", pLoopUnit->getNameKey());
					gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), true, GC.getEVENT_MESSAGE_TIME(), szBuffer, GC.getEraInfo(GC.getGameINLINE().getCurrentEra()).getAudioUnitVictoryScript(), MESSAGE_TYPE_INFO, NULL, (ColorTypes)GC.getInfoTypeForString("COLOR_GREEN"), pPlot->getX_INLINE(), pPlot->getY_INLINE());
				}
			}
		}
	}
	if (pPlot->isActiveVisible(false))
	{
		// Bribe Barbarian entity mission
		CvMissionDefinition kDefiniton;
		kDefiniton.setMissionTime(GC.getMissionInfo(MISSION_BRIBE_BARBARIAN).getTime() * gDLL->getSecsPerTurn());
		kDefiniton.setMissionType(MISSION_BRIBE_BARBARIAN);
		kDefiniton.setPlot(pPlot);
		kDefiniton.setUnit(BATTLE_UNIT_ATTACKER, this);
		kDefiniton.setUnit(BATTLE_UNIT_DEFENDER, NULL);
		gDLL->getEntityIFace()->AddMission(&kDefiniton);
	}
	kill(true);
	
    return true;
}
 
v2.0
-Can delete double agents
-Vassal's spies no longer caught in master's territory change before
-Removed spy SAM C++
-Added Help text for all espionage missions.
-Removed C++ promotion spy exceptions
-Disable Power Turns is a global defines
-Added Amount or Turns in Mission Help Texts (War Weariness)
-Highlight attitude modifiers in Mission Help Texts
-Added city name to help text
-Added new line for some help Texts
-Added icons for Mission Help Texts
-Removed Spync and replaced with just option
-Promos affect other missions
-Bribe Worker: (SpyBribeWorkerChange) Treachery promotion
-Nuke City- (SpyNukeCityChange) Conspiracy promotion
-Disable Power: (SpyDisablePowerChange) Conspiracy promotion
-War Weariness: (SpyWarWearinessChange) Intrigue promotion
-Bribe city: (SpyBribeCityChange)Treachery (new) promotion
-Sabotage research: (SpyResearchSabotageChange) Intrigue promotion
-Remove religion: (SpyReligionRemovalChange) Instigation promotion
-Remove corporation: (SpyCorporationRemovalChange) Instigation promotion
-Steal Treasury: (SpyStealTreasuryChange) Int
-Buy Tech: (SpyBuyTechChange)
-Switch Civic: (SpySwitchCivicChange)
-Switch religion: (SpySwitchReligionChange)
-Destroy Project: (SpyDestroyProjectChange)
-Remove Production: (SpyDestroyPoductionChange)
-Destroy Project: (SpyCultureChange)
-Destroy Building: SpyDestroyBuildingChange
-Destroy Improvement: SpyDestroyImprovementChange
-Disable Power mission fix (from Arachid)
-Remove maniupulated us from Memories
-GameOption for all memories
-Some AND text display changes
-Removed old promotion modifiers
 
Hello,

I'm totally new to modding, I just done some test for limited changes (new UU, adding a civ...) ; this mod (you know, super spies...) is the first one I try to install and it's harder than I thought!

I had unzip then copy all files in the Mod folder of BTS, or copy only the Assets, nothing seem to work... Each time I load the Mod nothing happens, I mean strictly nothing. Civ collapse, as it do when it load a mod, but there is no "progress bar" and it doesn't restart at all.

So I have a few questions :

1) Which folder I need to copy in the Mod folder?

2) Are they in correct order? (I seen a CivSomethingCore folder in BTS and an "alone" CivSomethingCore.dll in SuperSpies archive)

3) I haven't see the Civi.ini which is asked to modify (in Readme) but, after loading the mod, Civ have created a SuperSpies.ini in the dedicated folder, is it a correct way to make it work?

PS Sorry for my awful use of english.
 
1) make sure you don't have nested folders. It should look something like: B..t..S../Mods/Super Spies/Assets/etc. I have not dowloaded the mod so it might be called something else. The important thing is not to have two folders 'Super Spies' inside each other.

2) CvGameCoreDLL.dll (the one from the mod) should be under the Assets directory of the mod. The folder of BtS is just to present the core files included in the dll (compiled). The game doesn't read them actually.

3) It's one way to create it. It shouldn't be problematic in case of this mod, unless there are some modules in the mod, which I doubt.
 
2) CvGameCoreDLL.dll (the one from the mod) should be under the Assets directory of the mod.

Many thanks Isenchine, every things work perfectly! (Except that there is no french translation : when Civ open every word are blank... Time as come to really learn an other language!)
 
Hi stolenrays i have problem with this mod:

- I click on spy and click on Gather Intel button ( description:"This unit will gather intelligence and not awaken until it reaches the maximum espionage bonus" ), after that i get problem, i don't get message Press ENTER to end turn... , if i click on any unit i can't do nothing with that unit, only can click on green circle for end turn, which don't became red ( Red became when all is done and you are ready for next turn ).
IF i want to continue my game normal, i must press Pause/Break button on my keyboard, select spy which i am ordered Gather Intel and click on Cancel Last Mission, and press again Pause/Break button on keyboard to resume game, after that game continue normal without any problem.

Fix this or remove Gather Intel button.
 
I am found ERROR with CTD !

On first picture i am move my spy into rival fort.

1st:


after that i am choose to do espionage mission on this fort, 2nd picture.

2nd:


and BOOOM, ERROR, CTD, 3rd image:

3rd:


AUTHORS, CREATORS, MODDERS, PLEASE FIX THIS.
 
When i try to do a spy mission outside of a city the game crashes. I can do things in enemy citys but i cant destroy farms and things like that.
 
When i try to do a spy mission outside of a city the game crashes. I can do things in enemy citys but i cant destroy farms and things like that.

I am try to solve this few month ago, but i don't get any answer for same problem.
 
Top Bottom