[QUESTION] Three Road Types

Ambreville

Deity
Joined
Sep 28, 2006
Messages
2,255
Location
Windy City USA
I looked into adding a third road type . At present, we had the "road" and the "railroad". I wanted to differenciate the dirt road from a paved road (faster than dirt road, but requiring Engineering & Stone, and longer to build).

So I went ahead modifying the RouteInfo, BuildInfo, and UnitInfo XML files accordingly. The game loads alright up until after I select a CIV and finish loading. At this point I get a runtime error. Either it's not possible to add a third road type, or I'm missing some other steps.

I thought for a time there could not be more than 14 possible actions (buttons) for workers' assignments due to space limitation. I removed railroad as a build and replaced it with the new road building assignment so all the buttons would fit on the screen. That made no difference.

Anyone?? Thanks!
 
Daah! Ambreville, you stole my idea! ;)

I would like to see what you have done, as I was planning something very similar. There are even graphics in the database for different road types.

I don't know if the button issue is what's causing it, but without seeing the XML files I can't really tell.
 
Daah! Ambreville, you stole my idea! ;)

I would like to see what you have done, as I was planning something very similar. There are even graphics in the database for different road types.

I don't know if the button issue is what's causing it, but without seeing the XML files I can't really tell.

OK. Back in a few... :scan:
 
Here's what I added to the CIV4BuildInfos. ROAD was renamed to TRAIL. A different ROAD entry was added with the necessary changes there.
Spoiler :
Code:
		<BuildInfo>
			<Type>BUILD_TRAIL</Type>
			<Description>TXT_KEY_BUILD_ROAD</Description>
			<Help/>
			<PrereqTech>TECH_THE_WHEEL</PrereqTech>
			<iTime>200</iTime>
			<bKill>0</bKill>
			<ImprovementType>NONE</ImprovementType>
			<RouteType>ROUTE_TRAIL</RouteType>
			<EntityEvent>ENTITY_EVENT_SHOVEL</EntityEvent>
			<FeatureStructs/>
			<HotKey>KB_R</HotKey>
			<bAltDown>0</bAltDown>
			<bShiftDown>0</bShiftDown>
			<bCtrlDown>0</bCtrlDown>
			<iHotKeyPriority>0</iHotKeyPriority>
			<Button>,Art/Interface/Buttons/Builds/BuildRoad.dds,Art/Interface/Buttons/Actions_Builds_LeaderHeads_Specialists_Atlas.dds,1,8</Button>
		</BuildInfo>
		<BuildInfo>
			<Type>BUILD_ROAD</Type>
			<Description>TXT_KEY_BUILD_ROAD</Description>
			<Help/>
			<PrereqTech>TECH_THE_WHEEL</PrereqTech>
			<iTime>250</iTime>
			<bKill>0</bKill>
			<ImprovementType>NONE</ImprovementType>
			<RouteType>ROUTE_ROAD</RouteType>
			<EntityEvent>ENTITY_EVENT_SHOVEL</EntityEvent>
			<FeatureStructs/>
			<HotKey>KB_R</HotKey>
			<bAltDown>0</bAltDown>
			<bShiftDown>0</bShiftDown>
			<bCtrlDown>0</bCtrlDown>
			<iHotKeyPriority>0</iHotKeyPriority>
			<Button>,Art/Interface/Buttons/Builds/BuildRoad.dds,Art/Interface/Buttons/Actions_Builds_LeaderHeads_Specialists_Atlas.dds,1,8</Button>
		</BuildInfo>

This goes in the CIV4RouteInfos file, as follows (I need a different graphic file for the paved road):
Spoiler :
Code:
	<RouteInfos>
		<fZBias>3</fZBias>
		<RouteInfo>
			<Type>ROUTE_TRAIL</Type>
			<Description>Trail</Description>
			<iValue>1</iValue>
			<iMovement>30</iMovement>
			<iFlatMovement>30</iFlatMovement>
			<BonusType>NONE</BonusType>
			<Yields/>
			<TechMovementChanges/>
			<Button>Art/Interface/Buttons/Builds/BuildRoad.dds</Button>
		</RouteInfo>
		<RouteInfo>
			<Type>ROUTE_ROAD</Type>
			<Description>Paved Road</Description>
			<iValue>1</iValue>
			<iMovement>30</iMovement>
			<iFlatMovement>20</iFlatMovement>
			<BonusType>BONUS_STONE</BonusType>
			<Yields/>
			<TechMovementChanges>
				<TechMovementChange>
					<PrereqTech>TECH_ENGINEERING</PrereqTech>
					<iMovementChange>-10</iMovementChange>
				</TechMovementChange>
			</TechMovementChanges>
			<Button>Art/Interface/Buttons/Builds/BuildRoad.dds</Button>
		</RouteInfo>
		<RouteInfo>
			<Type>ROUTE_RAILROAD</Type>
			<Description>TXT_KEY_ROUTE_RAILROAD</Description>
			<iValue>2</iValue>
			<iMovement>20</iMovement>
			<iFlatMovement>6</iFlatMovement>
			<BonusType>BONUS_COAL</BonusType>
			<Yields/>
			<TechMovementChanges/>
			<Button>Art/Interface/Buttons/Builds/BuildRailroad.dds</Button>
		</RouteInfo>
	</RouteInfos>

