How to make a unit that has a bigger bonus movement speed on railroad??

margustoo

Warlord
Joined
Aug 22, 2014
Messages
117
Location
Tallinn, Estonia
I would want to make a New Civ that has UU called Armored Train. While there are pre made units that do what I would like them to do.. they all need ether DLL or the Community Patch to run them properly. Is there an option where I don't need DLL or Community Patch but this UU still moves far more faster on Railroad than it does on terrain without Railroad.. (f.e normally it has 1 movement speed while on Railroad it has 5 or even 10 movement speed). Also it would be good if such an unit wouldn't be able to attack when it is on a terrain that doesn't have Railroad..

Currently I am looking examples such as: UU of Tibet and Maurya (made by guy who is behind More civs), UU of Norway and Scotland (made by JDF) and UU of New California (made by RawSasquatch)
 
Is there an option where I don't need DLL or Community Patch but this UU still moves far more faster on Railroad than it does on terrain without RailRailroad?
I'm thinking using 2 units would be easiest, one of them hidden and unbuildable, and just hook GameEvents.UnitSetXY, and swap them with Lua if the non-RR one is on a RR, or to the non-RR when the RR one isn't. When it's a Convert to the non-RR, so that it doesn't get extra moves, set the movement points to 0, or decrease by the appropriate percentage (or if you just want to e.g., always give 1 additional move, remember they're actually multiplied by 60 internally, e.g., 120 movement points are 2 moves).
 
I'm thinking using 2 units would be easiest, one of them hidden and unbuildable, and just hook GameEvents.UnitSetXY, and swap them with Lua if the non-RR one is on a RR, or to the non-RR when the RR one isn't. When it's a Convert to the non-RR, so that it doesn't get extra moves, set the movement points to 0, or decrease by the appropriate percentage (or if you just want to e.g., always give 1 additional move, remember they're actually multiplied by 60 internally, e.g., 120 movement points are 2 moves).

Hopefully I manage to do that..
 
Top Bottom