Resource icon

Updated Fortified Alert 1.11

gyogen2

Emperor
Joined
May 8, 2014
Messages
1,201
gyogen2 submitted a new resource:

Updated Fortified Alert - updated version of Fortified Alert, also with turn chime

I was having difficulty updating the original file (possibly because I had changed file name?) so thought I would re-post.

Update version of Fortified alert:

Changed to allow for unit range of sight.

Altered script to try and fix issue with some plots being missed.

I was told the ActionPanel.lua was being used by another mod, so I migrated the script to InGameTopOptionsMenu.lua, which is the file I had used for turn chime, so it is also included in this update.

If you wish to disable...

Read more about this resource...
 
InGameTopOptionsMenu.lua is modified by the Restart Button mod, but no big deal. I quickly copied your code over and check it out later.
 
I don't know much programming (other than most the basics of Java Script.) but how would I go about commenting out the turn chime?

Thanks for your time.
 
I don't know much programming (other than most the basics of Java Script.) but how would I go about commenting out the turn chime?

open the file and look for turn alert - line 396 (at least in notepad++) and add dashes before the lines.
Example:
Code:
---------------------Turn A;ert -----------------------------
    --local pPlayer = Players[iPLayer];
    --if pPlayer:IsHuman() then
    --UI.PlaySound("Play_MP_Game_Launch_Timer_Beep"); ----------edit to change sound
    --end
--------------------------------------------------------------
you really just need to comment out the UI.PLAYSOUND line.
 
open the file and look for turn alert - line 396 (at least in notepad++) and add dashes before the lines.
Example:
Code:
---------------------Turn A;ert -----------------------------
    --local pPlayer = Players[iPLayer];
    --if pPlayer:IsHuman() then
    --UI.PlaySound("Play_MP_Game_Launch_Timer_Beep"); ----------edit to change sound
    --end
--------------------------------------------------------------
you really just need to comment out the UI.PLAYSOUND line.

Okay, thanks for the help.
 
Edit: I just looked at was copied and pasted and I noticed the "--" before end was missing so I mus have removed it. Don't think it will change anything but I am going to add it back in and see if it fixes it.

Edit 2: Added it back in and nothing was changed.



Okay, sorry to bother you again, but after I edited the file all the buttons in the menu no long work. (it did work in removing the sound though.)

Here is what I changed it to, not sure if this is how you meant it though.

Code:
//
---------------------Turn A;ert -----------------------------
    local pPlayer = Players[iPLayer];
    if pPlayer:IsHuman() then
    UI.PlaySound("Play_MP_Game_Launch_Timer_Beep"); ----------edit to change sound
    end
-------------------------------------------------------------- 
//


I also disabled all other mods and rebooted and both did not work, if I disable the mod or change it back it works fine, not sure what is going on.

Thank you for your time again.
 
Last edited:
I just tested to make sure it didn't effect anything, and all worked fine.
It might be something accidentally got pasted over, not sure why it didn't work for you

Try just putting two dashes before the UI.PLAYSOUND like

--UI.PLAYSOUND("Play_MP_Game_Launch_Timer_Beep"); ----------edit to change sound

Okay, I'll try that and if it does not work I'll re-download and try again in case I did accidentally write over something.

Thanks for your help.


Edit: I must have done something I did not notice as it worked after I re-downloaded it. Anyway, thanks for the help.
 
Last edited:
There is a conflict between this mod and the Reset Button mod in the InGameTopOptionsMenu.lua file but where or what exactly I do not know, I'm not a modder and don't know what to look for or where, I just know that that lua file is the only link between the 2 mods. Basically if this mod is enabled then the Reset Button won't appear in the in game menu at all, which is irritating as that is a feature that should have been included from the start and not require a mod to become accessible.

Edit 1: I just noticed that the lua file for Reset Button is 7kb smaller than for this mod, so I'm guessing that this means that this mod's lua file has more lines and code than that of the Reset Button mod? Don't really know whether this is of any significance or not but I guess it means overwriting 1 file with the other is not going to work without fully breaking 1 or the other's code.
Edit 2: I've tried to upload a copy of the lua file from Reset Button but its extension isn't supported for file upload to this forum so instead the link to the forum post for Reset Button is https://forums.civfanatics.com/threads/restartbutton.603951/
 
Last edited:
I merged the two files for you. Take this file and put it in one of the mods, Probably best to put it in the restart button mod, as it contains other files, take out the fortified alert mod (it only used this file).

I plan to make a custom file once tools come out and gamescripts can load in saves. Sorry for trouble in meantime
 

Attachments

  • Merge.zip
    4.3 KB · Views: 337
Do you know if this will wake up air units on patrol? I'm not able to test at the moment but I discovered that you can patrol an air unit at the maximum distance and then wake it and attack with extended range.
 
Thanks, seems to be working fine, question for you gyogen2.

Can you still fortify and get the fortification bonuses, say if I did not want to move or attack, but to defend a choke-point if you will? Sorry if I missed something obvious..it is 5AM :coffee:
 
I haven't had time to refine the code, but currently it does the check at the beginning of your turn, so if you fortify a unit on your turn, it will remain so during AI turn and you'll get bonus. Unfortunately, this means the unit will "wake" at start of turn and you will need to fortify again. When(if) tools cole out I will redo the code to better handle such cases.
 
I haven't had time to refine the code, but currently it does the check at the beginning of your turn, so if you fortify a unit on your turn, it will remain so during AI turn and you'll get bonus. Unfortunately, this means the unit will "wake" at start of turn and you will need to fortify again. When(if) tools cole out I will redo the code to better handle such cases.

OK, so being that the defense bonus stacks per turn until it reaches it's cap, this may be something to mention on the description.

I believe, you get 2-3% per turn...someone should correct me if I'm mistaken.

Being that it is 5AM this is very possible. :hide:


edit:add thought.

...or maybe adjust the fortification per turn bonus to it's max. Though that may seem cheaty, your mileage may very.:hmm:
 
Top Bottom