Super Spies (BTS 3.19)

I was looking at the RevDCM sources and found that there are some improvements on super spies. I merged them and fixed the assadination CTD. It now properly targets a settled Great Person in a city.

The bribe worker mission now works as well. They'll be in the next release.
 
New version is almost finished. Some of the promotion tags overlapped for DuneWars/ROM:AND so I had to add some abilities to other tags. Missions are working, promos work, everything looks fine.

I did not merge the sabotage unit mission and the steal water mission. The sabotage Unit can destroy a unitcombat type and the steal water mission basically steals food from a city. I think it would just be horrible to have a heavily promoted unit wiped out by a spy. I though that the water mission had to do with water & not food, so I did not ad it.

Some of the DuneWars missions function by adding an invisible building for a few turns. There is a Semuta Den mission, which I renamed Den of Spies. It had babylon gardens for a building, which I changed to the PsyOps Center from Next War.

I'm making some new promotion art for the new promotions based on the Dune Wars Buttons. Only thing I can't get to work so far is the Nuke Mission.
 
Everything has been merged. Two things are still not working correctly. I can't figure out how to trigger the Nuke mission and the create buildings missions don't disapear after you sucessfully complete them. Not sure what the problem is.

Edit: NEver Mind. This is a bug from Dune Wars, not code transcribing.
 
You should be able to steal techs using spies, as well as bribing great people with about 55% success rate at best.
 
You can steal techs, but bribing great people? Haven't done that one yet. I have a feeling many wouldn't like that b/c of negative gameplay. Some might though.

@Lemon I've attached my C++ Changed files for the Spy interogation merge from Total War. I haven't commented it out as such, but all you have to do is search for Prisoner or Torture to find it all. I get a CTD on turn two when checking for isAlive from CvUnit: isPrisoner(). If you need the working mod or have any ideas let me know.:)
 

Attachments

  • Interogation C++.7z
    448.8 KB · Views: 102
I don't have all the code for your DLL, but I did come up with a slight change. At least VS2010 stopped barking at me when I wrote it. ;)

My changed items are in bold:

