Bug Reports

Yeah, I saw that XML entry, so I figured other something was broken or removed from the SDK, or you had added something in the SDk that just over rode it.

Is this controlled by just one file in the SDK, or is it spread out over several files? I know how to compile SDk and have made some changes in the past, as well as modcomp merging, but always civ4, and I still don't 'really' understand what I am doing, but sometimes 'poop is magical', or a Wizard uses some of theirs! :D

The Code is below. And for example if you removed the parts in blue it should allow the Silk Road to be a land or sea route.
Spoiler :

bool CvUnit::canCrossOcean(const CvPlot* pPlot, UnitTravelStates eNewState, TradeRouteTypes eTradeRouteType, bool bAIForce) const
{
if (getTransportUnit() != NULL)
{
return false;
}


if (m_pUnitInfo->isPreventTraveling())
{
return false;
}


if (getUnitTravelState() == NO_UNIT_TRAVEL_STATE && !canMove())
{
return false;
}

switch (getUnitTravelState())
{
case NO_UNIT_TRAVEL_STATE:
if (eNewState != UNIT_TRAVEL_STATE_TO_EUROPE)
{
if (eNewState != UNIT_TRAVEL_STATE_TO_SPICE_ROUTE)
{
if (eNewState != UNIT_TRAVEL_STATE_TO_SILK_ROAD)
{
if (eNewState != UNIT_TRAVEL_STATE_TO_TRADE_FAIR)
{
return false;
}
}
}
}
if (eNewState == UNIT_TRAVEL_STATE_TO_SPICE_ROUTE)
{
if (getDomainType() != DOMAIN_SEA)
{
return false;
}
if (!GET_PLAYER(getOwnerINLINE()).getHasTradeRouteType(TRADE_ROUTE_SPICE_ROUTE))
{
return false;
}
if (pPlot->isEurope())
{
//EuropeTypes eEurope = (EuropeTypes)pPlot->getEurope();
if (GC.getEuropeInfo(pPlot->getEurope()).getTradeScreensValid(TRADE_SCREEN_SPICE_ROUTE))
{
return true;
}
}

return false;
}
else if (eNewState == UNIT_TRAVEL_STATE_TO_SILK_ROAD)
{
if (getDomainType() != DOMAIN_LAND)
{
return false;
}

if (!GET_PLAYER(getOwnerINLINE()).getHasTradeRouteType(TRADE_ROUTE_SILK_ROAD))
{
return false;
}
//EuropeTypes eEurope = (EuropeTypes)pPlot->getEurope();
if (pPlot->isEurope())
{
if (GC.getEuropeInfo(pPlot->getEurope()).getTradeScreensValid(TRADE_SCREEN_SILK_ROAD))
{
return true;
}
}

if (!isHuman() && bAIForce)
{
CvCity* pCity = plot()->getPlotCity();
if (pCity != NULL)
{
// if (pCity->isNative())
// {
// return false;
// }

if (pCity->getOwner() != getOwner())
{
return true;
}

}
}

return false;


}
else if (eNewState == UNIT_TRAVEL_STATE_TO_TRADE_FAIR)
{
if (getDomainType() != DOMAIN_LAND)
{
return false;
}

if (!GET_PLAYER(getOwnerINLINE()).getHasTradeRouteType(TRADE_ROUTE_FAIR))
{
return false;
}

}
if (!GET_PLAYER(getOwnerINLINE()).canTradeWithEurope())
{
return false;
}
break;
case UNIT_TRAVEL_STATE_IN_EUROPE:
if (eNewState != UNIT_TRAVEL_STATE_FROM_EUROPE)
{
return false;
}
break;
case UNIT_TRAVEL_STATE_IN_SPICE_ROUTE:
if (eNewState == UNIT_TRAVEL_STATE_FROM_SPICE_ROUTE)
{
return true;
}

break;
case UNIT_TRAVEL_STATE_IN_SILK_ROAD:
if (eNewState == UNIT_TRAVEL_STATE_FROM_SILK_ROAD)
{
return true;
}
break;
case UNIT_TRAVEL_STATE_IN_TRADE_FAIR:
if (eNewState == UNIT_TRAVEL_STATE_FROM_TRADE_FAIR)
{
return true;
}
break;
default:
FAssertMsg(false, "Invalid trip");
return false;
break;
}

if(isHuman() && !GC.getCivilizationInfo(getCivilizationType()).isWaterStart() && (eTradeRouteType == TRADE_ROUTE_FAIR))
{

if (getDomainType() != DOMAIN_LAND)
{
return false;
}


if (cargoSpace() <= 0)
{
return false;
}

if (!plot()->isCity() && getUnitTravelState() == NO_UNIT_TRAVEL_STATE)
{
return false;
}

CvCity* pCity = plot()->getPlotCity();
if (pCity != NULL)
{
if (pCity->isNative())
{
return false;
}
if (pCity->getOwner() != getOwner())
{
return false;
}
else
{
if (GC.getXMLval(XML_CHEAT_TRAVEL_ALL))
{
return true;
}
// if (eTradeRouteType == TRADE_ROUTE_FAIR)
// {
// BuildingClassTypes eIndex = (BuildingClassTypes)GC.getDefineINT("BUILDINGCLASS_TRAVEL_TO_FAIR");
// BuildingTypes eBuilding = (BuildingTypes) GC.getCivilizationInfo(GET_PLAYER(getOwnerINLINE()).getCivilizationType()).getCivilizationBuildings(eIndex);
// if(eBuilding == NO_BUILDING)
// {
// return false;
// }
//
// if (pCity->isHasConceptualBuilding(eBuilding))
// {
// return true;
// }
// }

}

}

return true;
}
///TKe

FAssert(pPlot != NULL);
if (!pPlot->isEurope())
{
return false;
}

return true;
}
 
