1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Improved Build Queue Mod

Discussion in 'Civ5 - Mod Components' started by DireAussie, Sep 25, 2010.

  1. DireAussie

    DireAussie Chieftain

    Joined:
    Nov 12, 2005
    Messages:
    60
    This is a small mod to improve the build queue functionality until 1) Firaxis makes a better one or 2) someone makes something better.

    Instructions: copy to your Documents\My Games\Sid Meier's Civilization 5\MODS directory, then when starting the game, install and enable the mod in the mods menu.

    What it does:

    - "Show Queue" checkbox is always on, if you change it it wont do anything
    - all build screens now act like the add queue screen
    - normal click will append to queue
    - shift-click will clear entire queue and add the clicked item
    - ctrl-click will insert item at beginning of queue
    - ctrl-1 to 4 will save a queue
    - 1-4 will restore a queue, overwriting current queue
    - shift 1-4 will restore a queue, appending items at end of existing queue
    - alt 1-4 will restore a queue, inserting items at start of existing queue

    Update history

    V 6 - updated for version 1.0.0.62

    V 5 - ctrl and shift swapped around to bring it more in line with civ 4. However a normal click will still append to the list rather than change what you're currently building.

    V 4 - fixed a bug with queuing when clicking "add to queue" from city screen

    V 3 - Now comes with queue saving and restoring!!

    - ctrl-1 to 4 will save a queue
    - 1-4 will restore a queue, overwriting current queue
    - shift 1-4 will restore a queue, inserting items at start of existing queue
    - alt 1-4 will restore a queue, appending items at end of existing queue
    - changed behaviour so build screen wont close automatically if you add 6 items

    V 2
    - fixed purchase issue.
    - in 1.0.0.20 Firaxis changed the productionpopup.lua file to supposedly fix puppet build bug, but it didnt work and instead stops you from being able to continue with the game. My download includes a temporary workaround by removing their buggy fix until they fix the real problem (see thread here.
     

    Attached Files:

  2. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,118
    Location:
    Germany / Netherlands
    Aaahhh...never do that.
    There shoudl be somewhere a mods directory in the Civ5 folders, there you should be able to create a folder for your own mod.
    But i don't have Civ5, so i can't be more precise, so i hope someone who's more familiar with Civ5 can give you some instructions.

    -----
    And nice to see that the people already begin to do something :goodjob:.
     
  3. Soduka

    Soduka Warlord

    Joined:
    Sep 2, 2007
    Messages:
    289
    There is not, it's all done through My Documents (At least as of this patch/no expansions)
     
  4. Civ Fuehrer

    Civ Fuehrer Eat, Sleep, Mod

    Joined:
    May 8, 2008
    Messages:
    1,227
    Location:
    CA, USA
    Well, as of now, Valkrionn is taking mod packing requests, you just give him your files and tell him what you want as the name/description/version number/etc so that you won't have to overwrite important files in the Sid Meier's Civilization 5 directory. He'll PM you the files back and you can post them here.

    @ The_J
    The mod directory is under Documents/My Games/Sid Meier's Civilization 5/MODS
     
  5. Soduka

    Soduka Warlord

    Joined:
    Sep 2, 2007
    Messages:
    289
    .....
     
  6. DireAussie

    DireAussie Chieftain

    Joined:
    Nov 12, 2005
    Messages:
    60
    If you know what you're doing it aint a problem..as I said you should back up the original files first. Until they release SDK/modbuddy I can't package it into a mod.
     
  7. magus424

    magus424 Chieftain

    Joined:
    Sep 26, 2010
    Messages:
    17
    Sure you can - just download one of the example mods and look at the format :)



    ^ all done as a mod, not modifying the game files :)
     
  8. Ihmemies

    Ihmemies Nikon F2

    Joined:
    Jul 26, 2004
    Messages:
    76
    Seems like mods don't work if you didn't install civ 5 on C:\>

    I have neither documents or civ installed on C... so overwriting is the only option for now.
     
  9. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,118
    Location:
    Germany / Netherlands
    Thanks for mentioning it :).
    I don't have Civ5, so i didn't know that and i just assumed it was done in the Civ4 way.

    Modders do...users don't.
     
  10. DireAussie

    DireAussie Chieftain

    Joined:
    Nov 12, 2005
    Messages:
    60
    Point taken; its now a mod!!! :) :) :)
     
  11. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
    I was actually about to pack it for you. :lol:

    Any objections to me including this in my own mod, when it's released? Interface rewrites of this sort likely won't be too compatible with each other, not in the same way that xml changes are, otherwise I wouldn't be asking. ;)
     
  12. DireAussie

    DireAussie Chieftain

    Joined:
    Nov 12, 2005
    Messages:
    60
    I'm happy for you to include it but people might prefer their build queues done a different way! This was my personal preference.

    Agree with the incompatibility. Changing the core .lua files and keeping them up to date is a pain - I had to redo the changes to the productionpopup.lua file because the most recent patch included new code to fix the puppet state exploit :(
     
  13. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
    Yeah. Adding new interface elements is quite easy, and you can use new lua files whenever you add things... But tweaking existing code is more problematic.

    Just to give a summary of changes I've made thus far:
    • Bonus resources (non-luxury, non-strategic) grant higher yields when improved. This is liable to change, depends on when I get around to implementing something.
    • Building costs reduced by 20%.
    • Tech costs increased by 50%.
    • Wealth process buffed to 25% efficiency.
    • Engineer buffed to 2 hammers.
    • Workshop tile improvement added; 1 hammer, -1 food, +1 hammer with Steam Power, requires flatland, uses Manufactory (engineer improvement) art.
    • Your build queue mod, now.
    • Magus424's LuxuryResourceDisplay, granted he gives permission.

    Many more changes planned, and I've got you listed in the 'Special Thanks' field. ;)
     
  14. DaniDE

    DaniDE Chieftain

    Joined:
    Sep 28, 2010
    Messages:
    4
    Hi there.

    Any hints on what to do if the game does not recognize the civ5mod file in the proper mod folder?

    Could you post the lua files too for me to overwrite? This method at least works for me :D

    Thanks in advance,
    Dani

    Edit: Ok, the first file works, the second file is not being recognized, even when renamed without special characters in the filename. Strange.
     
  15. WeneedmoreCivs

    WeneedmoreCivs Warlord

    Joined:
    Sep 22, 2010
    Messages:
    125
    Which mod is that with all the resources?
     
  16. DireAussie

    DireAussie Chieftain

    Joined:
    Nov 12, 2005
    Messages:
    60
    Just need to rename the .civ5mod to .7z, download http://www.7-zip.org (better than winzip and free) then extract.
     
  17. Deon

    Deon Lt. of Mordor

    Joined:
    Jan 13, 2008
    Messages:
    2,954
    Location:
    St.Petersburg, Russian Federation
    Why should you rename? Just open it with 7zip :).
     
  18. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
    Found a logic bug in your code (rather, people playing my mod did, and told me about it :lol:). Basically, you are counting purchased items twice.

    First: I'm condensing it to just the logic issue, the rest of the code is fine (though I've tweaked somethings in mine, as the queue can be toggled again; Unimportant for this).

    Your code:
    Code:
    if qMode then
        [I]Production Code[/I]    
    else
        [I]Production Code[/I]
    end 
    
    if not g_IsProductionMode then
        [I]Purchase Code[/I]
    end
    Since qMode is only true if it is both Append AND ProductionMode (as opposed to purchase), when you buy things this becomes false, and pushes you into the else statement. Unfortunately, that else statement is still meant to be handling production, not purchasing, and it is located PRIOR to the purchase code, meaning it is added to the queue first... Meaning if it is something which requires a resource, you may be unable to buy it because of this bug (your last resource used by the instance placed in the queue).

    Corrected code:
    Code:
    if qMode then
        [I]Queue Code[/I]
    elseif gIsProductionMode then
        [I]Production Code[/I]
    else
        [I]Purchase Code[/I]
    end
    As you can see, very small change. Just combined the conditionals. ;)
     
  19. magus424

    magus424 Chieftain

    Joined:
    Sep 26, 2010
    Messages:
    17
    It's my "Luxury Resource Display", available in the mod hub in-game :)
     
  20. DireAussie

    DireAussie Chieftain

    Joined:
    Nov 12, 2005
    Messages:
    60
    I think that's my fault, forgot to update md5's in the mod info file, civ 5 must check these.
     

Share This Page