Quick Modding Questions Thread

Now, I do have a question about modern roads.

In my mod, I have roads, paved roads, railroads etc.

When you reach Industrial era (I think) you have your workers look more modern and your roads look like they are ready for cars. I hate it.

I can't tell the difference between roads and paved roads there. Very annoying.

How can I avoid it? Even in the SDK.

Thanks for any clue.
 
Look in CIV4RouteModelInfos.xml. Each RouteModelInfo entry has two values, ModelFile and LateModelFile. If you set the LateModelFile to match the ModelFile for each RouteModelInfo for the route type (there should be 70 for each route type) then the appearance of the route will not change.
 
Excellent, thank you, God-Emperor!
 
how do you make a unique unit with no original non-unique version?
 
how do you make a unique unit with no original non-unique version?

Technically, you don't. What you can do is just create the unit with its own unit class and unit (which is set to be the default unit for the unit class) as usual. Then go through the CIV4CivilizationInfos.xml file and give everybody but the target civ an entry like a UU, but specify the unit type as "NONE". This will block everybody else from building it since they will all have a UU version that is nothing (much like the barbarians are blocked from building units for a bunch of unit classes).

EDIT: well, that is assuming you are not basing your mod on a mod that has other easier methods of doing this. It is also not the only way - for example you could give the unit a tech prereq for a tech that can't be researched which is give to the civ for free. But the above is the general "always works" method that is designed into the game.
 
If you want to make it as a UU, I guess you still have to set it as a UU in the target civ Units entry after doing the above.

Else, I believe although the target civ is the only civ that can build the unit, it is still not its UU.
 
If you want to make it as a UU, I guess you still have to set it as a UU in the target civ Units entry after doing the above.

Else, I believe although the target civ is the only civ that can build the unit, it is still not its UU.

Interesting point. The difference is slight, but an actual UU does get an increase in its build value for the AI (called "UU love", or something like that, in the comments in the DLL), which makes it more likely to be built. However if you just specify the same unit type in the UU section of the civilization data as the unit class has for its default unit it still won't be considered an actual UU for this since, if I recall correctly, that is determined by the unit the player can build for a unit class being different from the default unit for the unit class. Since it would still be the same, it would not get the (small) increase in build value. It would also not show up in the civilopedia or on the "Dawn of man" screen at the start of a game as a UU for the civ for the same reason.

The only way to get it to count as a UU in all ways would be to make it actually be a UU. You'd create some dummy unit type that is assigned as the default unit for the unit class, in addition to adding the actual intended unit type. Then assign the actual type for the target civ as a UU and NONE for everyone else. Nobody can build the dummy unit. One civ can built the UU version of the dummy unit. The only issues are that it takes infinitesimally longer to load, takes up a little memory to store data for a unit nobody will ever build, and clutters up the civilopedia with a unit nobody will ever build.

Assuming that the extra build value is the only functional difference between a UU and a non-UU version of the unit, you could avoid all of this "dummy unit" stuff by giving the unit a small value for its AI weight tag equal to the bonus the UU gets. Well, it would still not show up in the civilopedia entry for the civilization as a UU for the Civ, or on the starting "dawn of man" screen either.
 
I'm not sure if this would work, but I think you can avoid having to set NONE for everyone. You could make the original unit unbuildable by setting iCost to -1 or perhaps by making the unit require a tech that can't be researched. Then make the UU buildable and you only have to add it to the civilization that you want.
 
I think that -1 cost does work for this.

I also seem to recall that there is some very small issue with the AI if you do, but I am not sure of it. I don't really remember for sure, but it might be the case that it will cause the AI's that don't get the UU version to overvalue the tech were it becomes available since it thinks it will get a new unit at that tech (as it doesn't check to see if it is not able to be built due to a cost of -1, although if it does check this then this is not the issue). Maybe.
 
I have a couple of Great Wonders in my mod that can only be built in coastal cities, yet I would prefer if the Pedia didn't render them as sitting on top of the water, the way it likes to :rolleyes: Is there a way to force it to render them the same way as any other wonders--just sitting in the middle of a field?
 
You mean LSYSTEM controls more than just its size on the map? My question was limited only to the Pedia depiction.
 
Yes, that's what I think, but I'm not sure about it. I think it's also responsible for what is displayed there. More or less. Every LSYSTEM with water (too lazy to check if there's more than one) should display something with water, but that's really rather a guess at the moment.
Worth checking though.
 
Not sure where else to ask that ... I've deleted the official mods that come with the game to save hard drive space a while back. Is there a way to install them again without reinstalling the whole game? Are they available for download somewhere?

I'm looking for the American Revolution mod.
 
You mean like: here it is? ;)


Edit: here it was. Removed attachment after download - don't think it's needed here anymore.
 
Awesome, that's the easiest solution. Thanks a ton :)
 
I'm trying to make a minor change to an existing mod. The mod blocked roads in some terrain. I want to put roads back.

I've been searching over an hour and I can't find anything in terrain that controls roads. Can somebody help me find what I'm missing?
 
I'm trying to make a minor change to an existing mod. The mod blocked roads in some terrain. I want to put roads back.

I've been searching over an hour and I can't find anything in terrain that controls roads. Can somebody help me find what I'm missing?

what mod? what kind of terrain? can the tile be entered with normal units and be improved by workers, but just not able to build roads?

if its blocked from entering it might be <bImpassable>0</bImpassable> in terraininfos
 
what mod? what kind of terrain? can the tile be entered with normal units and be improved by workers, but just not able to build roads?
Yes, workers can enter. They can mine the tile. They just can't build roads.
 
See if there is any python stuff under def canBuild(self,argsList): in CvGameUtils
 
Back
Top Bottom