View Full Version : Improved Build Queue Mod


DireAussie
Sep 25, 2010, 12:18 AM
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 (http://forums.civfanatics.com/showthread.php?p=9678872&posted=1#post9678872).

The_J
Sep 25, 2010, 08:52 PM
Instructions: save the zip file to your "sid meier's civilization v" directory, then unzip to that directory. Overwrite the 2 files CityView.lua and ProductionPopup.lua

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:.

Soduka
Sep 25, 2010, 10:57 PM
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:.

There is not, it's all done through My Documents (At least as of this patch/no expansions)

Civ Fuehrer
Sep 26, 2010, 12:26 AM
There is not, it's all done through My Documents (At least as of this patch/no expansions)

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

Soduka
Sep 26, 2010, 12:33 AM
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

.....

DireAussie
Sep 26, 2010, 06:53 AM
Aaahhh...never do that

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.

magus424
Sep 26, 2010, 09:37 PM
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.

Sure you can - just download one of the example mods and look at the format :)

http://imgur.com/S1CoB.png

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

Ihmemies
Sep 27, 2010, 04:54 AM
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.

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.

The_J
Sep 27, 2010, 09:22 PM
@ The_J
The mod directory is under Documents/My Games/Sid Meier's Civilization 5/MODS

There is not, it's all done through My Documents (At least as of this patch/no expansions)

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.

If you know what you're doing it aint a problem

Modders do...users don't.

DireAussie
Sep 27, 2010, 11:43 PM
Point taken; its now a mod!!! :) :) :)

Valkrionn
Sep 27, 2010, 11:58 PM
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. ;)

DireAussie
Sep 28, 2010, 12:12 AM
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 :(

Valkrionn
Sep 28, 2010, 12:21 AM
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. ;)

DaniDE
Sep 28, 2010, 11:21 AM
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.

WeneedmoreCivs
Sep 28, 2010, 11:29 AM
Sure you can - just download one of the example mods and look at the format :)

http://imgur.com/S1CoB.png

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

Which mod is that with all the resources?

DireAussie
Oct 01, 2010, 03:40 AM
Could you post the lua files too for me to overwrite? This method at least works for me

Just need to rename the .civ5mod to .7z, download http://www.7-zip.org (http://www.7-zip.org/) (better than winzip and free) then extract.

Deon
Oct 01, 2010, 04:09 AM
Why should you rename? Just open it with 7zip :).

Valkrionn
Oct 02, 2010, 10:52 PM
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:
if qMode then
Production Code
else
Production Code
end

if not g_IsProductionMode then
Purchase Code
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:
if qMode then
Queue Code
elseif gIsProductionMode then
Production Code
else
Purchase Code
end

As you can see, very small change. Just combined the conditionals. ;)

magus424
Oct 03, 2010, 02:27 AM
Which mod is that with all the resources?

It's my "Luxury Resource Display", available in the mod hub in-game :)

DireAussie
Oct 03, 2010, 11:54 PM
Edit: Ok, the first file works, the second file is not being recognized, even when renamed without special characters in the filename. Strange.

I think that's my fault, forgot to update md5's in the mod info file, civ 5 must check these.

DireAussie
Oct 04, 2010, 06:14 AM
Ok, I have fixed the problems people have mentioned (thanks Vakrionn).

