Advertisement
Civilization Fanatics' Center  

Welcome to Civilization Fanatics' Center.

You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support.

Go Back   Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Civ4 - Mod Components

Notices

Reply
 
Thread Tools
Old Jun 11, 2012, 06:57 PM   #1
Lemon Merchant
Disarmingly Charming
 
Lemon Merchant's Avatar
 
Join Date: Jun 2008
Location: Red Sector A
Posts: 3,235
Images: 2
Civ4 BTS Lemon's Spy Mod

Tired of having your spies have to trek back to your capital? Are they grumbling from being so tired after traveling though your massive empire? Ever wish that they would just return to the nearest city that you own?

Well, now they can!

This is an SDK/XML mod that creates a game option that allows spies to return to the nearest player city, instead of going all the way back to the capital. It's pretty simple, straightforward, and is made for merging. Read the included text file and you should be fine.

Note that the only the changed files are included.

You can find the download here: http://forums.civfanatics.com/downlo...=file&id=19414

I must thank Afforess for showing us all how to do this.
Lemon Merchant is offline   Reply With Quote
Old Jun 19, 2012, 03:35 PM   #2
lymond
Synthetic Life Form
 
lymond's Avatar
 
Join Date: Mar 2008
Posts: 10,588
Quote:
Originally Posted by Lemon Merchant View Post
Are they grumbling from being so tired after traveling though your massive empire?
Well, they are female
__________________
"Read, every day, something no one else is reading. Think, every day, something no one else is thinking. Do, every day, something no one else would be silly enough to do. It is bad for the mind to be always part of unanimity." Christopher Morley

lymond's YouTube Channel - Watch me play Civ4 poorly

CFC GameOftheMonth(GOTM) Page - why are you not playing these ?
lymond is offline   Reply With Quote
Old Jun 20, 2012, 02:59 AM   #3
Lemon Merchant
Disarmingly Charming
 
Lemon Merchant's Avatar
 
Join Date: Jun 2008
Location: Red Sector A
Posts: 3,235
Images: 2
♫ Someone's getting a beating... ♪

Lemon Merchant is offline   Reply With Quote
Old Jun 23, 2012, 04:44 AM   #4
Lemon Merchant
Disarmingly Charming
 
Lemon Merchant's Avatar
 
Join Date: Jun 2008
Location: Red Sector A
Posts: 3,235
Images: 2
I noticed that there are 22 downloads, so far. Is anyone using this yet? Is it working correctly? I only had one machine to test it on this time, so I'm hoping that there are no issues.
Lemon Merchant is offline   Reply With Quote
Old Jun 26, 2012, 05:15 PM   #5
Jennvare
Prince
 
Join Date: Jan 2010
Posts: 333
If there was anything more I can ask for, it's chance for a spy to fail a mission, but still come out alive. There's nothing like losing a well experience spy for one failed mission. It's a big reason why I rarely use them. Atleast with high experienced units, they can have other units protect them when they are weakened or protect them with other units when attacked. You dont get that option with spies. It's either they live or they die.
Jennvare is offline   Reply With Quote
Old Jun 27, 2012, 02:41 AM   #7
Lemon Merchant
Disarmingly Charming
 
Lemon Merchant's Avatar
 
Join Date: Jun 2008
Location: Red Sector A
Posts: 3,235
Images: 2
Quote:
Originally Posted by Jennvare View Post
If there was anything more I can ask for, it's chance for a spy to fail a mission, but still come out alive. There's nothing like losing a well experience spy for one failed mission. It's a big reason why I rarely use them. Atleast with high experienced units, they can have other units protect them when they are weakened or protect them with other units when attacked. You dont get that option with spies. It's either they live or they die.
I like that idea. I had originally written this for BAT, so I left out anything really game changing like that, but maybe I'll take another looksie at the code and see if I can pull it off.

