Resource icon

Updated Fortified Alert 1.11

I am not sure how to save custom data for a saved game yet, so units will load as just regular fortified units.

To counteract this for the time being, I added a function that should set fortified units to guard when the game is loaded. I found this less annoying than trying to find all the units I had on guard and reset them when a game was loaded.
Tried to add a work around for skipping turn when unit wakes, but that part is not working.


Added a work-around for not being able to skip turn when unit wakes.


Added wake function for units who are healing.
This update changes the way plots are scanned. It is a simpler method, that hopefully better ensures units will wake if enemy in sight.

I am not totally sure of later game impact , especially on large map with lots of units. So if anyone wants to test it out and let me know if it slows turns down too much it would be greatly appreciated.
Update:
Found a glitch where units on guard near map border would cause error that stopped that function.
Updated so sleeping religious units will be woken by nearby religious units of other players.

Tested some, but let me know if any issues.
  • Like
Reactions: Littlebob86
It was pointed out to me that anpther mod uses D as a hotkey so I posted this optional update that sets it to G

If you wish to use a different key, open the UnitPanel.lua file in the mod folder and look for this line near the top:

Code:
local KeyChoice = Keys.G
and change G to whatever key you choose.
Added hotkey for Guard action:

D
Sorry I omitted in previous update, I was honestly just so intent on getting the operation to work I didn't even think of it.
I have added a guard action to fortifiable units.
upload_2016-11-20_19-6-20.png


I am not good with art, so I had to use the fortify icon.
This will allow regular fortified units to stay fortified, and guard units will fortify until awoken by enemy unit.

I currently do not know how to save mod data across saves, so for now when you load a game, any unit you want on guard will need to be reissued the command, sorry for the inconvenience. If anyone knows how to save info, I'll be glad to add.

This mod uses the unitpanel.lua as that was the only way was able to attach a new operation. If any major or highly used mod also uses this let me know and i will try to make a compatible file.

I marked this as experimental because I haven't been able to test alot, and not sure if any more bugs to fix. If any are found, please let me know.
Fixed an error where certain plots would return nil and stop function.
Fixed lines I forgot to comment back in
Added wake function for sleeping air and sea units.

I am not sure if it will also wake air units on patrol (had been requested),
I was unsure of the proper activity type, I used Deploy, but don't have enough time to properly test, if this does not work, or if anyone knows proper activity, please let me know.
Updated to reflect changes in lua file from patch (17-11-2016)
Top Bottom