DICE PACKS BUNDLE
Page 2 of 2 First 12
  1. #11
    Does it work if you avoid the super prefix? Just for testing purpose, to see where the problem lies. (So, simply overwrite that script by copy&paste and add your edits)

    Maybe the super calls are not working nicely with getDatabaseNode()? I am not sure, I never tested the super calls

    EDIT: and the mini sheet also calls this function by the way; may not be the culprit here, but for the purpose of your code you may also want to have an xml merge in that regard

  2. #12
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,411
    For testing, put a printstack(); command in spell.lua before the line that's causing the error.

    Then, when the error occurs, look at console.log and see what function is calling onDisplayChanged() and causing the error.

    For example, this is normal (being called as part of onInit):

    Code:
    stack traceback:
    	[string "campaign/scripts/spell.lua"]:54: in function 'onDisplayChanged'
    	[string "campaign/scripts/spell.lua"]:38: in function <[string "campaign/scripts/spell.lua"]:16>
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  3. #13
    I have no idea what spell.lua is and your dealing with a ruleset I know nothing about - but templates don't support "super" if its one of those. And also you have to actually have something already in existence (say base.xml before your .xml is defined) that has the functions your trying to override - or there will be no super then either.

    Also, you got rid of the merge? If you don't have the merge then when you give a commonly named class YOU have to supply EVERY SINGLE LINE OF CODE. As that would mean you're outright replacing that class entirely.
    Last edited by SilentRuin; May 17th, 2021 at 19:27.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  4. #14
    Quote Originally Posted by Kelrugem View Post
    Does it work if you avoid the super prefix? Just for testing purpose, to see where the problem lies. (So, simply overwrite that script by copy&paste and add your edits)

    Maybe the super calls are not working nicely with getDatabaseNode()? I am not sure, I never tested the super calls

    EDIT: and the mini sheet also calls this function by the way; may not be the culprit here, but for the purpose of your code you may also want to have an xml merge in that regard
    I also have changed it in the minisheet, but thanks for the reminder

    Quote Originally Posted by SilentRuin View Post
    I have no idea what spell.lua is and your dealing with a ruleset I know nothing about - but templates don't support "super" if its one of those. And also you have to actually have something already in existence (say base.xml before your .xml is defined) that has the functions your trying to override - or there will be no super then either.

    Also, you got rid of the merge? If you don't have the merge then when you give a commonly named class YOU have to supply EVERY SINGLE LINE OF CODE. As that would mean you're outright replacing that class entirely.
    not a template, and tried first with merge before attempting without out of curiosity.
    I know super doesn't exist without a merge but thought it should just skip that if block since it doesn't exist. Probably not though, because I was then asking for the existence of a function within super (which I assume is why it errors).

  5. #15
    Quote Originally Posted by Trenloe View Post
    For testing, put a printstack(); command in spell.lua before the line that's causing the error.

    Then, when the error occurs, look at console.log and see what function is calling onDisplayChanged() and causing the error.

    For example, this is normal (being called as part of onInit):

    Code:
    stack traceback:
    	[string "campaign/scripts/spell.lua"]:54: in function 'onDisplayChanged'
    	[string "campaign/scripts/spell.lua"]:38: in function <[string "campaign/scripts/spell.lua"]:16>
    Thanks for this suggestion, I added the onDisplayChanged() function back into my merged spell.lua and added printstack() right before the offending line.
    This time when the console opened it was... entirely the same: no output from printstack().

    This reinforces my assumption from the last page of this thread:
    Quote Originally Posted by bmos View Post
    I have tried adding that function to my spell.lua and commenting out everything in it (leaving the function empty) and it still has the same error!
    I was hoping I could just empty the onDisplayChanged function since I don't care about its functionality, but for some reason that doesn't even fix the issue as my merged function isn't overriding the one in the ruleset.
    The bizarre part is that the other function I'm overriding in this exact spell.lua is working correctly. So once is overriding correctly and one is not.

    EDIT: ok this is even weirder. I added printstack() to the function that IS overriding (onMenuSelection) and printstack was not found. So I tried Debug.printstack() and Debug was not found either.
    Last edited by bmos; May 17th, 2021 at 21:37.

  6. #16
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,411
    My suggestion was to add printstack() to the original 3.5E code. That is, for testing purposes, extract 3.5E.pak into a 3.5E directory within the rulesets directory, and add that code to see what is calling the original code and producing the error. Then, of course, remember to delete the 3.5E directory when you're finished.

    However, it sounds like you have more issues if printstack() raises an error? If so, what error? debug.printstack isn't a valid API function, so you will get an error trying to call that.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  7. #17
    Can you create a simple extension that just attempts to append to spell.lua; and just print out a message?
    If that works, can you add more code until it stops working?

    In that way, you'll either fine the issue through building up; or you can provide a minimum viable case for me to look at. Sorry I can't jump in deeper than that to help, but my hands are full right now.

    Thanks,
    JPG

  8. #18
    The solution was to replace the onInit function and the onDisplayChanged function. Then I was able to make changes to the onDisplayChanged function (and have them work).
    onInit was calling the orignal onDisplayChanged because it was in the original file.

    Thank you to all for the help

  9. #19
    Please disregard.
    Last edited by CaptJack2883; May 20th, 2021 at 09:34. Reason: I realized there was more than one page of replies, and didn't read the rest of the replies.

Thread Information

Users Browsing this Thread

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

Bookmarks

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