Quote:
Originally Posted by stolenrays View Post
When I get a chance, I'm going to merge this with super spies.
Please do.
Lemon Merchant is offline   Reply With Quote
Old Jun 27, 2012, 11:57 AM   #8
stolenrays
Emperor
 
stolenrays's Avatar
 
Join Date: Aug 2009
Posts: 1,662
I found something else as well, that is similar to this modcomp. Afforess has coded in ROM: AND to have spies that perform missions outside of cities to not escape to the nearest city.
stolenrays is offline   Reply With Quote
Old Jun 27, 2012, 02:52 PM   #9
stolenrays
Emperor
 
stolenrays's Avatar
 
Join Date: Aug 2009
Posts: 1,662
I'm testing it out now. I found one thing I think you need to comment in CvUnit.cpp (I gave you a sample comment):

Spoiler:
Code:
bool CvUnit::espionage(EspionageMissionTypes eMission, int iData)
{
/********************************************************************************
*																				*
*	Lemon's Spy Mod  - Lemon Merchant - 05/31/12								*
*																				*
*	Begin					*
*																				*
********************************************************************************/
	bool Spync = false;
// Lemon's Spy Mod End
	if (!canEspionage(plot()))
	{
		return false;
	}


Cvplot and CvUnit are not needed for vanilla BTS.
stolenrays is offline   Reply With Quote
Old Jun 30, 2012, 05:53 AM   #10
Lemon Merchant
Disarmingly Charming
 
Lemon Merchant's Avatar
 
Join Date: Jun 2008
Location: Red Sector A
Posts: 3,235
Images: 2
Quote:
Originally Posted by stolenrays View Post
I'm testing it out now. I found one thing I think you need to comment in CvUnit.cpp (I gave you a sample comment):

Spoiler:
Code:
bool CvUnit::espionage(EspionageMissionTypes eMission, int iData)
{
/********************************************************************************
*                                                                                *
*    Lemon's Spy Mod  - Lemon Merchant - 05/31/12                                *
*                                                                                *
*    Begin                    *
*                                                                                *
********************************************************************************/
    bool Spync = false;
// Lemon's Spy Mod End
    if (!canEspionage(plot()))
    {
        return false;
    }


Cvplot and CvUnit are not needed for vanilla BTS.
Yes, you're right. I had originally put those lines in because VS2010 kept barking at me when I left them out, and the DLL wouldn't compile. Now I can leave them out and it doesn't, which is very weird.

So it is safe to comment out the two lines that you have indicated.
Lemon Merchant is offline   Reply With Quote
Old Jul 03, 2012, 08:30 AM   #11
Cruel
King
 
Cruel's Avatar
 
Join Date: Jun 2005
Location: São Paulo, Brazil
Posts: 634
__________________
A Big Fan and Team´s Member of Realism: Invictus

[ SVN | Download | CFC Forum | Manual ]

Do you like RI and want to help? Talk to a member of our team!
Cruel is offline   Reply With Quote
Old Jul 04, 2012, 02:17 AM   #12
Lemon Merchant
Disarmingly Charming
 
Lemon Merchant's Avatar
 
Join Date: Jun 2008
Location: Red Sector A
Posts: 3,235
Images: 2
Quote:
Originally Posted by Cruel View Post
I'm very flattered. Thank you!
Lemon Merchant is offline   Reply With Quote
Old Jul 06, 2012, 11:17 AM   #13
stolenrays
Emperor
 
stolenrays's Avatar
 
Join Date: Aug 2009
Posts: 1,662
Lemon, please take a look at the following code block. I can successfully merge your mod into super spies, but it seems as though the afforess mod disables super spies no matter as it is. Afforess's mod makes spies stay put after completing missions outside of cities.

Spoiler:
Code:
/********************************************************************************
*																				*
*	Lemon's Spy Mod  - Lemon Merchant - 05/31/12								*
*																				*
*	Spies return to nearest player city, rather than capital					*
*																				*
********************************************************************************/
// Begin new code				
				if (Spync)   // (LM) if the return to nearest city is selected in options return to nearest city
				{
					CvCity* pNearestCity = GC.getMapINLINE().findCity(getX_INLINE(), getY_INLINE(), getOwnerINLINE(), NO_TEAM, true, false, NO_TEAM, NO_DIRECTION );

					if (pNearestCity != NULL)
					{
						setXY(pNearestCity->getX_INLINE(), pNearestCity->getY_INLINE(), false, false, false);

						CvWString szBuffer = gDLL->getText("TXT_KEY_ESPIONAGE_SPY_SUCCESS", getNameKey(), pNearestCity->getNameKey());
						gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), true, GC.getEVENT_MESSAGE_TIME(), szBuffer, "AS2D_POSITIVE_DINK", MESSAGE_TYPE_INFO, getButton(), (ColorTypes)GC.getInfoTypeForString("COLOR_WHITE"), pNearestCity->getX_INLINE(), pNearestCity->getY_INLINE(), true, true);
					}

				}
				else  // (LM) return to capital if option not selected
				{
					CvCity* pCapital = GET_PLAYER(getOwnerINLINE()).getCapitalCity();
/************************************************************************************************/
/* Afforess	                  Start		 07/12/10                                               */
/*                                                                                              */
/*Spy actions that aren't in a city don't cause the spy to be sent back                         */
/************************************************************************************************/
					if (!plot()->isCity())
					{
						pCapital = NULL;
					}
/************************************************************************************************/
/* Afforess	                     END                                                            */
/************************************************************************************************/
					if (NULL != pCapital)
					{
						setXY(pCapital->getX_INLINE(), pCapital->getY_INLINE(), false, false, false);

						CvWString szBuffer = gDLL->getText("TXT_KEY_ESPIONAGE_SPY_SUCCESS", getNameKey(), pCapital->getNameKey());
						gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), true, GC.getEVENT_MESSAGE_TIME(), szBuffer, "AS2D_POSITIVE_DINK", MESSAGE_TYPE_INFO, getButton(), (ColorTypes)GC.getInfoTypeForString("COLOR_WHITE"), pCapital->getX_INLINE(), pCapital->getY_INLINE(), true, true);
					}
					//TSHEEP Give spies xp for successful missions
					awardSpyExperience(GET_PLAYER(eTargetPlayer).getTeam(),GC.getEspionageMissionInfo(eMission).getDifficultyMod());
					//TSHEEP end
				}

			}
