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

[SOLVED] Lua cross-referencing?

Discussion in 'Mod Creation Help' started by Geekob, May 17, 2017.

Tags:
  1. Geekob

    Geekob Chieftain

    Joined:
    Apr 30, 2017
    Messages:
    20
    Gender:
    Male
    I want to make Utils file for some utility functions, but I cant do that for some reason. I used require("..."), include("..") but nothing seems to work. I included that Utils.lua into LuaScripts, but console is still crying about not knowing the used function. Am I missing something?

    Code:
    include ("Utils.lua");
    local utils = require("Utils");
    ...
    utils.DoSomething();
    
     
  2. LeeS

    LeeS Imperator Supporter

    Joined:
    Jul 23, 2013
    Messages:
    7,042
    Location:
    Illinois, USA
    "include" only works for the files Firaxis used for the UI. Apparently they specifically created a list of files that were valid for the "include" command, and no other files work for this.

    Gedemon uses ExposedMembers in an "ExposedMembers.SomethingGedemonMagic" method but so far I've not been able to wrap my head around it.
     
  3. Geekob

    Geekob Chieftain

    Joined:
    Apr 30, 2017
    Messages:
    20
    Gender:
    Male
    Oh, thats sad lol.
     
  4. Infixo

    Infixo Deity

    Joined:
    Jan 9, 2016
    Messages:
    3,701
    Gender:
    Male
    Location:
    Warsaw
  5. Geekob

    Geekob Chieftain

    Joined:
    Apr 30, 2017
    Messages:
    20
    Gender:
    Male
    Yeah I found that post. Trying to apply that somehow. Thanks
     

Share This Page