| General | Hosted Sites | Civ5 | CivRev | Civ4Col | Civ4 | Civ3 | Civ2 | Civ1 | Misc | Marketplace |
![]() |
|
|
Welcome to Civilization Fanatics' Center. You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support. |
|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Esus (Allegedly)
Join Date: Feb 2011
Location: Ireland
Posts: 391
|
Removing Buildings/Units from Build Queue Using Python
Hi, does anyone know how I can remove an item from the build list for a city using python.
In my mod, hammers towards the construction of certain buildings and units are transferred from one city to another. The original city still includes the building/unit in it's build queue. This is fine in most cases but where the building in question is a world wonder or from a unit class which only allows a certain number, then one turn of construction can be lost. Note: the city from which the hammers are transferred is converted to a Settlement (similar to FFH Kuriotates) so the player can not manually remove the wonder/hero from the city's build queue. In the following turn, the construction of the wonder/hero can continue using all of the transferred hammers. I'd like to remove the wonder/hero from the original build queue so that the turn of construction is not lost.
__________________
Avatar kindly provided by Ceika. I have a theory that all fish can fly. Most don't because they suffer from swinophobia. |
|
|
|
|
|
#2 |
|
Deity
Join Date: Jul 2009
Location: Texas
Posts: 3,027
|
You can remove the current item in the production queue via something like "pCity.popOrder(0, false, true)" since the first argument for that is the order number and order number 0 is the one that is currently being worked on.
If you want to search the entire queue, there are a variety of CyCity member functions involved like getOrderQueueLength, getOrderFromQueue, and the already mentioned popOrder. Look at the Python API, which you can get to via the Modiki (or directly, here) for more details on the calls.
__________________
Mod: Final Frontier Plus, version 1.81 released 27-June-2012 Mod: Rocks 2 Rockets, version 0 patch 0.3 released 9-April-2013 |
|
|
|
![]() |
| Bookmarks |
|
| Thread Tools | |
|
|