//	End new code
stolenrays is offline   Reply With Quote
Old Jul 08, 2012, 09:51 AM   #14
Lemon Merchant
Disarmingly Charming
 
Lemon Merchant's Avatar
 
Join Date: Jun 2008
Location: Red Sector A
Posts: 3,235
Images: 2
I had a couple of questions, but I saw in another thread that you may have fixed this?
Lemon Merchant is offline   Reply With Quote
Old Jul 08, 2012, 10:26 AM   #15
stolenrays
Emperor
 
stolenrays's Avatar
 
Join Date: Aug 2009
Posts: 1,662
Yes, I was able to successfully merge it with Afforess's Mod & Super Spies. It just took a lot of if/else statements & adding AwardSpyExperience to all of them.
stolenrays is offline   Reply With Quote
Old Jul 08, 2012, 12:09 PM   #16
Lemon Merchant
Disarmingly Charming
 
Lemon Merchant's Avatar
 
Join Date: Jun 2008
Location: Red Sector A
Posts: 3,235
Images: 2
Oh good. I was preoccupied with r/l for a bit and couldn't post as soon as I would have liked. I'm glad you got it to work.
Lemon Merchant is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Civ4 - Mod Components > [SDK] Lemon's Spy Mod

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Advertisement

All times are GMT -6. The time now is 09:50 PM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
This site is copyright © Civilization Fanatics' Center.
Support CFC: Amazon.com | Amazon UK | Amazon DE | Amazon CA | Amazon FR