Interface API Error: Attempt to index

  • BrianTheEngineer
    22nd Dec 2019 Member 0 Permalink

    I was exploring my options with Lua scripting by creating an interface for the game. So naturally, I turned towards using the Interface API. However, that didn't work.

     

    It showed the error: attempt to index global "Window" (a nil value)

     

    From what I can understand, it is trying to access the Window object but fails because the object doesn't exist.

     

    How can I fix this?

  • jacob1
    22nd Dec 2019 Developer 0 Permalink
    The interface api doesn't work in my mod, or on the Android port. If you want to use it, you have to use official TPT.
  • BrianTheEngineer
    22nd Dec 2019 Member 0 Permalink

    @jacob1 (View Post)

     

    Are you planning to add support for it at some point in the near future?

  • jacob1
    22nd Dec 2019 Developer 0 Permalink
    @BrianTheEngineer (View Post)
    I'd like to ... there's not much stopping me.

    Years ago it wasn't possible to add, but ever since I refactored things for the Android port, I could add the api. I just don't like the api very much and hope it gets rewritten, so I've held off putting it in my mod.
    Edited once by jacob1. Last: 22nd Dec 2019
  • BrianTheEngineer
    23rd Dec 2019 Member 0 Permalink

    @jacob1 (View Post)

     

    So, what are the alternatives to the API? I want to make a STKM with powers that you select with a dropdown list.

    Edited 2 times by BrianTheEngineer. Last: 23rd Dec 2019
  • ssccsscc
    24th Dec 2019 Member 0 Permalink
  • BrianTheEngineer
    26th Dec 2019 Member 0 Permalink

    @ssccsscc (View Post)

     

    Is there any documentation for the script? I am having trouble understanding how it works.