5E Storm Kings Thunder Playlist
  1. #1

    Help with CT.lua

    I've run into a problem with adding functionality to the CT.lua file. I'm hoping I'm just being stupid and someone can help me out.

    I've have a new template_ct.xml file that contains the following code

    <template name="list_ctbox_host" merge="join">
            <windowlist name="list">
                <anchored to="contentanchor">
                    <top anchor="bottom" relation="relative" offset="5" />
                    <left offset="-30" />
                    <right offset="10" />
                    <bottom parent="" offset="-55" />
                <empty font="list-empty-ct" textres="ct_emptylist" />
                <script file="ct/scripts/new_ct.lua" />
    Which points to my new ct.lua file (new_ct.lua).
    This all works fine, as currently I have just copied the entiretly of the old ct.lua file into my new one and added in my new functions.

    I thought I could use 'super.onInit()' to call the original onInit function (as well as doing it for most of the other original functions in the ct.lua file also), but this throws an error 'attempt to index global 'super' ( a nil value).

    So my question is :
    Is it possible to use the 'super' functionality in ct.lua, and if so what am I doing wrong?

    Cheers, Steve.

  2. #2
    Templates don't support merge attribute; so you are overriding based on that code.

    You would need to copy the original template and script, then modify to fit your needs; or possibly use some sort of stepped template (original redefined as list_ctbox_host_step; and new list_ctbox_host inherits).


  3. #3
    Thanks Moon Wizard, I guess I'll leave my code 'as is' then with the copied contents of the original file.

    Cheers, Steve.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Starfinder Playlist

Log in

Log in