[GS] Multiple Units Per Tile

writtendown

Chieftain
Joined
Sep 24, 2015
Messages
22
Hey!

Is it possible to disable units to swap tiles automatically after movement or to create a specific command just for swapping positions with a certain adjacent unit?

Thank you for your time
:)

Update:

I did figure out as much for my understanding, that when allowing 2 units per tile, then only time it works is when one of the unit has depleted its movement points.
 
Last edited:
You can disable unit swapping with a simple edit to Civ6Common.lua.

On line 161, change:
Code:
UnitManager.RequestOperation(kUnit, UnitOperationTypes.SWAP_UNITS, tParameters);

to:
Code:
UnitManager.RequestOperation(kUnit, UnitOperationTypes.MOVE_TO, tParameters);
 
Last edited:
If the unit can move to the target location, whether empty or if multiple units are allowed in a tile, the unit will move. If not, the move will be canceled.
 
Thank you!

It works. I wish i knew - how to replace the lua code in a separate file, rather then just changing base game file. :crazyeye: I guess i will need to start searching for it.
 
Another thought on my mind is to find a way to create a separate unit ability for military units. With an option to turn it on/off - allowing "foreign" units to move on to the same tile, or not)
 
Last edited:
I guess the global variable that allows multiple units on the same tile, does not work for different civs?
 
Thank you!

It works. I wish i knew - how to replace the lua code in a separate file, rather then just changing base game file. :crazyeye: I guess i will need to start searching for it.

You just have to make an edited LUA and insert it with a mod. You can reference what I did here: https://forums.civfanatics.com/resources/ars-no-loadscreen-speech.28257/ where I replaced LoadScreen.lua.

In cases where different versions of the game each use their own versions of an LUA it gets a little more tricky to get a mod to work across all of them. One can use Criteria to check which game version is running and then load the appropriate LUA like I did here: https://forums.civfanatics.com/resources/ars-improved-city-banner.28256/
 
Wow, i tried it, and it really works, impressive!
In my first test of these changes however it seemed like the AI doesn't make any use of the stacking. How is it possible to "teach" unit stacking to AI?
 
Back
Top Bottom