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

change to modding from the Gathering Storm patch

Discussion in 'Civ6 - Creation & Customization' started by Gedemon, Feb 14, 2019.

  1. Delodax

    Delodax Chieftain

    Joined:
    Jan 3, 2011
    Messages:
    12
    Gender:
    Male
    Location:
    Sweden
    Care to explain exactly how you did this? I tried inserting it in the <PropertyGroup> or as a "Custom Property" from within ModBuddy, but had no such luck...
     
  2. FurionHuang

    FurionHuang Warlord

    Joined:
    Apr 27, 2017
    Messages:
    171
    Gender:
    Male
    Nope I tried adding this to properties, didn't build with it still need to add manually to modinfo file.
     
  3. Angryr

    Angryr Chieftain

    Joined:
    Jul 12, 2014
    Messages:
    40
    Gender:
    Male
    Location:
    Indiana, USA
    @Delodax & @FurionHuang

    My mistake, It appears when I built it didn't replace the .modinfo file because now it is not working.
    However, I refuse to add this to my file every damn time. So I'm looking into the MSBuild Tasks to write a wrapper around the Civ build task, with any luck I'll be able to write a file that'll add it automatically (after replacing a few files in the modbuddy SDK folder).

    Sorry for the confusion, was just excited it worked (or so it seemed). :(
     
  4. FurionHuang

    FurionHuang Warlord

    Joined:
    Apr 27, 2017
    Messages:
    171
    Gender:
    Male
    Just hope new Modbuddy template can come out soon. There was no update since Australia DLC...
     
  5. Angryr

    Angryr Chieftain

    Joined:
    Jul 12, 2014
    Messages:
    40
    Gender:
    Male
    Location:
    Indiana, USA
    I wrote a wrapper for the ModBuddy task that generates the .modinfo files.
    This way I was able to just open it after it is generated and add the CompatibleVersions tag to the properties section.
    https://github.com/Shelby115/CivModBuildWrapper/releases/tag/1.0

    You can either download the Released/Compiled zip I made that has instructions on how to set it up, or you can download and compile it yourself!

    Note: I would appreciate it if someone who does art related modding could test that this doesn't break anything for them. In theory it should do exactly the same thing as the normal builder, but I'm just paranoid sometimes about these things. :p
     
    racha and FurionHuang like this.
  6. Gedemon

    Gedemon Modder Super Moderator

    Joined:
    Oct 4, 2004
    Messages:
    9,720
    Location:
    France
    and now GameEvents exists only in Gameplay context.

    so how do you send a call to UI from Gameplay ?

    I'm going to expose GameEvents to UI to fix my mod, but I suppose there is a clear separation for a reason...
     
  7. Infixo

    Infixo Deity

    Joined:
    Jan 9, 2016
    Messages:
    3,728
    Gender:
    Male
    Location:
    Warsaw
  8. Gedemon

    Gedemon Modder Super Moderator

    Joined:
    Oct 4, 2004
    Messages:
    9,720
    Location:
    France
    Yes, ExposedMembers still works, but I was wondering if there was an "official" way.
     
  9. Wolfdog

    Wolfdog Unit Butcher

    Joined:
    Jun 29, 2012
    Messages:
    659
    Location:
    Australia
    Hey Deliverator, in what file is that feature located? I had a look in units.arfdef and could not see it in there.
     
  10. Deliverator

    Deliverator Graphical Hackificator

    Joined:
    Feb 12, 2008
    Messages:
    4,711
    Location:
    London, UK
    Search for "CIVILIZATION_GERMANY" in Unit_Bins.artdef and you'll see some examples. You can basically specify "CIVILIZATION_*" instead of the Unit Culture in both Units.artdef and Unit_Bins.artdef. So you can specify it as a variation in the UnitMemberTypes or UnitAttachmentBins collection. Make sense?

    Currently I'm using it to specify different Rifleman colours for America and France rather than the generic European Unit Culture colour in S&T:Unit Expansion. Plan to make more use of it later.
     
    Gedemon likes this.
  11. Delodax

    Delodax Chieftain

    Joined:
    Jan 3, 2011
    Messages:
    12
    Gender:
    Male
    Location:
    Sweden
    Interesting, thanks for sharing. Might look into adding this in the future if Firaxis takes too long fixing it themselves. I would be interested in adding some other properties in that case, nice that you supplied the source code which would make that feasible for me :)
     
    Angryr likes this.
  12. Wolfdog

    Wolfdog Unit Butcher

    Joined:
    Jun 29, 2012
    Messages:
    659
    Location:
    Australia
    Thank you, I will take a look tonight. This should be a lot better way of doing CV. I just hope Firaxis update the SDK soon so I can make the adjustments through asset editor.
     
  13. Tiramisu

    Tiramisu Warlord

    Joined:
    Aug 16, 2013
    Messages:
    141
    Location:
    Leonberg (BW, Germany)
    So is there a method to send Events from UI to Gameplay and vice versa? I wonder how to do it.
     
  14. Gedemon

    Gedemon Modder Super Moderator

    Joined:
    Oct 4, 2004
    Messages:
    9,720
    Location:
    France
    How I use ExposedMembers for events between contexts:

    for example at the beginning a Gameplay script :
    Code:
     ExposedMembers.GameEvents = GameEvents
    at the beginning of all UI scripts where you want to use shared events (UI context always load after Gameplay context)
    Code:
    GameEvents = ExposedMembers.GameEvents
    then in any script, you add a function as usual :
    Code:
    GameEvents.YourCustomEvent.Add(YourFunction)
    but it's a bit different to call the event :
    Code:
    GameEvents.YourCustomEvent.Call()
     
    dbergan and Zur13 like this.
  15. Deliverator

    Deliverator Graphical Hackificator

    Joined:
    Feb 12, 2008
    Messages:
    4,711
    Location:
    London, UK
    Just repeating this here for those that have custom Unit art or are specifying the Unit Culture for their custom civs. Most Unit Cultures have changed with the Gathering Storm patch:

    EastAsian > Asian
    Mediterranean
    Mughal > Indian
    NorthAfrican > MiddleEastern
    NorthernEuropean > European
    SouthAfrican > African
    SouthAmerican
    Barbarian

    NEW:
    Maori
    NativeAmerican
    SouthEastAsian
     
  16. FurionHuang

    FurionHuang Warlord

    Joined:
    Apr 27, 2017
    Messages:
    171
    Gender:
    Male
    So in this way how would you pass parameters? Or is there any restrictions like not sending nested tables?
     
  17. TheMarshmallowBear

    TheMarshmallowBear Benelovent Chieftain of the BearKingdom

    Joined:
    Dec 27, 2006
    Messages:
    7,606
    Location:
    Inside an Ikanda.
    NewOnly seems to have been deprecated and no longer works. No game modifiers have a NewOnly of 1. Strange.
     
  18. Tiramisu

    Tiramisu Warlord

    Joined:
    Aug 16, 2013
    Messages:
    141
    Location:
    Leonberg (BW, Germany)
    Thank you Gedemon! Your hint really helped me, although I was not sure how to use GameEvents without errors. So I simply followed your advice using LuaEvents instead of GameEvents. LuaEvents also allows to pass variables like in previous versions. So I hope this helps @FurionHuang.
    Here is an example:

    Spoiler :
    Code in UI-Script:
    Code:
    LuaEvents = ExposedMembers.LuaEvents
    
    function Initialize()   
        LuaEvents.UITestEvent( 313, "test" )
    end
    Initialize();
    Code in Gameplay-Script:
    Code:
    ExposedMembers.LuaEvents = LuaEvents
    
    function Test( i, s)   
        print( i, s )
    end
    LuaEvents.UITestEvent.Add( Test )
    
    Then your lua log will print
    Code:
    313    test
     
    dbergan, qqqbbb and Red Key like this.
  19. Gedemon

    Gedemon Modder Super Moderator

    Joined:
    Oct 4, 2004
    Messages:
    9,720
    Location:
    France
    I hadn't the time to test this yet, but I suppose it works almost like LuaEvents (except the need to specifically use the Call method)
    Code:
    GameEvents.YourCustomEvent.Call(args)
    Doesn't that override or neutralize the UI specific Lua events from the other UI files ?
     
  20. Tiramisu

    Tiramisu Warlord

    Joined:
    Aug 16, 2013
    Messages:
    141
    Location:
    Leonberg (BW, Germany)
    I have not noticed any problems, yet.
     

Share This Page