• We are currently performing site maintenance, parts of civfanatics are currently offline, but will come back online in the coming days. For more updates please see here.

[MODCOMP] Return Home and Unload Command

Kailric

Jack of All Trades
Joined
Mar 25, 2008
Messages
3,100
Location
Marooned, Y'isrumgone
I was wanting these commands to use in other mods so I created a modcomp for them to make it easier to merge with those mods and decided to post it here as well so others can merge it if desired.

DOWNLOAD HERE

This Mod adds two new commands defined below.

Assign Home City: allows you to assign a home city to the unit to be used in conjunction with the Return to Home City Command.

Return Home and Unload: if the unit has a home city selected it will return there and unload if able. If not it will move to the closes city to unload if able.

These commands are available to:

Treasure Units: only coastal cities are selectable
Ships: only coastal cities are selectable
Land units with Cargo space: only cities the unit can move to are selectable

Applications:
1. If you find a treasure unit you can assign it a home city and have it moved there with little effort
2. Helps in manualy moving around your transport ships when arriving from Europe with new Immigrants
3. When your Privateers are full of cargo you can have them return to their home port.

Modders:
Source code is provided. Changes are marked with //TKs Return Home in the SDK.
In the GlobalAltDefines there is a new Attibute called "TREASURE_UNITS_ONLY_SELECT_COASTAL". The default is "1" on. If this is on then Treasure units will only select Coastal cities for Home Cities, if its set to 0 they will select any city they can move to.
 
Very interesting!

I have one idea where and how your mod could be used.

- We have a small deposit of "Placer Gold". Let say 100 pieces of Gold.
- This deposit is located outside the city border.
- No reasons to build a new city near this deposit because after a number of turns this deposit will be exhausted.

All these points are already realized in "1492: Gold Rush" modcomp.

- We send an expedition to collect this "Placer Gold".
Here under the term of "expedition" I mean a new unit similar to your "Prospector" (optimal variant) or a number of units (Goldminer+Soldier+Wagon - bad solution).
- "Prospector" has an empty slot for collected Placer Gold. ("Slot" similar to Whaling boat slot but with <iCargo>1</iCargo>).
- "Prospector" can collect only "Placer Gold" and cannot be used as a transport unit.
- Muskets and Tools are required to equip "Prospector" (very easy to realize in xml).
- "Prospector" can fight (defence himself) as a normal Soldier against natives or animals (xml correction).

- "Prospector" can return in one of his home cities and unload all Gold when his slot is full or if "Placer Gold" deposit is exhausted. (Your "[MODCOMP] Return Home and Unload Command")

Later, probably, such "Prospector" could also discover various mineral resources as you proposed here.

I already downloaded your file but cannot try it now. My game PC under serious repairing and will be ready only in January.

Good luck in your modding.

Merry Christmas and Happy New Year!
 
That's a cool set of commands - can it make the AI auto-use those commands in appropriate circumstances, and would that improve its gameplay from currently?

I'm wondering if it could be used with the Whaling Boats code, to enable the AI to harvest some resources from a tile and unload them in a city. (My current Mining Vessels in the 2071 mod can successfully harvest resources directly to the nearest city using a special Build order, but I can't get the AI to use this Build order correctly.)
 
Back
Top Bottom