View Full Version : [HOWTO] know if native village is visited?
espartaco Nov 10, 2008, 07:35 PM You are exploring with your scout, rush to get a treasure and then realize you just missed a native village so you go back and grrrrr...you have been there before. In the meantime, your rival scout is just going ahead of you to beat you to the next treasure....
Well, no more, just mouse over that village to know whether you have been there or not, not only you but any other non-native scout.
Add this piece of C++ code, compile and deploy your new core DLL:
1- Edit file CvGameTextMgr.cpp
2- find the method void CvGameTextMgr::setPlotHelp(CvWStringBuffer& szString, CvPlot* pPlot)
3- Scroll all the way down to the end of the method and copy and paste this block of statements just before the closing bracket:
// ESPARTACO: display scout visited on native city START
eRevealOwner = pPlot->getRevealedOwner(GC.getGameINLINE().getActiveTeam( ), true);
if(eRevealOwner != NO_PLAYER)
{
if(pPlot->isCity() && pPlot->getPlotCity() != NULL && pPlot->getPlotCity()->isNative())
{
szString.append(L"\n");
bool bVisited = false;
for(int iPlayer = 0; iPlayer < MAX_PLAYERS; iPlayer++)
{
CvPlayerAI& kLoopPlayer = GET_PLAYER((PlayerTypes)iPlayer);
if(kLoopPlayer.isAlive() && !kLoopPlayer.isNative())
{
if(pPlot->getPlotCity()->isScoutVisited((TeamTypes)iPlayer))
{
bVisited = true;
break;
}
}
}
if(bVisited)
{
szString.append(L"Already visited by Scout");
}
else
{
szString.append(L"Not yet visited by Scout");
}
}
}
// ESPARTACO: display scout visited on native city END
The preview doesn't show the proper line indentation, well, you know how to do it...
I didn't bother i18n'ing the strings "Already visited by Scout" and "Not yet visited by Scout" to avoid messing up this post, any modder would do it easily.
Two pictures before and after visiting a village:
Zuul Nov 10, 2008, 07:37 PM Good idea. :)
Use code tag instead :p.
espartaco Nov 10, 2008, 07:37 PM yes, the pictures....
espartaco Nov 10, 2008, 07:44 PM Good idea. :)
Use code tag instead :p.
thanks ZUUL, I din't know about the code tags.....:crazyeye:
Dale Nov 11, 2008, 12:05 PM Actually if the city bar shows a good and training unit, then you've visited it. If those are blank you haven't visited it.
But good idea. :)
TechnoMule Nov 11, 2008, 04:06 PM Yeah, it's pretty easy to see if you've visited. Once you visit it, you can see what they'll train you as. If it's blank, you haven't visited.
It's pretty clear to see, and you don't even have to mouse over it.
vsipinen Nov 12, 2008, 01:08 AM Yeah, it's pretty easy to see if you've visited. Once you visit it, you can see what they'll train you as. If it's blank, you haven't visited.
It's pretty clear to see, and you don't even have to mouse over it.
Wasn't the idea of that modification that you see also, whether a scout of some European rival has visited the village ?
TechnoMule Nov 12, 2008, 04:00 PM Wasn't the idea of that modification that you see also, whether a scout of some European rival has visited the village ?
No, that's cheating.
Onionsoilder Nov 12, 2008, 06:26 PM Yeah. While useful, how would you know someone else has been there without going there yourself? It's not like they fly a flag saying "Come visit us, we'll give you free stuff" then take it down when someone visits them...
vsipinen Nov 13, 2008, 12:58 AM No, that's cheating.
Yes, I suppose you are right. However I think that it was the original idea - at least according to the following quote: "... In the meantime, your rival scout is just going ahead of you to beat you to the next treasure....
Well, no more, just mouse over that village to know whether you have been there or not, not only you but any other non-native scout."
To me it seems to clearly indicate that also the visits of the rival's scout would be revealed.
espartaco Nov 13, 2008, 07:03 AM No, that's cheating.
If you take the time and read the code you would see that the computer keeps track of which villages have been visited. So you could do the same and write down in a piece of paper where have you been before.
Well, I modify the code to achieve the same results. The AI is not re-visiting villages and just keeps going looking for new opportunities. My point is to avoid wasting precious movements going back to the same place already visited by me or someone else.
At the end, the AI and the human player do have the same information on hand.
I like this change while playing my latest games, I have the tendency to miss a village since I prefer jumping to catch any treasure before going to the village. Very useful since I usually use two scouts to comb the map as fast as possible.
vsipinen Nov 13, 2008, 08:01 AM If you take the time and read the code you would see that the computer keeps track of which villages have been visited. So you could do the same and write down in a piece of paper where have you been before.
Well, I modify the code to achieve the same results. The AI is not re-visiting villages and just keeps going looking for new opportunities. My point is to avoid wasting precious movements going back to the same place already visited by me or someone else.
At the end, the AI and the human player do have the same information on hand.
I like this change while playing my latest games, I have the tendency to miss a village since I prefer jumping to catch any treasure before going to the village. Very useful since I usually use two scouts to comb the map as fast as possible.
But, does the modification reveal only information concerning visit of your own scouts - or also about visits of the scouts of the European rivals ?
espartaco Nov 13, 2008, 09:18 AM But, does the modification reveal only information concerning visit of your own scouts - or also about visits of the scouts of the European rivals ?
The info is about any scout visiting the village either your scout or you European rival. The current implementation does not remember who has been there.
Only the fact that a scout has visited that village.
The AI knows whether you have been there and you also know whether your rival has been there. So, it is a shared information, with no advantage to either side.
espartaco Nov 13, 2008, 11:39 AM The info is about any scout visiting the village either your scout or you European rival. The current implementation does not remember who has been there.
Only the fact that a scout has visited that village.
The AI knows whether you have been there and you also know whether your rival has been there. So, it is a shared information, with no advantage to either side.
See by yourself: the AI will try to "talk to the chief", in other words, to be ahead of you to get the reward:
file CvUnitAI.cppm, method CvUnitAI::AI_scoutMove():
if (!pCity->isScoutVisited(getTeam()))
{
if (canSpeakWithChief(plot()))
{
speakWithChief();
FAssert(pCity->isScoutVisited(getTeam()));
return;
}
}
Dale Nov 13, 2008, 12:08 PM Actually no, that code only makes the AI talk to the chief if no one has already talked to the chief, when the scout is already there.
It doesn't make the AI prioritise the city higher, move quicker to the city, or anything else. The AI scout already has to be there. It's not trying to get there first.
|
|