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

Create a Custom Game from a WB Scenario

Discussion in 'Civ5 - Modding Tutorials & Reference' started by whoward69, Jul 28, 2011.

  1. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,201
    Location:
    Near Portsmouth, UK
    Introduction
    The goal of this tutorial is to enable you to be able to create Custom Games from World Builder maps and/or map scripts such that they can be played from the Custom Game menu.





    The tutorial starts by showing you how to create (and play) a World Builder Map Scenario, with simple to follow, step-by-step instructions.

    The tutorial then proceeds to show you how to convert the scenario into a mod, such that it can be shared with other players by means of the ModHub. Instructions on how to play the scenario as a mod are also given.

    The tutorial then shows you how to convert the scenario mod into a custom game mod (using pre-built components) and instructions on how to start the custom game are also given.

    Finally, the tutorial shows you how to use the pre-built components to enable and/or disable key features of configuring a custom game – civilization, map and difficulty selection.

    By the end of the tutorial you will have a fully working, configurable, custom game based on both a World Builder created map and a standard map script.

    Assumptions
    This tutorial assumes that you:
    • Understand the basics of XML, SQL and Lua
    • Know how to download, install and enable a mod from the in-game ModHub
    • Have the Civilization V SDK installed
    • Know how to use ModBuddy to create and deploy a simple mod
    • Have the debug logs enabled, know where they are and know how to look for errors in them (specifically database.log, lua.log and xml.log)
    • Know how to use LiveTuner (FireTuner) to test and debug a mod
    • Know how to use World Builder to create a map
    • Know how to upload a mod to the ModHub
    • (Optional) Know how to create .dds format images

    Compatibility
    This tutorial was written with Civilization V 1.0.1.332 and also tested with 1.0.1.348

    Download
    Download and install the "TradersScenario" from my mod web-site. Once installed the PDF Tutorial Guide can be found at "...\My Documents\My Games\Sid Meier's Civilization 5\MODS\TradersScenario (v 1)\WB Scenario and Custom Game.pdf"
     
  2. manolek

    manolek Chieftain

    Joined:
    Jul 27, 2011
    Messages:
    6
    Great guide, grats whoward69 :)
    Well explained and perfect exposed.

    I am a beginner modder and would greatly appreciate some help

    I applied to my mod "Planeta Historia", (downloadable hub) to get scenarios menus. Everything works fine, but I have included a modal window in ScenarioVictoryProgress.lua and I can't back.

    Code for modal popup window:
    Spoiler :
    local popupInfo = {
    Data1 = 500,
    Type = ButtonPopupTypes.BUTTONPOPUP_TEXT,
    }
    popupInfo.Text = Locale.ConvertTextKey("TXT_KEY_VICTORY_TEXT");


    Click the button to close and not close, it stays in that condition, obviously back button dont work. I have looked everywhere civfanatics and I could not find the answer. I think I've forgotten any process onBack() but not how to do.

    Everything works perfectly but close button in modal window does not work when you press.

    Thx for your great tutorial
     
  3. Catalonia

    Catalonia Chieftain

    Joined:
    Jan 4, 2012
    Messages:
    118
    So how can I create this type of scenarios?
     
  4. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,201
    Location:
    Near Portsmouth, UK
    Last paragraph of the original post ... "Download and install the 'TradersScenario' from the ModHub (listed under 'Other'). Once installed the PDF Tutorial Guide can be found at '...\My Documents\My Games\Sid Meier's Civilization 5\MODS\TradersScenario (v 1)\WB Scenario and Custom Game.pdf'"
     
  5. Catalonia

    Catalonia Chieftain

    Joined:
    Jan 4, 2012
    Messages:
    118
    Yes I read it but I can't find this scenario... I searched it but nothing...
     
  6. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,201
    Location:
    Near Portsmouth, UK
    ... not very hard then!

     
  7. Catalonia

    Catalonia Chieftain

    Joined:
    Jan 4, 2012
    Messages:
    118
    Ah, sorry, I find it in this forum... Downloading, thanks
     
  8. Genghis.Khan

    Genghis.Khan Person

    Joined:
    Jun 9, 2012
    Messages:
    934
    Location:
    Somewhere
  9. Genghis.Khan

    Genghis.Khan Person

    Joined:
    Jun 9, 2012
    Messages:
    934
    Location:
    Somewhere
  10. Genghis.Khan

    Genghis.Khan Person

    Joined:
    Jun 9, 2012
    Messages:
    934
    Location:
    Somewhere
  11. Craig_Sutter

    Craig_Sutter Chieftain

    Joined:
    Aug 13, 2002
    Messages:
    2,724
    Gender:
    Male
    Location:
    Calgary, Canada
    Is the pdf file still included in your island traders scenario at the "pick n mix" home?
     
  12. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,201
    Location:
    Near Portsmouth, UK
  13. SgtCiv

    SgtCiv Chieftain

    Joined:
    Apr 19, 2011
    Messages:
    226
    Location:
    TEXAS
    I'm trying to build a WB scenario with 16 civ's and for all of the selected Civ's to start with three cities each. I only have 5 more cities to place and I have run into a CTD when trying to place any one of the last cities left to place.

    Here is the log that was placed on my desktop after the CTD:
    View attachment 367692

    Here is the Map I'm working with:
    View attachment 367693
    Note- I haven't enabled any MOD's trying to work with this yet, but I do have all of the DLC's except the newest map packs that came out. My SDK and CivV is up to date.

    Thanks for any feed back on this issue.
     
  14. Craig_Sutter

    Craig_Sutter Chieftain

    Joined:
    Aug 13, 2002
    Messages:
    2,724
    Gender:
    Male
    Location:
    Calgary, Canada
    I am using your sample files to create my own custom game and it is working wonderfully as expected. One thing I would like to have selectable as an option choice is game speed however. I would make the attempt myself but I have not done any UI modding. Would the set up in lua be similar to the way you set up the selections for game difficulty? If so, then I can try to backward engineer something using the game difficulties set up as a model... or am I totally barking up the wrong tree and wasting my time trying to do things this way?
     
  15. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,201
    Location:
    Near Portsmouth, UK
    It's been years (literally) since I looked at this, but I can't think of any reason why you couldn't set custom game speeds in much the same way as the difficulty level.

    Rather than dive into UI modding (and there are some rather good tutorials on this even if I say so myself ;) ), I'd suggest that you test it out by fixing the difficulty and hi-jacking the difficultly drop-down for the game speed. Once you have confirmed that changing the game speed is possible, you can then work out how to add another drop-down to the scenario setup screen.
     
  16. Scotch0101

    Scotch0101 Centurion

    Joined:
    Jun 1, 2014
    Messages:
    138
    Location:
    A cool place
    there's no pdf in there for me...it just gives me a .civ5mod file, when I click it says 'windows cannot open file'.....help please!
     
  17. bane_

    bane_ Howardianism High-Priest

    Joined:
    Nov 27, 2013
    Messages:
    1,559
    Extract it like a *.zip file.
    Right-Button Click -> Open with... -> WinZIP/WinRAR/7z/Similar

    or
    Right-Button Click -> Open -> Select a Program from a List (or whatever) -> WinRAR/Winzip/7z/Similar.

    There are other ways as well, but this is the simpler in my opinion.
     
  18. Scotch0101

    Scotch0101 Centurion

    Joined:
    Jun 1, 2014
    Messages:
    138
    Location:
    A cool place
  19. king_dean

    king_dean Chieftain

    Joined:
    May 6, 2007
    Messages:
    198
    This is pretty cool and I have successfully implemented it into CivRome, but it desperately needs 'random seed' in both the random map and the scenario. How do we put 'random seed' into the Lua script?
     
  20. king_dean

    king_dean Chieftain

    Joined:
    May 6, 2007
    Messages:
    198
    It would be better if the scenario was auto-selected and random map was displayed below (instead of vice versa). What changes to the code would I have to make to do that?
     

Share This Page