Land Unit that can carry other land units as Cargo when embarked. Possible w/XML?

rarmonio8920

Chieftain
Joined
Oct 15, 2008
Messages
28
I had a rough idea of what I want to do, but I didn't want to waste time rebuilding the Mod each time and waiting for it to start up. I figured I would just ask if it'd work.

Three Questions:

1.) Is my idea possible?
My Idea: A land unit that can embark and carry other land units as cargo. (i.e. an amphibious transport unit which could hold, say, Marines.) (And yes, I'm aware that they can embark.)

2.) If yes, does the following work?:

- Create an XML file for a new unit with land characteristics. (Civ5Units.xml as a reference)
- Include the <SpecialCargo>SPECIAL_MARINE_UNIT</SpecialCargo> and <DomainCargo>DOMAIN_LAND</DomainCargo> tags.
- Create/modify units that will be able to be carried. For instance, a Marine unit.
- These new/updated units must be designated with <Special> tags.

- Create a "SPECIAL_MARINE_UNIT" Type for the <SpecialCargo> tag. (This will be for the Land Cargo). (Civ5SpecialUnits.xml as a reference.)

- The Land Unit needs one of the Cargo Promotions.

3.) How will AI work?

I'm assuming I would just give the Land Unit Carrier the "UNITAI_CARRIER_SEA" AI. I just don't know what to give the Land Units (the Marines). I'd hate for the computer to create these Land Carriers, Marines load up on them, and then they just stay there... floating around. Or rather, the Marines don't realize they can load up on the Land Carriers. :confused:

Thoughts?
 
I have done something similar: I have created a naval unit which can carry land units.

What you described in 1) and 2) is pretty much how my mod works. What you want to do though has an additional complication: you want a land unit to carry other land units as cargo. It doesn't seem to be allowed by the game engine. I have tried to do it and the game recognizes the land units as "stacked" in such case and requires you to unstack them. I'm not sure what would happen if you allow more than 1upt.
 
How about increasing this value in global defines?

Code:
<Row Name="PLOT_UNIT_LIMIT">
			<Value>1</Value>
		</Row>

Saw this the other day while I was looking for something else, and it sounds like it might allow you to make unit stacks. Haven't tried messing with it myself though.
 
How about increasing this value in global defines?

Code:
<Row Name="PLOT_UNIT_LIMIT">
			<Value>1</Value>
		</Row>

Saw this the other day while I was looking for something else, and it sounds like it might allow you to make unit stacks. Haven't tried messing with it myself though.

Yes, I think that's exactly what Legions mod changes. This would allow stacking units in general, so it's a pretty big change actually.

What I am not sure about is if an intended "cargo" land unit will be recognized as a cargo of another land unit by engine (even when stacking is allowed). If engine doesn't recognize it as cargo, the "carrier" unit won't actually carry the "cargo" units. Then carrying (teleporting) cargo units will have to be written in Lua, it will be quite an undertaking.

Trying stacking is worth a shot though.
 
Oregon Trail has always taught me that fording rivers will end in cholera and missing axles. That is to say, its beyond our capacity to get this to work in a way the AI could use it.
 
Oregon Trail has always taught me that fording rivers will end in cholera and missing axles. That is to say, its beyond our capacity to get this to work in a way the AI could use it.

So there is still a place where you can find cholera? Fascinating ... :think: :vomit:

I don't necessarily agree with the argument that if AI can't use something it's bad. But it's certainly not as good as if it could.
 
Back
Top Bottom