How to mod a Troops carrier unit?

Deep_Blue

Knight
Joined
Aug 2, 2005
Messages
750
I have this idea in my mind but I don't have any background about BTS modding, I had done some modding on CIV3 but I never tried modding CIV4.

My idea is to add new troops carrier unit for faster deployment of troops in enemy land. Being unable to move troops (like rifleman, infantry , cannons ..etc) fast enough in enemy land makes wars very tedious and time consuming and affects the fun part of the game. How many times you felt annoyed because you cannot move your cavalries stack 2 moves toward an enemy city just because they are slowed down by cannons and riflemen in their stack.

The answer to this is troops carrier unit, this unit carries un-mounted units (swords, Muskets , Infantry ..) and siege weapons.

I was thinking about adding the following units:

1.Wagon:
Strength: 0
Movement: 2
Prereq: Engineering
Cargo Space: 2
Upgrades to: Motorized Carrier
*Carries un-mounted units and siege weapons
**Cannot defend, when destroyed loaded units will be unloaded not killed.


2.Motorized Carrier:
Strength: 0
Movement: 2
Prereq: Industrialism , Oil
Cargo Space: 4
Upgrades to: Armored Carrier
*Carries un-mounted units and siege weapons
**Cannot defend, when destroyed loaded units will be unloaded not killed.


3.Armoured Carrier:
Strength: 16
Movement: 3
Prereq: Composites , Oil
Cargo Space: 6
*Carries un-mounted units and siege weapons
**Can only defend , doesn't receive defensive bonus, when destroyed loaded units will be unloaded not killed.

I think the following will be involved in such Mod:
1- Graphics modding
2- Tech modding
3- XML modding

As I said I am beginner in this and I don't know where to start and I need you help:
- What do I need for the described units above?
- What are required modding steps?
- Where to start learning about the required modding steps?
- How can I trigger units unload when the carrier is destroyed? and is this possible to Mod?

Any Info / suggestions will be very appreciated.
 
Big Problem - the AI can't handle it. :( Tried it with missiles some days ago. But I'll be looking for a solution asap.
 
AI will only load units into a transport on cost, or in a costal city. You would need to program a new UnitAI type so that the AI could handle any transport other then ocean going. Making a troop transport is easy though, but without the AI being able to use it, there simply isn't a point.

Also this is the wrong forum for this, questions aren't supposed to be asked here, this is for modcomps that are finished and ready to be assimilated into other mods.
 
Apart from the AI's inability to understand it, it is quite simple. Most of it is handled in CIV4UnitInfos.xml, but if you want to limit it to specifc types of units then you'll need to edit CIV4SpecialUnitInfos.xml too.

Transports can only carry units from one domain (Land, Sea, or Air), and of one SpecialUnitType. Since units can have only one domain and only one SpecialUnitType, you couldn't limit some transports to only siege, some to only unmounted units, and some to both, as they's have to be defined in the same special unit type.



I really wish this was changed so that a unit could carry different numbers of multiple domains and special unit types, so that units could carry cargo while being cargo (which should probably make the cargo's cargo count against the both cargo limits), and so that the AI could understand how to use transports better.
 
you couldn't limit some transports to only siege, some to only unmounted units, and some to both, as they's have to be defined in the same special unit type.

Caravals are limited to spies , great people , scouts and missionaries. I guess if we study caravals then we may find out how this can be done.
 
Caravals are limited to spies , great people , scouts and missionaries. I guess if we study caravals then we may find out how this can be done.

The caravel's "SpecialCargo" field is set to SPECIALUNIT_PEOPLE. The units that it carries (such as a spy) have there "Special" field set to SPECIALUNIT_PEOPLE. I think it's as simple as that.

I think that you just need to add a new specialunit to CIV4SpecialUnitInfos.xml then place it in the above fields to make things work.

I did this with my own mod and it worked fine. Unfortunately I don't have my mod on the computer that I'm currently using, so I had to go on memory while posting the above comments, but they should be correct.
 
As General TSO mentioned, that is exactly what you have to do.

1). Create a SPECIALUNIT_SOLDIER (or whatever you want to call it) item in the SpecialUnitInfos.xml file
2). Put this new item in the <SPECIALUNIT> tag in the UnitInfos.xml file (its the 3rd or 4th line from the beginning of each new unit). Note only put this for the units you want to be carried. I would imagine you are talking about Infantry, Machine Gunners, and other non-motorized units.
3). On the unit that you want to do the carrying, you put the same item in the specialunitcargo tag. its toward the bottom, just look for the caraval and mimic what it does for your own.

The AI wont know how to us it, but I thin if you define this new carrier unit to AI_ASSAULT_SEA or whatever the tag the carrier has, it might work. never expirimented with it much. I did make a truck that did this a while back, uploaded it here at some point. but as mentioned I never expiramented with the AI too much.
 
Thanks General TSO and Edgecrusher I will experiment with the mentioned method.
To be honest I never thought about how the AI will be using this, and it will be the biggest problem with a troops carrier unit if the AI cannot understand it. Iam imagining the AI loading infantries and trying to move the unit overseas.
 
Deep Blue, I think the problem with the AI, is that it wont, ever load infantries into a truck/helicopter/etc.. at all.
I "thought" I tried to test the UNITAI_ASSAULT_SEA, which is the ai that the transport is given, on a land based unit, to see if the AI would use it as a transport. I cant remember how that turned out, THen again, it might be one of those things I wrote down to test, then when I take my sebatical from Civ during the summer, I never got to it.
 
I tried, it failed. I think the AI can load and offload on coastal tiles, and coastal cities if you use the UnitAI_Assault_Sea tag. However, it for sure will never load/offload on inland tiles, which kind of makes these units pointless, unless you just want to have a one up on the AI.
 
Back
Top Bottom