Nice, what file is this in?

I think I could have all kinds of tweaker fun with that!

Where is the North South East West Referenced? For Example spice route is only east/west how is that defined, so I could set a different Trade screen for North South East and West. Also is there a way to add more than 4 'paint zones'? So you could in essence cover your map in all different places with different paint zones.
 
Nice, what file is this in?

I think I could have all kinds of tweaker fun with that!

Where is the North South East West Referenced? For Example spice route is only east/west how is that defined, so I could set a different Trade screen for North South East and West. Also is there a way to add more than 4 'paint zones'? So you could in essence cover your map in all different places with different paint zones.

You can tell what file its in by the bool CvUnit:: part, its the CvUnit.cpp file. The CIV4EuropeInfo.xml contains the relevent info. Currently it is not modder friendly to add new Europe tiles. You can add them but there would be nothing coded to tell what the new tiles do. This could be changed at some point however.
 
Ok, here is a save from my game, I have two vassals in the south of my kingdom, the one in the centre has a tax collector (all good) the one on the left won't take one, you should be able to 'borrow' a person from the monastery next door, to test. Sorry I didn't have a save with a taxman there already..

I think I am following the rules, unless I have missed something, like I said the first one worked fine and I just repeated the process for the second..

Ok, I see the problem. Walata's Vassal Lord is the AI controlled "Vassal Lord" instead of the Normans. Do you recall how you come by these two vassals? Something went wrong in the exchange of Walata and the Normans were not assigned it's Vassal. Sorry it took so long to look at this.
 
No problem, no not really, I think I may have got them both on the same turn though.. i remember having none and then two came along at once.. bit like buses! They were both cultural offers though I think..
I just fixed a bug related to indians giving settlements in RaR. While investigating this I noticed the very same behavior. For long times no offers and then boom, they offer multiple settlements in one turn. Even more interesting the affected game was a multiplayer game and the "rush turn" made them offer settlements to both players. I wonder if there is something in the vanilla AI code which makes the AI collect such events.
 
Btw, I can't compile Medieval Debug Dll... it gives linker error: error LNK2001: unresolved external symbol __imp___InterlockedExchange@8 CySelectionGroupInterface.obj

Release - fast does compile with jom, but I don't really want to attempt create new features without debug. Any ideas?

e: I use Visual Studio 2013, Windows 8
 
Whenever an object file has an unresolved link, it is often caused by one of the other object files being out of date. The makefile should have detected this and recompiled. Try to clean your debug build before compiling.

However there is one thing which worries me. InterlockedExchange isn't mentioned in our source. This could be an indication that the makefile/DLL isn't compatible with your system. I use Windows xp and 7 with Visual C++ 2010 where it compiles just fine. I never tested this on Windows 8 or VS 2013.