And here's some info out of the worker's stats in the CIV4UnitInfos file:
Spoiler :
Code:
			<Builds>
				<Build>
					<BuildType>BUILD_TRAIL</BuildType>
					<bBuild>1</bBuild>
				</Build>
				<Build>
					<BuildType>BUILD_ROAD</BuildType>
					<bBuild>1</bBuild>
				</Build>
				<Build>
					<BuildType>BUILD_RAILROAD</BuildType>
					<bBuild>1</bBuild>
				</Build>
ETC...


Makes sense? I'm sure I'm missing something, but that was the idea. :)
 
What is the specific runtime error you are getting?

One word of advice: it may not be a good idea to rename the original road, just to keep any unforseen errors from popping up.
EDIT: I looked at it again, and renaming it they way you have done shouldn't cause any problems, but you never know... ;)
 
What is the specific runtime error you are getting?

One word of advice: it may not be a good idea to rename the original road, just to keep any unforseen errors from popping up.

The error msg was really simple (game stopped unexpectedly, runtime error, and filename). I'll have to rerun it with these stats to get you the actual error txt.

As far as renaming the ROAD, I don't think that would be a problem, because we still have a ROAD entry, with slightly different stats than the original. What's really different here is the addition of a TRAIL build (with the coding from the original ROAD). :crazyeye:
 
The actual err msg is as follows:

Runtime Error!
(path...) CIV4Warlords.exe
The app has requested the runtime to terminate it in an unusual way. Please ctc app supprt team, etc...


This may be a bigger problem than just the RouteInfo file. Maybe the standard game isn't built to accomodate three roads to begin with. Not with just XML anyway.
 
I see no reason that you can't add a new route... I've got enough experience with the SDK to know that there's nothing there that only limits you to those two. I've also seen mods that incorporate extra routes, so it's not hard-coded either.
 
I see no reason that you can't add a new route... I've got enough experience with the SDK to know that there's nothing there that only limits you to those two. I've also seen mods that incorporate extra routes, so it's not hard-coded either.

Well, that's good news!

Now I just need to figure out how to do it! ;)
 
Right. You just get a lot of weird errors when you start modding, sometimes seemingly unrelated junk.

I'd say it's probably caused by either a lack of specific art (not as likely, but possible) or one or more XML files needs to be modified further.

If you're looking for art, there are two versions by Hadrean in the database that look good.
http://forums.civfanatics.com/downloads.php?do=file&id=2018
http://forums.civfanatics.com/downloads.php?do=file&id=2017

I later tried using the dds file in Paaski's NapEuro mod. It looked pretty good. I changed the ref to the new dds file but I ended up with the same result. :(
 
You don't actually have to have new art. You just have to reference SOME art. You can reuse the road art, but you have to tell the mod where to look for it. The problem is probably in the CIV4RouteModelInfos.xml as suggested by Gaius.
 
You don't actually have to have new art. You just have to reference SOME art. You can reuse the road art, but you have to tell the mod where to look for it.

I thought I did that. In my first attempt, I did not change any of the original art references. In the later attempt I changed the art ref in the Route Info file to a different dds file.
 
I thought I did that. In my first attempt, I did not change any of the original art references. In the later attempt I changed the art ref in the Route Info file to a different dds file.

Well, but you didn't change the information in the CIV4RouteModelInfos.xml.... you have to add new route model infos for each of the various directions... so you have to copy all route model info entries that have "ROUTE_ROAD" as their route type and then change this to ROUTE_TRAIL.

The dds file in the CIV4RouteInfos.xml only refers to the button icon... not to the route structures that appear on the map.
 
The dds file in the CIV4RouteInfos.xml only refers to the button icon... not to the route structures that appear on the map.

Actually, the dds file that I have contains truncated bits of paved road art, something I would expect to see on the map. It's definitely not a button.

--------------------

Woops, I accidentally edited my own post... sorry about that.
 
Top Bottom