-
August 4th, 2020, 19:50 #1
Is there a trick to overriding CharacterListManager.onShortcutDrop?
In current and past extensions I've had no problem overriding core things I need to add onto (but not actually mess with insides of).
For example:
Code:local saveonShortcutDrop = nil; function onInit() Debug.console(tostring(CharacterListManager.onShortcutDrop)); -- I see a hex value saveonShortcutDrop = CharacterListManager.onShortcutDrop; CharacterListManager.onShortcutDrop = onShortcutDrop; Debug.console(tostring(CharacterListManager.onShortcutDrop)); -- I see a different hex value end function onShortcutDrop(sIdentity, draginfo) Debug.console("**** THIS IS MY STUFF *****"); -- call the original stuff first then call new stuff local bReturn = saveonShortcutDrop(sIdentity, draginfo); end
I can see a stack dump of the original call being called
[C]: in function 'openWindow'
[string "desktop/scripts/manager_characterlist.lua"]:147: in function <[string "desktop/scripts/manager_characterlist.lua"]:137>
(tail call): ?
(tail call): ?
But I see no sign that I am replacing it. I'm not in the stack - nor are my print statements showing. I can see the onInit() with hex values printed out so something is going on.
Is there something different between this CoreRPG\desktop\scripts\manager_characterlist.lua function and other script functions I have no problems with?
Note: I never include any of these in my extension file that I override as they are usually defined someplace else I end up getting access to.Free(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
-
August 4th, 2020, 22:23 #2
It's time to stop asking questions when you have to answer all your own. I've evidently hit a ceiling of knowledge here - or a lack of time for the right experts to instantly respond to my wants and needs
Anyway, desktop is evidently weirder than the other managers. I did a look at all the functions it had (0 comments of course) and tried replacing the setting of CharacterListManager.onShortcutDrop - to registering it - which worked..
Code:saveonShortcutDrop = CharacterListManager.onShortcutDrop; CharacterListManager.registerDropHandler("shortcut", onShortcutDrop);
Free(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
-
August 4th, 2020, 22:32 #3
You can always see who's available on Discord if you are looking for more timely help
Problems? See; How to Report Issues, Bugs & Problems
On Licensing & Distributing Community Content
Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
Note, I am not a SmiteWorks employee or representative, I'm just a user like you.
-
August 4th, 2020, 23:48 #4Free(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
-
August 5th, 2020, 00:05 #5
For someone to reply with a suitable answer they would have to have some combination of the below:
FG coding knowledge
Time to try and understand what it is you are doing
Some familiarity with the exact functions you are referring to
Having read your thread in the first place
There is only a handful of people messing around with the code at anyone time. They are generally busy working on their own projects. The questions are quite specific and may require someone to actually go and try and replicate what you are doing before they can see/think/work some solutions. They need time at that time, not later on after you have solved. They need to be willing to pull their head out of whatever problem they are working on to put their head in your rabbit hole. etc
At a guess I would suggest that the above paragraph probably fits you also. I dont know, but its quite likely that you havent dont the above for other programming help posts either, or the volume of helps vs requests is skewed. Its just the nature of the beast.
Sometimes just posting is enough of a rubber ducky to point you in the right direction.
What would also be good is if you posted your actual solution too - in case others come across your same issue.
I feel bad when I see programming help requests go unanswered but I also have no capacity to take on anything extra most of the time. I help if I might have some knowledge of the specifics that they are working on but I rarely have time to climb deep into someone elses rabbit hole.
-
August 5th, 2020, 04:13 #6
How are you trying to replace it and what are you trying to accomplish? As this is a global script it would need to be cloned and redefined in your extension.xml or base.xml file as CharacterListManager to run your changes in your new file.
Dominic Morta
Ruleset Developer
Smiteworks
How to zip up your campaign if the Developers ask for it-How to zip up your campaign if the Developers ask for it
How to provide an Unity Connection issue?-Connection Issues and What to Provide
Unity Updater issue?-Updater Issues
Classic and Unity Port Forwarding?-Fantasy Grounds Connections Explained
Comcast or Cox ISP User?-Comcast XFinity and Cox Users
Have a suggestion?-Feature Request
-
August 5th, 2020, 17:07 #7
Understood completely. I credit anyone with finding bugs in an extension I have here by listing them with the bug fix - and I also have never NOT posted a solution to my many posts - which either someone has given me - I have more often found myself - etc. Not one. The only one's without answers to my questions via solutions are ones I have not found yet (one to my knowledge).
So no worries - I understand the nature of this beast. My part in "support" is I do ask questions - and then I do post the answers - so some poor slob likely myself does not quest through keyword searches and come up empty - like me.
In fact - the solution here is before your post (quoted by you in fact) - posted by me - and I suppose falls under the category "post first, read later" that you pointed outLast edited by SilentRuin; August 5th, 2020 at 17:13.
Free(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
-
August 5th, 2020, 17:08 #8
As per the earlier posts - solution was found by me - was posted - and is working.
The gist is that while I can overwrite a function - if that function has been scooped up by another thread (and was registered) - it will never be found. Or so it seems. Anyway, look above for the solution.Free(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
-
August 5th, 2020, 17:36 #9
Great to hear, just wanted to try to help as it sounded like there was some more investigating to perform. Please don't get discouraged as this is all a learning process and may take many cracks at unlocking the functionality you are looking to have performed. We are working hard to make development work easier and more streamlined every day. So please keep picking at the code and asking questions. You are helping everyone reading your posts.
Dominic Morta
Ruleset Developer
Smiteworks
How to zip up your campaign if the Developers ask for it-How to zip up your campaign if the Developers ask for it
How to provide an Unity Connection issue?-Connection Issues and What to Provide
Unity Updater issue?-Updater Issues
Classic and Unity Port Forwarding?-Fantasy Grounds Connections Explained
Comcast or Cox ISP User?-Comcast XFinity and Cox Users
Have a suggestion?-Feature Request
-
August 5th, 2020, 17:59 #10
Will do.
Sorry if I've projected my frustrations, but this stupid extension has been going on 4 weeks already and I just "off the cuff" decided to add in full support for NPC's used by players (end turn, targeting, etc. which is not as easy as it sounds) causing yet another DB CT tag creation. Which then made me think do I need to be able to clear this? And other things which have 0 to do with the extension I'm working on.
Which is my problem, if I let myself I will never finish seeking perfection in this thing.
I'm going to have to just stop adding things I think are a "good idea". The problem is - running from host testing - or running as "your same username" testing - does not show all the issues until I get one of my players to test it. Then rewrite complete sections to overcome something ---- UGH.
You get the picture of where frustration is coming in.
Sorry if I projected itFree(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks