Modmodding Q&A Thread

First of all, everything you change in CvRhyes.cpp requires the DLL to be recompiled for the changes to take effect.

For the actual edits I use OpenOffice Calc. Just copy an entire settler map and use "insert unformatted data". Selecting the tabulator as cell separator should give you the map as a table that corresponds to the grid. If you're done with editing, just select the entire table and paste it back over the still selected map in the source file.

Edit: crosspost with srpt.
 
What's the difference between adding a new civ and adding a respawn civ?

The only things I need to change are capital location, stability areas, UHV, and UP, besides adding in the civ as normal? Do I need to make a new Settler map? How much of the old civ's stuff are used? The city name map is based on language, not civilization, right?

Sorry about all of the questions.
 
You can change as much as you want. If you don't change anything, the respawn will be the same as the civ it is based on in terms of stability regions and so on.
 
You can change as much as you want. If you don't change anything, the respawn will be the same as the civ it is based on in terms of stability regions and so on.

For the settler/war maps, is there a separate list for respawns?
 
Every civ appears twice in the settler/war maps, the second entry is for their respawn.
 
Excuse me?
I really hope to add a new terrain to DoC called "channel".
that allow land unit and ships to cross, like the English channel between England and France. So many battles in history could happen, like 1066 Norman Conquest.( because AI can't attact from the sea with massive land units effectively)
but I don't know how, Do you know how to add ?Thanks!

(If adding channel is not possibe, how to edit the existing terrain "coast" to allow the water area between England and France passible ?
Or, if this method is impossible, Is it possible to allow land units to embark like they did in CIV 5? )

:confused:
 
<ImprovementInfo>
<Type>IMPROVEMENT_CHANNEL</Type>
<Description>TXT_KEY_IMPROVEMENT_CHANNEL</Description>
<Civilopedia>TXT_KEY_IMPROVEMENT_FORT_PEDIA</Civilopedia>
<ArtDefineTag>ART_DEF_IMPROVEMENT_FORT</ArtDefineTag>
<YieldChanges/>
<bActsAsCity>1</bActsAsCity>
<bHillsMakesValid>0</bHillsMakesValid>
<bFreshWaterMakesValid>0</bFreshWaterMakesValid>
<bRiverSideMakesValid>0</bRiverSideMakesValid>
<bNoFreshWater>0</bNoFreshWater>
<bRequiresFlatlands>0</bRequiresFlatlands>
<bRequiresRiverSide>0</bRequiresRiverSide>
<bRequiresIrrigation>0</bRequiresIrrigation>
<bCarriesIrrigation>0</bCarriesIrrigation>
<bRequiresFeature>0</bRequiresFeature>
<bWater>1</bWater>
<bGoody>0</bGoody>
<bPermanent>1</bPermanent>
<bUseLSystem>1</bUseLSystem>
<iAdvancedStartCost>60</iAdvancedStartCost>
<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
<iTilesPerGoody>0</iTilesPerGoody>
<iGoodyRange>0</iGoodyRange>
<iFeatureGrowth>0</iFeatureGrowth>
<iUpgradeTime>0</iUpgradeTime>
<iAirBombDefense>20</iAirBombDefense>
<iDefenseModifier>0</iDefenseModifier>
<iHappiness>0</iHappiness>
<iPillageGold>0</iPillageGold>
<bOutsideBorders>1</bOutsideBorders>
<TerrainMakesValids>
<TerrainMakesValid>
<TerrainType>TERRAIN_COAST</TerrainType>
<bMakesValid>1</bMakesValid>
</TerrainMakesValid>
........
<bGraphicalOnly>0</bGraphicalOnly>
</ImprovementInfo>
I want to add a new improvement called " channel" . (it couldn't be build by workers or work boats during the game, just like a fort, it is just a way to allow ships and land units to path, it should be placed into the public map before game starts)
How to edit the line"<ArtDefineTag>ART_DEF_IMPROVEMENT_FORT</ArtDefineTag>"?
I want this "channel" to have the art of a normal coast, but If I put "ART_DEF_TERRAIN_COAST" in to it, The game will crash.
I really don't know how to edit it. :crazyeye:
 
You can only use art that is defined in CIV4ArtDefines_Improvements.xml. As ART_DEF_TERRAIN_COAST isn't defined in that file, it will crash. (The code it is looking for is in a different file.

Unfortunately, just copying the code from the CIV4ArtDefines_Terrain to the CIV4ArtDefines_Improvements wont work, as both files are structured differently.

I suggest this:
- Create a new terrain type in TerrainInfos.xml.
- Make sure it a land tile (<Water>0</bWater>) with the art of the coast.
(This will make the the tile type count as a land tile, making it possible for units to cross. But is has the looks of a coast tile)
- Create a new improvement. This improvement should be similar to a fort, but without the defense bonus. If you give the improvement empty art, you wont see it on the map. Make it also unpillagable.

The only problem I foresee is that the tile won't benifit from the food bonus of the harbor and the commerce bonus of the Colossus, as it isn't a water tile. But it does allow both land- and see units to pass through.
 
I'm not sure what you even want to do.

I think you want to make certain water tiles passable for land units, is that correct? If so, the fort improvement isn't really the way to go, because it only has the option to allow access for water units, which coast already has.

I don't think there is a way to achieve this without editing the DLL.
 
Yes, I want some water tile to be accessible to land unit. Both ships and land units can pass, so many battles like Invasion of Normandy in WWII can be possible.
Hi,merijn. I have used your method, I creat a terrain called channel .it looks like a coast but it is a land terrain. so land unit can pass but the problem is water unit can not pass.


Hi, Leo. Do you know which part of DLL should be edited?
 
Hi,merijn. I have used your method, I creat a terrain called channel .it looks like a coast but it is a land terrain. so land unit can pass but the problem is water unit can not pass.

Did you create the fort-like improvement like I said?
 
Hi, Leo. Do you know which part of DLL should be edited?
I think you would have to start with CvUnit::canMoveInto(). As you can see under "case DOMAIN_LAND", land units are currently generally not permitted to enter water tiles. So whatever solution you take to model such a mechanic (I would advise you to add a terrain or feature type, "strait" for instance), it needs to be worked in there.

You might also have to address some other special cases, such as what happens if a land unit finishes its move on such a tile, whether they can attack ships there and if ships can attack them there (and what combat rules apply).

Personally I'd say that land units shouldn't be able to attack water units and water units should automatically destroy land units they catch on water.

(Another solution is to give the strait tile zero movement cost so the AI won't ever stop its units there.)
 
Did you create the fort-like improvement like I said?
Thank you very much.

Leo has told me which part of DLL should be edited. If editing DLL could allow a tile to be passable to both water units and land units, the fort-like 'channel' will not be necessary.
 
I redid everything on my new computer, and now I get this:
Code:
1>------ Skipped Build: Project: CvGameCoreDLL, Configuration: Debug Win32 ------
1>Project not selected to build for this solution configuration 
========== Build: 0 succeeded or up-to-date, 0 failed, 1 skipped ==========

I opened the Solution file and updated the VCPROJ++ file. What have I done wrong and how do I fix it?
 
What does your makefile look like now?
 
Here it is:
 

Attachments

  • Makefile (dummy copy).txt
    7.3 KB · Views: 48
can you add more than 1 name to a tile in CNM.py?

Like... instead of the normal
Code:
"Tarraco", "Tarraco",
Is it possible to make it like this?
Code:
"Tarraco" OR "Barcino", "Tarraco" OR "Barcino",
 
I opened the Solution file and updated the VCPROJ++ file. What have I done wrong and how do I fix it?
What exactly did you do with the project file? And are you using the solution file from the SVN?

can you add more than 1 name to a tile in CNM.py?

Like... instead of the normal
Code:
"Tarraco", "Tarraco",
Is it possible to make it like this?
Code:
"Tarraco" OR "Barcino", "Tarraco" OR "Barcino",
Not like that.

What are you trying to do?
 
Top Bottom