(Suggestion) Wonder Randomiser

Discussion in 'Civ5 - Creation & Customization' started by Cliomancer, Nov 14, 2012.

  1. Cliomancer

    Cliomancer Chieftain

    Joined:
    Oct 7, 2012
    Messages:
    95
    As the modder's guide suggests, too much of a good thing can be kind of a bad thing.

    With all these great mods available for Civ, my modded games end up with a load of wonders available to build in several eras.

    What I'd like to see would be a mod that allowed you to state a set limit on the number of wonders which would be available to build during your game during each era and then randomly choose them from the wonders available from the base game's set and all the wonder mods you have installed.

    Is this doable?

    (Moderartors: The setup of the forums seems to have changed since I was last here, so I wasn't sure if this would be the right place to post this.)
     
  2. Gedemon

    Gedemon Modder Super Moderator

    Joined:
    Oct 4, 2004
    Messages:
    10,038
    Location:
    France
    Moderator Action: thread moved to main C&C forum, the subforums are for finished mods/files/tutorials ony

    Should be doable using Lua, yes.
     
  3. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,557
    Location:
    Near Portsmouth, UK
    There are two main issues to solve,
    1) only allowing a few of the various wonders available to be built in any era from the list of possibles
    2) removing the ones that can't be built from the tech tree display (so players know what techs to target)

    Both are doable in Lua

    1) At game start, build per era lists of all wonders available in that era, shuffle it, and for the first N add a boolean flag to the mod save data that this wonder can be built, and for the rest of the list a flag saying it can't be built. On game load, just reload the flags. Then add a GameEvents.CityCanConstruct() listener and if it's for a wonder return the associated boolean flag value. (There are several posts on these forums with examples of CityCanConstruct)

    2) You'll need to edit the core TechButtonInclude.lua file and only add wonders to the validBuildingBuilds list if their associated flag is true
     

Share This Page