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

How do I load a modded Lua file?

Discussion in 'Civ5 - SDK / LUA' started by rspeer, Sep 30, 2010.

  1. rspeer

    rspeer Spearman

    Joined:
    Apr 5, 2006
    Messages:
    101
    I'm trying to make a tiny change to the game's interface Lua in Terra Incognita, so that after you load the mod it becomes the currently selected map script. One less step for users to go through.

    The way to change this seems to be to modify UI\FrontEnd\GameSetup\GameSetupScreen.lua. I copied it into Lua\GameSetupScreen.lua in my mod, changed what I wanted, and... nothing.

    I can put print statements, blatant errors, whatever I want into this script and it doesn't seem to change anything in the game or in FireTuner.

    How do I tell the game to actually load my version of the script? Kael's guide doesn't say.
     
  2. salaminizer

    salaminizer Colorado Internacional

    Joined:
    Aug 12, 2006
    Messages:
    221
    Location:
    Porto Alegre, Brasil
    you shouldn't need to do anything.
    are you going through Mods -> Single Player to run it or starting a game from the main menu? if you don't use the Single Player option from Mods menu you won't be loading any mod.
    other than that, are you sure that there are no errors in LUA?
     
  3. rspeer

    rspeer Spearman

    Joined:
    Apr 5, 2006
    Messages:
    101
    I am, in fact, loading the mod and running it correctly, as evidenced by the fact that the rest of the mod (which is just a map script) works fine. The Lua doesn't give an error, either, based on my experience of what a Lua error looks like: if I put an error in my map script, it will definitely show up on the FireTuner and probably crash the game for good measure.

    But I can type nonsensical function calls into my UI script with no effect at all. That's why I conclude that the Lua code is simply not running.
     
  4. ArgentumStudios

    ArgentumStudios Warlord

    Joined:
    Sep 18, 2010
    Messages:
    122
    Location:
    Utah, US
    That's strange. Are you adding your lua file to the Content section of the project properties?
     
  5. rspeer

    rspeer Spearman

    Joined:
    Apr 5, 2006
    Messages:
    101
    Kind of. I didn't know whether it had to be in Content, and I have no idea what its type should be. So I kind of half-assed it and made up the type (InterfaceMod). If it's supposed to be in there with a particular type, that explains everything.
     
  6. ArgentumStudios

    ArgentumStudios Warlord

    Joined:
    Sep 18, 2010
    Messages:
    122
    Location:
    Utah, US
    Actually I just removed it from mine and it still loaded. However, rereading your original post, I'm not sure we can override the game setup screens through lua. They may be loaded already by the time mods get loaded, so it may just be ignoring your file. Have you tried renaming the file to a unique name and putting a print statement at the top to see if that shows up in Tuner?
     

Share This Page