Is it possible to create an amphibious unit? (Like a LEV Tank in Civ:BE)

Mettpawwz

Chieftain
Joined
Feb 4, 2017
Messages
73
I was wondering if there is currently any way to make a unit behave in the following ways, for example let's take the helicopter as a starting point since it already has the first 2 points:

1) Can move on land (already present)
2) Is not slowed by terrain (already present)
3) Moving in and out of water tiles costs 1 movement (this one is easy)
4) Does not embark when moving into water (no idea how to make a DOMAIN_LAND unit do this)
5) Can still attack when in the water (same as above)
6) Attack strength remains what it was on land (same as above)
7) The graphical model does not change when moving into water (same as above)

Basically, is it possible to make units like the LEV tanks from Civ: Beyond Earth?

The way the Domain field works in the Units table seems to mean that there is likely no clean way to do this, but does anyone know any functional workarounds? Any way you can get pretty much the effect I described even if there is no hard-coded way to do it?
 
Last edited:
I suspect that you may be able to do some of that with Lua, by creating two unit types, one for land and the other for sea, and switching the unit from one to the other based on where it is, thus getting around the domain limitation. Care would need to be taken to transfer everything from the "old" unit to the "new" unit, including name, damage taken, experience, promotion, bonuses from reaching wonders, movement points remaining, any build/spread points if you want those too and possibly much more I haven't thought of. You'd need to catch the following event, check the unit type first to cut down the processing overhead and then work from there:

GameCoreEvent.UnitMoved(PlayerID, UnitID, x, y, ? (bool), ? (-1))

I got the syntax from Gedemon's Lua Objects spreadsheet. I also have no idea what the last two parameters represent, but you should only need UnitID, x, and y.
 
Back
Top Bottom