Have added a new feature - saving and restoring of build queues!!!!!!!!!!!! See the notes on how to use it. Other mod creators may also find my saving and loading of data code useful (it uses Firaxis's Modding class).

Mod is now also available in-game in the mod downloads.

Valkrionn
Oct 04, 2010, 08:22 AM
Ok, I have fixed the problems people have mentioned (thanks Vakrionn).

Have added a new feature - saving and restoring of build queues!!!!!!!!!!!! See the notes on how to use it. Other mod creators may also find my saving and loading of data code useful (it uses Firaxis's Modding class).

Mod is now also available in-game in the mod downloads.

I will have to check that out. :goodjob:

Some changes I made that you may or may not want to check out (made by popular demand :p):


Hide the checkbox entirely, as it does nothing.
Set the build list to only expand if the queue is greater than 1, rather than 0; This way people who do not want it can ignore it.
Set a click to function like the ctrl-click. Shift-click appends in back, ctrl-click in front. Same behavior is Civ4, basically, and allows you to always have it on without annoying those who don't want it.

DireAussie
Oct 04, 2010, 08:59 PM
I have uploaded version 4 which fixes a bug in the one I loaded up yesterday. Sorry about that!

Thanks for the 3 suggestions, I'm happy the way it works as is at the moment. Though more than happy for you to change for your own mod. I dont anticipate many more updates for this mod, especially since Firaxis could wipe it out all in 1 patch by putting in their own 'better queues' code. The only thing I really have on my wish list now is being able to click items in the list to remove them.

edit - will look into point 3. Agree that it is probably better the same way as civ 4. Reinstalling civ 4 now...

DireAussie
Oct 04, 2010, 10:34 PM
Set a click to function like the ctrl-click. Shift-click appends in back, ctrl-click in front. Same behavior is Civ4, basically, and allows you to always have it on without annoying those who don't want it.

What I have done is swapped around shift and ctrl-click.

Problem is that I dont want people doing a normal left-click and removing their entire queue possibly by accident; however I also want a quick way of people being able to reset the entire queue without having to go back to the city screen and deleting everything. Thirdly, I want all build screens to be 100% consistent in their usage.

I think now this is the best compromise.

Valkrionn
Oct 04, 2010, 10:40 PM
Up to you. ;)

For what it's worth, though, the functionality I proposed is identical to that of Civ4. Players are used to it, and it's easy to learn, so I wouldn't worry much about people accidentally wiping queues.

lukeloh
Nov 03, 2010, 03:43 AM
Hi DireAussie, thanks - I've been using this mod and it works great.

Just one problem - once a city has been set to build Wealth or Research the permanent Add to Queue does not allow me to change the build queue.

Would it be possible to allow the unchecking of "Add to Queue" so that we can Change Production (and then set things back to queue mode)? Right now whenever I want to switch from Wealth/Research I need to unload this mod, change the production, and then re-enable the mod.

Thank you for this great addition.

DaniDE
Nov 10, 2010, 01:03 PM
Thanks for all your work, it´s really appreciated. Could not play without it anymore :)

-Dani

lukeloh
Jan 01, 2011, 11:31 PM
Hi, just wanted to note that this mod is not fully compatible with 1.0.1.141.

Happens after conquering a city and choosing View City from the Annex/Puppet/Raze screen.

Once a city is viewed, build queues are disabled from all cities. Fixed with a save/reload.

Really like this mod, hope it will be updated!

Bananijoe
Mar 09, 2011, 07:04 AM
Since i was successful with "fixing" "Active City Defense"
.. i tried my luck here as well.

look here;
MOD-Incompatibility: Active City Defense (v 2) (http://forums.civfanatics.com/showthread.php?p=10287907#post10287907)
MOD-Incompatibility: Improved Build Queue Mod (http://forums.civfanatics.com/showthread.php?p=10287964#post10287964)

MOD-Incompatibility fixed
Looked for changes to the vanilla:
- CityView.lua
- ProductionPopup.lua

and found some..
then migrated Direaussies Code from the old file to the new ones..
... was quite a lot of code from aussie so i was very doubtful that this might work ...

But it seems it did! :crazyeye:

Uploading the zipped LUA-file still rusults in an error so here the code!
I´ll ask anyone with programming-skill (since i have nearly none) to verify my copy&paste-adventure

... hmmm the Code of the 2 lua-Files is too long
I´ll try to upload them later...

Bananijoe
Mar 09, 2011, 10:30 AM
sorry wrong threat...
this post can be deleted!

Karantaner
Aug 15, 2011, 01:02 AM
any chance for an update of this MOD? I think it is not compatible this the latest patch. In my last game with this MOD activated I could very often not select new items for the building queues: I got the message "choose production" but then nothing happend. I had to save, exit to main menu and re-load the game - then the building queue worked fine again.

It would really be great to get an update - this mod is just great and makes life much easier.

Karstedt
Sep 11, 2011, 01:11 AM
^^^^^^ This.

Anyone with some modding experience able to fix this gem?