1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Current Status of Lua Modding

Discussion in 'Civ6 - Creation & Customization' started by LeeS, Nov 2, 2016.

  1. PlotinusRedux

    PlotinusRedux Chieftain

    Joined:
    Jul 11, 2013
    Messages:
    196
    I looked at that myself, but from what I can tell anything executed through ContextPtr is going to be somewhere in a UI context, inheriting from the context in which the LoadNewContext was run.

    I've looked at several kludging ideas, but I'm not happy with any of them, so while I'll probably keep experimenting, I'm hoping they just release a patch that fixes the GameplayScripts reload--and allows UI only mods to work with games that weren't created with them enabled.
     
  2. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    5,562
    Location:
    Illinois, USA
    New info as of the release of the Winter 2016 Patch.
    1. Please see alteration to #1 in OP. Gameplay Scripts are indeed reloading now along with a saved game
    2. Custom lua files that are "Imported" and "included" are still not loading into the main lua file that contains the include() command. Unless I am doing something fundamentally wrong. This would include things such as William Howard's PlotIterators.lua utility from civ5, for example, or either of my own plot data-gathering utilities from civ5.
      • Would appreciate a confirmation
    3. Mods are enabled by default unless/until you un-enable them.
      • This also pertains to editing a modinfo file for example, or adding a new mod to the MODS folder. Both these act as auto-enable.
      • Have not made up my mind whether this is very good or very bad
     
  3. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    7,644
    Location:
    France
    1/ is great news
    3/ must be a bug
     
  4. sp00n

    sp00n Chieftain

    Joined:
    Jan 4, 2007
    Messages:
    347
    Is it possible to only replace specific functions for a LUA file, instead of having to use the whole file, which maybe just includes 1 or 2 changed lines?
    I've found this thread for Civ5, but apparently it was never resolved / didn't work there.
     
  5. PlotinusRedux

    PlotinusRedux Chieftain

    Joined:
    Jul 11, 2013
    Messages:
    196
    @sp00n unfortunately no, unless they're exposed as LuaEvents you can capture.
     
  6. greyTiger

    greyTiger Chieftain

    Joined:
    Oct 7, 2010
    Messages:
    198
    Location:
    Australia
    Has anyone been able to get a popup window to appear\disappear using the UIManager: QueuePopup and UIManager: DequeuePopup methods?
    I have looked at the popups that come with the game to get an idea of how it works but just can't get it quite right.

    modinfo
    Code:
        <Components>
           <UserInterface>
               <Properties>
                   <Context>InGame</Context>
               </Properties>
               <Items>
                   <File>UI/Popups/InGameCivAndCityRankings.xml</File>
               </Items>
           </UserInterface>
        </Components>
    
        <Files>
           <File>UI/Popups/InGameCivAndCityRankings.xml</File>
           <File>UI/Popups/InGameCivAndCityRankings.lua</File>
       </Files>
    
    popup xml
    Code:
    <Context>
        <Container ID="WorldPopups">
            <LuaContext ID="InGameCivAndCityRankingsPopup" FileName="InGameCivAndCityRankings" Hidden="1"/>
        </Container>
    
        ... window controls
    </Context>
    
    The popup window is always visible, even though the Hidden property was set to true, and when I call the UIManager: DequeuePopup the window does not close.
    I have tried several combinations of values for the Context and LuaContext entities but have had no luck. The rest of my code does execute though as my rankings list is displayed in the window.

    If anyone could provide any assistance it would be greatly appreciated. Thanks.

    UPDATE: I managed to get this sorted eventually. Working solution can be seen in my Golden Ages mod, but basically I needed to have an Xml that was imported using the <UserInterface> tag that does not show in game but is used as a container for the references to the luacontext on the actual popup xml.
     
    Last edited: Apr 14, 2017
  7. StormingRomans

    StormingRomans Chieftain

    Joined:
    Mar 27, 2017
    Messages:
    36
    Gender:
    Male
    Location:
    London, UK
    Have spent the last 4 hours trying to do this, with no success. Existing files work fine, but custom lua files from your own mod just don't seem to work. But then again, I could be doing something totally wrong too....
     
  8. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    7,644
    Location:
    France
  9. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    5,562
    Location:
    Illinois, USA
    Item #1 in the op:
    As noted, this issue was fixed in the Winter 2016 patch. These Gameplay Scripts are now properly activated when a saved game is loaded.

    ImportFiles type for "FrontEnd Actions" became available with the latest patch (according to Sukritact) and this now allows for "Front End" UI files to be replaced with modded versions. Front End actions so far as I am aware do not support GameplayScripts. This makes sense because there is nothing really for GameplayScripts to do until the player is "in-Game".
     

Share This Page

Ebates: Get Paid to Shop