-
May 17th, 2021, 18:10 #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 regardMy extensions for 3.5e and Pathfinder
Bug reports please here
-
May 17th, 2021, 18:22 #12
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!
-
May 17th, 2021, 19:24 #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):
-
May 17th, 2021, 21:19 #14
I also have changed it in the minisheet, but thanks for the reminder
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).bmos' extensions
he/them
-
May 17th, 2021, 21:29 #15
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:
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.
bmos' extensions
he/them
-
May 17th, 2021, 22:00 #16
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!
-
May 17th, 2021, 22:09 #17
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,562
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
-
May 17th, 2021, 23:30 #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 helpbmos' extensions
he/them
-
May 20th, 2021, 09:30 #19
- Join Date
- Apr 2018
- Posts
- 51
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 1 users browsing this thread. (0 members and 1 guests)
Bookmarks