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

[GS] Possible to use a custom SQL table in Lua?

Discussion in 'Mod Creation Help' started by Angryr, Feb 20, 2019.

  1. Angryr

    Angryr Chieftain

    Joined:
    Jul 12, 2014
    Messages:
    39
    Gender:
    Male
    Location:
    Indiana, USA
    Let's say I were to create a custom SQL table, something like:
    Code:
    CREATE TABLE GameEvents
    (
        EventId TEXT,
        EventType TEXT,
        -- ... Other potential fields   
    );
    Is there a way to access this is Lua? Like Game.GameEvents or something?
     
  2. Infixo

    Infixo Deity

    Joined:
    Jan 9, 2016
    Messages:
    3,417
    Gender:
    Male
    Location:
    Warsaw
  3. Angryr

    Angryr Chieftain

    Joined:
    Jul 12, 2014
    Messages:
    39
    Gender:
    Male
    Location:
    Indiana, USA
    Ah, thank you. Much appreciated!
     
  4. Angryr

    Angryr Chieftain

    Joined:
    Jul 12, 2014
    Messages:
    39
    Gender:
    Male
    Location:
    Indiana, USA
    Follow up question I suppose, is there a way to apply a modifier via lua?
     
  5. Infixo

    Infixo Deity

    Joined:
    Jan 9, 2016
    Messages:
    3,417
    Gender:
    Male
    Location:
    Warsaw
  6. Angryr

    Angryr Chieftain

    Joined:
    Jul 12, 2014
    Messages:
    39
    Gender:
    Male
    Location:
    Indiana, USA
    :O That's exciting. Oh man, like half the things I wanted to do with scripting were halted because I didn't have that capability, going to have to check that Black Death scenario out. Thanks a ton for the info.
     
  7. Angryr

    Angryr Chieftain

    Joined:
    Jul 12, 2014
    Messages:
    39
    Gender:
    Male
    Location:
    Indiana, USA
    Hmm Don't suppose there's a way to evaluate whether a RequirementSet has been met in lua? Would make what I'm doing a lot quicker if it did :p Not finding anything through the scenario examples though.
     
  8. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    6,335
    Location:
    Illinois, USA
    Nope.

    You can either chose to apply the modifier to a player or a city or choose not to. But you can't check from within lua directly really whether the modifier's conditions are met as defined within Requirements, etc. You have to make that inherent in your lua script. You also cannot directly un-attach a modifier via lua.


    We cannot currently attach a modifier to a unit from an lua script. Let us all rub our weedjee boards and pray Firaxis adds this in a patch in the near future.
     

Share This Page