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

No building of world wonders by AI (civ 5 gods & kings)

Discussion in 'Civ5 - Modpacks' started by simon26333, Jan 19, 2013.

  1. simon26333

    simon26333 Chieftain

    Joined:
    Jan 18, 2013
    Messages:
    2
    I've created a mod for civilization 5 that stops the AI building world wonders, leaving them for humans only :)

    install
    0. download attached
    1. extract the zip including the folder itself to
    C:\Users\[profile]\Documents\My Games\Sid Meier's Civilization 5\MODS
    2. start the game choose mods
    3. check the mod (green checkbox)
    4. click next etc
    5. repeat steps 2-4 if reloading the game (or every time you want the mod to be active)
     

    Attached Files:

  2. isnorden

    isnorden Amnesiac Modder

    Joined:
    Jul 6, 2012
    Messages:
    608
    Location:
    Madison, Wisconsin, USA
    Thank you! I'd tried to write a similar mod myself with Lua, but it didn't work when I installed it.
     
  3. FramedArchitect

    FramedArchitect Reluctant Modder

    Joined:
    Mar 25, 2012
    Messages:
    798
    Location:
    Missouri
    Well, technically this mod won't disallow AI to build wonders because it only changes flavors. I suppose if a wonder is the only thing in an AI's build list, it will built it...

    If you wanted to remove even the possibility of AI building a wonder, you could do it like this...

    Code:
    INSERT INTO Civilization_BuildingClassOverrides  (CivilizationType, BuildingClassType, BuildingType)
    SELECT 'CIVILIZATION_EGYPT', 'BUILDINGCLASS_PYRAMIDS', NULL;
    
     
  4. simon26333

    simon26333 Chieftain

    Joined:
    Jan 18, 2013
    Messages:
    2
    For all practical purposes no it never will, as the AI always has something else it can put production towards. I have tested it.

    I disabled FLAVOR_WONDER because (I think) it would be useless to the AI, the AI can build National Wonders through the other flavors. Redirecting Wonders to null I would have thought would also stop the human player building them (but I don't know).
     
  5. Hyronymus

    Hyronymus Troop leader

    Joined:
    Nov 25, 2003
    Messages:
    1,865
    Gender:
    Male
    If you can't beat the AI's Wonder programme this is surely your solution. I wonder how many people will use it.
     
  6. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,354
    Location:
    Near Portsmouth, UK
    So much easier with Lua

    Code:
    function OnCityCanConstruct(iPlayer, iCity, iBuilding)
      -- Is this building a World Wonder?
      -- (Note.  We should optimise this by caching a list of building IDs (iBuilding) which are world wonders at load time)
      if (GameInfo.BuildingClasses[GameInfo.Buildings[iBuilding].BuildingClass].MaxGlobalInstances == 1) then
        -- Yes, so only humans may build it
    	return Players[iPlayer]:IsHuman()
      end
    end
    GameEvents.CityCanConstruct.Add(OnCityCanConstruct) 
    
     
  7. FramedArchitect

    FramedArchitect Reluctant Modder

    Joined:
    Mar 25, 2012
    Messages:
    798
    Location:
    Missouri
  8. ViltusVilks

    ViltusVilks Chieftain

    Joined:
    Jan 23, 2013
    Messages:
    1
    its working, nice :goodjob:
     
  9. daruskiy

    daruskiy Chieftain

    Joined:
    Aug 5, 2012
    Messages:
    6
    is it possibly to make this work for custom wonders like from ambrox ?
     
  10. Teutorix

    Teutorix Chieftain

    Joined:
    Jan 15, 2009
    Messages:
    21
    Isnt this just cheating?

    When i think mod i think of new content or gameplay rebalance not crippling the already terrible AI
     
  11. Frejoh466

    Frejoh466 Chieftain

    Joined:
    Jun 21, 2012
    Messages:
    6
    Is it possible to create a mod so that only one can start building the wonder? If I start building the great wall, no one else can start to build the great wall.

    So when someone start the building of a wonder the option to build that wonder disappear from the other player.
     
  12. Cbagdonas

    Cbagdonas Chieftain

    Joined:
    Aug 2, 2013
    Messages:
    2
    I tried this mod on brave new world and it didn't work. Do u have an updated version? Or does anyone know of a way I can stop the ai building them?
     
  13. Keinjuan

    Keinjuan Chieftain

    Joined:
    Dec 7, 2006
    Messages:
    10
    I downloaded it a couple days ago and it's working like a charm. Maybe you have to start a new game?
     
  14. boyd94

    boyd94 Chieftain

    Joined:
    Aug 7, 2013
    Messages:
    6
    Just signed up for advice on this:

    I'm trying to make a scenario on a Giant Earth map (with true start locations mod) that gives Wonders to their rightful historical builders, i.e. Egypt gets the Pyramids, Greece gets Artemis etc. This is really for greater historical immersion and I'd probably just disable it for all games not played on the Earth map.

    I'm just wondering if this is feasible/possible? I have zero modding/programming experience, have read a couple of lua tutorials, I know basically how the Firetuner works to troubleshoot and have crudely adapted the custom traits tutorial thing posted very recently; my idea being to add the Wonders to the unique trait, free with their corresponding tech (no build-time). I've removed syntax errors but my code is surely incomplete as it has no effect.

    I'm wondering if my above approach is even possible, or if there is an easier way? I could post the code I have so far, I know it's very incomplete and I'm probably missing quite a few elementary components.

    1) Would this be worth creating a new thread?

    2) If my above method of giving Wonders to their historical civilizations is misguided or impossible, what other methods would you suggest? Would it be easier/possible to disallow all civilizations except the correct one, and simply keep the build-times?

    If nothing else works, I think I'll simply use this mod and remove Wonders entirely. I'd probably have to design an entirely new UA for Egypt though, probably adapting from an old Civ installation.
     
  15. murray1993

    murray1993 Chieftain

    Joined:
    Aug 22, 2013
    Messages:
    13
    this is so funny LOL
    i cant wait to see AI's faces!
     
  16. Zyni

    Zyni Chieftain

    Joined:
    Nov 30, 2013
    Messages:
    3
    hi,

    anyone else used the mod ?

    i really hate it if another civ build wonders which a mine (all wonders are mine :))

    In a first go i have no problem, no wonders build. But now the $§&"$§ city states do want wonder after wonder and the AI ignore the mod and build these wonders.
    I know that in this mod function this way that the AI don't desire to build wonders, but it looks that there is no line in the mod who prohibit the AI from trying to impress the city states...

    I have no idea where to get the info how this line could look like and i think the lines "FramedArchitect" wrote are only an example .. in this case that egypt couldn't build the pyramids. Same with whoward69
     
  17. Zyni

    Zyni Chieftain

    Joined:
    Nov 30, 2013
    Messages:
    3
    hmm bump
     
  18. Hambil

    Hambil Emperor

    Joined:
    Oct 16, 2006
    Messages:
    1,100
  19. Zyni

    Zyni Chieftain

    Joined:
    Nov 30, 2013
    Messages:
    3
    sounds nice ^^ but not enough for me :-/
     
  20. unfairlane

    unfairlane Warlord

    Joined:
    Jan 6, 2009
    Messages:
    168
    Location:
    Correze - France

    Yeah, I Wonder too ;)
     

Share This Page