Code:
void CvUnit::doTurn()
{
	PROFILE("CvUnit::doTurn()")

	FAssertMsg(!isDead(), "isDead did not return false as expected");
	FAssertMsg(getGroup() != NULL, "getGroup() is not expected to be equal with NULL");

	[B]PlayerTypes eOrigOwner;[/B]

	testPromotionReady();

	[B]eOrigOwner = getOriginalOwner()[/B];
	
	if (isPrisoner())
	{
		[B]if (!GET_PLAYER(eOrigOwner).isAlive())[/B]
		{
			setOriginalOwner(NO_PLAYER);
		}
	}

By defining eOrigOwner as a player type, you aren't putting a method into the parameter list of a method, and you're effectively casting eOrigOwner to be a player type, which is what GET_PLAYER expects.

This probably won't work, but maybe it will help you to think of something that will. I'm not the biggest C++ genius (C# is more my forte), but I'll keep digging.
 
I added a isSpy check to that function and also added some of your checks/changes to some other things. It helped, but I still got a crash somewhere later.

I played the Total War Mod. Spes have a 25% chance to be captured, otherwise they disapear and display a killed message. When the spy is caught doing the mission it becomes your own unit. There is then a Mission (Command) button to interrogate the spy to get additional espionage points. Additionally you can have the spy perform missions for you or gift it back to its owner.

I'm pretty sure you can't trade it via diplomacy.
 
I added a isSpy check to that function and also added some of your checks/changes to some other things. It helped, but I still got a crash somewhere later.
Well, a crash somewhere else is a positive step right? :mischief:

Seriously, though, have you figured out where in the code that it's crashing?
 
Haven't debuged it yet. Will though. I also thought of something. I think that a captured spy should always yield some intel. I'm going to try and merge some of the yield from combat mod for that. So then, I can take out the interogate part because why would you need to interogate the spy if they become a double agent anyway? Wouldn't double agents already be giving you intel?

In addition, I think that the spy should be a double agent still though with the reduced espionage costs. I don't think it is wise to return a spy so I may take that code out as well. I don't see that happening unless it happened in a prisoner exchange, but that needs diplomacy. I don't feel like doing that. :)
 
Hmm. I'm still getting a CTD when it checks .isAlive() in CvUnit.cpp. Now, the CTD only happens when a spy is performing a mission. What do you think Lemon?

Code:
bool CvPlayer::isAlive() const
{
	return m_bAlive;
}

In addition, I took out the torture/interrogation code. I can always add that back in later.
 
Hmm. I'm still getting a CTD when it checks .isAlive() in CvUnit.cpp. Now, the CTD only happens when a spy is performing a mission. What do you think Lemon?
Are you getting any exception messages?

Have you added to/changed the Python for the spy missions in any way? Or anything related to isAlive() in Python? The problem may not be in the SDK.

Just looking at all the possibilities.
 
Are you getting any exception messages?

Have you added to/changed the Python for the spy missions in any way? Or anything related to isAlive() in Python? The problem may not be in the SDK.

Just looking at all the possibilities.

So, I tested it out. No python exceptions. I've deleted the interrogation code temporaily in an attempt to simplify things. isPrisoner is added to a few .cpp/.h files, but mostly just a check so as not to lead by warlord and such. Here are the main functions I found.
Spoiler :

Code:
void CvUnit::doTurn()
{
	PROFILE("CvUnit::doTurn()")

	FAssertMsg(!isDead(), "isDead did not return false as expected");
	FAssertMsg(getGroup() != NULL, "getGroup() is not expected to be equal with NULL");

	testPromotionReady();
	
	PlayerTypes eOriginalOwner;
	eOriginalOwner = getOriginalOwner();

	if (isSpy())
	{
		if (isPrisoner())
		{
			if (!GET_PLAYER(eOriginalOwner).isAlive())
			{
				setOriginalOwner(NO_PLAYER);
			}
		}
	}

Code:
bool CvUnit::isPrisoner() const
{
	PlayerTypes eOriginalOwner;
	eOriginalOwner = getOriginalOwner();

	if (eOriginalOwner == NO_PLAYER)
	{
		return false;
	}
	else
	{
		if (eOriginalOwner != getOwnerINLINE())
		{
			if (GET_PLAYER(eOriginalOwner).isAlive())
			{
				return true;
			}
		}
	}
	return false;
}
 
I'm puzzled.

GET_PLAYER() expects an integer as an argument (the player's integer number), and isAlive() is a Boolean. It sounds like whatever is being passed to GET_PLAYER() is either out of range (i.e. no valid player integer) or completely invalid, so the test for isAlive() is failing with spectacular results.

I looked at GET_PLAYER() in a couple of other places, and they usually use a cast inside the method call. In your code, it would look like this:

Code:
if (!GET_PLAYER([B][COLOR="Red"](PlayerTypes)[/COLOR][/B] eOrigOwner).isAlive())
		{
			setOriginalOwner(NO_PLAYER);
		}

I don't know if that would help, as eOrigOwner is already cast to PlayerTypes, but sillier things have happened...

I'll keep looking.
 
Hello to everyone!

This is my first absolute post in civfanatics and of course it is related to spies...
I am relative new to civ4, but one of my preferred way to play it is through the concept expressed in this post:

http://www.civfanatics.com/civ4/strategy/suleiman_espionage.php

.. and of course with this mod!

While playing I have noticed a tedious issue with the 'Gather Intel' automation which provoke a loss of focus when selecting a unit if:

  1. At least one spy is currently in 'Gather Intel'
  2. All other units have finished their actions
  3. You want to select a fortified unit

Then, after 1 second the selected unit is automatically deselected.

I did not see any post complaining about this in the forum, so I was wandering if someone else is experiencing this anomaly.
After a comparison between the Super Spies 1.8 sources and the original Advanced Automation patch (I assume) provided by Afforess at this link, I have managed to come up with these (possibly) missing lines of codes:

Code:
--- CvSelectionGroupOriginal.cpp	2012-08-19 03:33:59.000000000 +0200
+++ CvSelectionGroup.cpp	2013-04-30 12:09:33.048757321 +0200
@@ -1178,7 +1178,8 @@
 /* Advanced Automations                                                                         */
 /************************************************************************************************/
 		case MISSION_ESPIONAGE_SLEEP:
-
+			bDelete = true;
+			break;
 /************************************************************************************************/
 /* Afforess	                     END                                                            */
 /************************************************************************************************/


I try to recompile the DLL introducing the following modification and eventually this anomaly was not anymore present.

In attachment I have provided the modified DLL, in case it is helpfull for someone else.
Thanks again for this wonderfull mod!
 

Attachments

  • CvGameCoreDLL.dll.7z
    1.1 MB · Views: 107
Top Bottom