How to immobilize units?
Moderators: Slitherine Core, The Lordz
How to immobilize units?
Hi, anyone can help me about how to immobilize units in one map position? For example, if I wat to immobilize a french Infantry unit in Paris... how can I do it?
Re: How to immobilize units?
Open game_supply.lua
Look for the function called:
function SetUnitMovePenalty(unit)
Insert the following at the end of the function
This will reduce any Entente infantry's movement value to 0 as long as it occupies Paris and its unit strength is at least 5.
Look for the function called:
function SetUnitMovePenalty(unit)
Insert the following at the end of the function
Code: Select all
local paris = game:GetHex(82, 30)
if paris.alliance.id == 1
and paris.unit ~= nil
and unit.hex ~= nil
and unit.hex.x == 82
and unit.hex.y == 30
and unit.prototype.name == "infantry"
and unit.hp >= 50 then
unit.mp = 0
end
Slitherine's Commander the Great War - Director's Cut: POTZBLITZ mod!
FIND IT HERE: http://www.slitherine.com/forum/viewtopic.php?f=218&t=77884&p=662610#p662610
Re: How to immobilize units?
Thanks for your help Robotron, and thanks very much for your great POTZBLITZ mod. I enjoy a lot playing with it, Slitherine should publish it and allow you to mod hard coded scripts too!!!!
Re: How to immobilize units?
This order to immobilize units affects to units not deployed in the beginning turn? If Paris is empty but in turn 10 an infantry unit is deployed in Paris, it will be immobilized?
Re: How to immobilize units?
Paris must be under Entente control and an Entente (French or British) infantry must be deployed at Paris with at least unit strength 5 for that infantry at Paris to be immobilized.
Is the solution I posted not working correctly or do you need something else?
Is the solution I posted not working correctly or do you need something else?
Slitherine's Commander the Great War - Director's Cut: POTZBLITZ mod!
FIND IT HERE: http://www.slitherine.com/forum/viewtopic.php?f=218&t=77884&p=662610#p662610
Re: How to immobilize units?
Yes, it works, but I don't know if this solution only works with the initial deployment in turn 1, or it works all the game.
Re: How to immobilize units?
It will work for the whole game since no time limit was defined in the function.
Slitherine's Commander the Great War - Director's Cut: POTZBLITZ mod!
FIND IT HERE: http://www.slitherine.com/forum/viewtopic.php?f=218&t=77884&p=662610#p662610
Re: How to immobilize units?
Great, thanks Robotron!