Before somebody mentions XP being a safety hazard going out of support by MS. It lives it life inside a virtual machine without internet connection and is used for network gaming testing. It isn't like I still use it as a primary OS. However that doesn't change the fact that it is able to compile just fine. Hey that could be the answer if Windows 8 is unable to debug the DLL. XP in virtual machines.
 
Awesome, Nightinggale is back, but I guess you never really left just wasn't getting informed of all the action:) However, I was starting to panic. For some reason all of a sudden I am having troubles compiling also. It seems I was compiling just fine before but now I am getting this error below. I compiled once with this error but it didn't stop the compile but the second time it does. It seems each build, Assert, Debug, Release, lets me build it once but then I get the error. That's all I know at the moment...

Code:
1>  The process cannot access the file because it is being used by another process.
1>  Error running fastdep.
1>  Debug-fast causes this issue if Debug or Debug-fast has never been compiled before.
1>  It is safe to ignore this error in that case, but only in that case!
1>makefile(279): fatal error U1052: file 'temp_files\Debug\depends' not found
1>  Stop.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command "set TARGET=Debug
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error MSB3073: nmake dll" exited with code 2.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
 
makefile(279): fatal error U1052: file 'temp_files\Debug\depends' not found
The makefile is supposed to make this directory if it is missing. A simple workaround is to make it manually.

I work in the directory in My Documents. There could be permission problems in the programs directory which prevents the makefile from creating this directory. After all it's a "script" with no special permissions trying to generate files and directories. Windows will not allow this everywhere due to risk of malware.
 
The makefile is supposed to make this directory if it is missing. A simple workaround is to make it manually.

I work in the directory in My Documents. There could be permission problems in the programs directory which prevents the makefile from creating this directory. After all it's a "script" with no special permissions trying to generate files and directories. Windows will not allow this everywhere due to risk of malware.

It does make it. I work in My Documents also and never had a problem with permissions. After redownloading Medieval_Tech I run Debug and it creates three folders, Debug, obj, and temp_files. The first time I run it I get this message..

Code:
 The system cannot find the path specified.
1>  The system cannot find the path specified.
1>  Error running fastdep.
1>  Debug-fast causes this issue if Debug or Debug-fast has never been compiled before.
1>  It is safe to ignore this error in that case, but only in that case!

The second time I build it just hangs up and I have to cancel it. It also creates a cmd.exe program that I can not manually shut down. Then the next time I try it gives the error I posted earlier saying that the cmd.exe is using the file. All I can do is restart my PC to kill the cmd.exe program. If I then delete those three files it created I can build again. Also, when it hangs up a dos shell flashes on the screen for a second then vanishes. I've been trying to capture a screen shot of it to see what it says but haven't been able to yet.
 
Try to open cmd.exe and then cd into DLL_sources.
Write the following
Code:
set TARGET=Debug
nmake dll
This way the dos window will not disappear. I just tried it and it started compiling, but then it complained about not finding sal.h. Clearly there is a path problem, but I think it will reveal your problem before encountering problems resolving included header files.
 
Try to open cmd.exe and then cd into DLL_sources.
Write the following
Code:
set TARGET=Debug
nmake dll
This way the dos window will not disappear. I just tried it and it started compiling, but then it complained about not finding sal.h. Clearly there is a path problem, but I think it will reveal your problem before encountering problems resolving included header files.

Grrr, my windows 8 does not have an nmake. Like moma says, it's always something!

Edit: I opened a Visual Studio Command Prompt and run the nmake from there. It flased another cmd.exe screen as before, then hung up. When I try it again I get the same error as above...grr!
 
In case I can't figure this out quickly is there anything inherently wrong with deleting those three folders each time before I build?
YES. It is very wrong that you write code, but can't figure out how to solve a problem like this :lol::p

Apart from that the only sideeffect from deleting the temp files and directories is that you do a complete recompile each time meaning you compile slower. If you do that, then you will end up loving jom even more than you already do.
 
YES. It is very wrong that you write code, but can't figure out how to solve a problem like this :lol::p

Haha, funny guy. Technically I don't write code, I copy and paste and sling poo. The whole universe was created in chaos so it stands to reason I could do a little coding:) Ok, hopefully I can get it worked out.
 
Back
Top Bottom