Quick Questions About Scenario Scripts

Discussion in 'General Discussion' started by Sproutmask, May 26, 2024.

  1. Sproutmask

    Sproutmask Active Member

    Joined:
    Dec 8, 2016
    Messages:
    79
    Likes Received:
    87
    I enjoy creating scenarios, and I've got the hang of some useful basics of LUA scripting. I do have a couple of questions though. Firstly, is there any performance gain or other advantage from using a compiled script (.luac) over a raw script (text file with .lua extension)? Secondly, if both .lua and .luac files are present in a scenario folder, which one does the game load by default?

    The reason for asking is that I like to leave the raw script in with my scenarios in case it is useful to others, but wanted to check that this is not at the expense of performance.
     
  2. Spikee1975

    Spikee1975 Guest

    The reason is more to hide your scripting magic from manipulation. You can compile them and then remove the original .lua file, as .luac has higher priority.

    I don't think it has any effect on performance, as it should be preprocessed anyway on playing the scenario.
     
    • Helpful Helpful x 1
  3. Sproutmask

    Sproutmask Active Member

    Joined:
    Dec 8, 2016
    Messages:
    79
    Likes Received:
    87
    Cheers! I don't do anything that would ever be worth protecting like that, but still useful information - been really enjoying the insights from you and others into TSC's innards just recently.
     
    • Like Like x 2

Share This Page