Resource icon

Updated Fortified Alert 1.11

I can't do much today because I have to get ready to go to work for 10 or 11 hours, but I had thought of two other ways I could do this mod.
one would be to give all the units the sleep command, then attach the alert wake to that, the other was to trigger a notification instead of actually waking the unit.
I'm not sure if either of these methods would be preferable to people, but I'll play around with them when I have time and see.
 
Thanks for the update!
Waking up air and naval units in sleep mode would be great too, but I'm somewhat afraid of performance loss as I noticed some slowdowns later in a match with many units. I don't know yet if it's related to this mod.
 
It is now waking fortified units all the time. I thought it only did it during war.
Here too. If you remove the dashes before if and end in InGameTopOptionsMenu.lua below then it should wake only for hostile units again:
Code:
                                   if localPlayerVis:IsUnitVisible(kUnit) then
                                       local otherPlayer = kUnit:GetOwner();
                                       local bIsAtWarWith = pPlayer:GetDiplomacy():IsAtWarWith(otherPlayer);
                                       --if(bIsAtWarWith) then
                                           UnitManager.RequestCommand( pUnit, UnitCommandTypes.WAKE);      
                                       --end
                                   end

Edit: Oh okay, gyogen2 replied faster than me.
 
IMO best would be to leave fortified units fortified, and add sentry sleep command to everything.
If I want a unit to sleep through nearby enemy units then I can just fortify it.

Great mod though, game is too frustrating to bother playing without it.
 
I can confirm air units on patrol do not wake up (even when an enemy units is in an adjacent hex).
 
When the unit is awakened by the code I cannot skip its turn. I must fortify again. I don't remember if this always functioned like that or not.
 
IMO best would be to leave fortified units fortified, and add sentry sleep command to everything.

That was one of the plans, but I could not figure out how to add an operation to a unit. If anyone knows how to assign an operation, I would be glad to. I tried adding an operation, but it would not show in unit panel. It seemed the operations some operations are based on type of unit/class and may be hardcoded, but I may have missed something. The mod itself was mainly intended as a sorta placeholder mod until the tools come out and I can do it properly.
 
When the unit is awakened by the code I cannot skip its turn. I must fortify again. I don't remember if this always functioned like that or not.
I will check, I was working on a code to keep the number of fortified turns if the unit was refortified, but the command would not work in the ui context. I will check if I neglected to remove all the code.
 
When the unit is awakened by the code I cannot skip its turn. I must fortify again. I don't remember if this always functioned like that or not.
I will post an update in a little bit when I am done with some other things. but for now, you can fix yourself if you like, in the lua ~ line 552 change:

UnitCommandTypes.WAKE to
UnitCommandTypes.ALERT and you will be able to skip turn.
 
Just an update -- I have managed to make a Guard operation for units that can fortify mostly working, the current problem is I am having trouble removing those untis from the wake function if they are then put into fortify after being in guard. It might be the method I am using to share info between luas. Hopefully I'll get it working pretty soon.
 
Back
Top Bottom