5E Product Walkthrough Playlist
Page 1 of 3 123 Last
  1. #1

    Something change in onShortcutDrop? Not seeing anything of note as I drill down but..

    When giving control of NPCs to my players, I have an extension which will never use the option "Token: Party Vision and Movement" because it gives undesired behaviors in our games we don't want and we allow any faction to be played because sometimes I have a player run the bad guys against the other players. This has its own functionality which still works fully as designed in TEST, but it had an additional ability to insure if the normal FGU operation of dragging an CT NPC link onto a player portrait will get all the settings required for my extension to work and it would work the same as if someone had been granted access to all the NPCs (in this case it would be just the one dragged onto portrait instead of all of them).

    Hence, I have extensions that override the onShortCutDrop functionality to insure that any drop of a CT link onto a player portrait will give it full ownership to that player for the NPC. This has a lot of ramifications - all good - that allow players full control of the NPC and allow them access to the same CT action lines that a host would have without regard for faction or requiring that unwanted party vision option (Example below)...

    FULLNPCcontrol.jpg

    While the ability to share all NPCs to a player still work fine when using my mechanism for allowing any NPC to be controlled by player - the overloaded onShortCutDrop to trigger this same behavior - no longer works.

    I'm in the process of trying to figure out why it still pops up the NPC form on player side but somehow the CT client side logic no longer gets triggered and the addholder that was applied does not seem to stick.

    Normally I'd just thrash this out on my own - but my initial looking into this on TEST using winmerge to see any changes in onShortCutDrop are not showing anything obvious. I'm going to be down to throwing a whole bunch of prints to try to figure out what has changed to cause this not to work when onShortCutDrop in TEST is called - but I'm also hoping - maybe someone reading this can give me a hint where to look to find out what has changed to make this ownership setting cease to work for me when going down this particular pathway.

    Anyway - if I find out what it is before someone tells me what it might likely be - I will post here. But I'm worried its going to be in some indirect not obvious place where this got changed.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  2. #2
    And.... I am stumped. I found out what it is. My drop handler registration is no longer getting called at all.

    CharacterListManager.registerDropHandler("shortcut ", onShortcutDrop);

    The only thing I can see that changed is that someone has renamed the FGU one to this

    CharacterListManager.registerDropHandler("shortcut ", CharacterListManager.onShortcutDrop)

    Now granted I wrote this eons ago (part of my first extension), can someone explain why this is or why it ever worked?

    Does the registerDropHandler have to match the name exactly or it will simply not be called?

    For sure, I can think of one work around to get around this, simply override CharacterListManager.onShortcutDrop - which essentially is what I've done as I call the original version in my current code.

    But I'd rather understand why it no longer triggers at all the way I have it. Any ideas?
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  3. #3
    It's an order of operations situation.

    The code was changed to try to move some items that were being overriden from onInit to onDesktopInit to allow easier overriding. After reviewing it again, it looks like anything that has an explicit registration function needs to be moved back to onInit, so that the default behavior is set up earlier in the initialization by default and so that it can be overriden using the explicit functions in extensions (which is what you are trying to do). I just did a review of all the code like that in CoreRPG and moved some stuff around.

    I'll be pushing a new build today or tomorrow with those changes; and you can check again to see if it's still an issue for you. If it is still an issue, you should be able to move your drop handler override to the onDesktopInit and that should resolve.

    Regards,
    JPG

  4. #4
    Quote Originally Posted by Moon Wizard View Post
    It's an order of operations situation.

    The code was changed to try to move some items that were being overriden from onInit to onDesktopInit to allow easier overriding. After reviewing it again, it looks like anything that has an explicit registration function needs to be moved back to onInit, so that the default behavior is set up earlier in the initialization by default and so that it can be overriden using the explicit functions in extensions (which is what you are trying to do). I just did a review of all the code like that in CoreRPG and moved some stuff around.

    I'll be pushing a new build today or tomorrow with those changes; and you can check again to see if it's still an issue for you. If it is still an issue, you should be able to move your drop handler override to the onDesktopInit and that should resolve.

    Regards,
    JPG
    No worries - I've decided to play it safe as I usually do as this was early extension - I never override a registered thing usually just the function these days. And I've changed it to just do my normal thing...

    saveonShortcutDrop = CharacterListManager.onShortcutDrop;
    CharacterListManager.onShortcutDrop = onShortcutDrop;

    where I call the save* version in my version (with whatever I wanted to add).


    All works - and is good. Not sure if I have any other register things from the old days but I've not noticed anything else in TEST so far.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  5. #5
    Quote Originally Posted by Moon Wizard View Post
    It's an order of operations situation.

    The code was changed to try to move some items that were being overriden from onInit to onDesktopInit to allow easier overriding. After reviewing it again, it looks like anything that has an explicit registration function needs to be moved back to onInit, so that the default behavior is set up earlier in the initialization by default and so that it can be overriden using the explicit functions in extensions (which is what you are trying to do). I just did a review of all the code like that in CoreRPG and moved some stuff around.

    I'll be pushing a new build today or tomorrow with those changes; and you can check again to see if it's still an issue for you. If it is still an issue, you should be able to move your drop handler override to the onDesktopInit and that should resolve.

    Regards,
    JPG
    Turns out I do have some other register calls - though not sure your changes have affected any of them. Mostly in this area....

    ActionsManager.register*

    I'll wait to check all those until after you make whatever updates your making. I do all my setup operations usually in OnInit() with a few exceptions (because I had to do the desktop init for DB data)
    Last edited by SilentRuin; June 16th, 2022 at 21:08.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  6. #6
    Just a heads up that you might have to change it back to the way it was before after these changes. Again, it's an order of operations things, and completely tied to the fact that each function instance has a unique ID.

    Regards,
    JPG

  7. #7
    Quote Originally Posted by Moon Wizard View Post
    Just a heads up that you might have to change it back to the way it was before after these changes. Again, it's an order of operations things, and completely tied to the fact that each function instance has a unique ID.

    Regards,
    JPG
    You were correct - now overriding the registered function (new way) does not work - likely due to ID you mentioned. And the setting it back to the way it worked in LIVE (registering it) now works in TEST. So I guess whatever you fixed - worked - thanks!
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  8. #8
    I am curious how more than one extension can modify the same registered function. I understand how overriding a function then calling the original can stack functionality of extensions (my save stuff above) but not how me registering a function that replaces the keyword can have stacked logic. As I understand it after seeing this it’s only ever going to be the last one that executes. I guess no one else is overriding this as I’m not aware of any reported conflicts.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  9. #9
    Now I get this error:

    [6/17/2022 10:39:13 AM] [ERROR] Script execution error: [string "scripts/manager_campaigndata.lua"]:105: attempt to call field 'handleAnyDrop' (a nil value)

    I can only imagine something has been broken where multiple extensions previously had the ability to override things and put their stamp on it without wrecking any other extension.

    The extension I have doing this does this in my onInit (as many other extensions do for different functions - which I'm now beginning to wonder if they all haven't been broken or how extensions can modify the same source)

    Code:
    	-- Make sure this function can support treasureparcel sheets
    	savehandleAnyDrop = ItemManager.handleAnyDrop;
    	ItemManager.handleAnyDrop = handleAnyDrop;
    Let me know if I need to make a new thread for this one - but it seems along the same lines as to what is going on here.

    Gist of this current problem is I can no longer drop NPCs on the CT.

    And I am worried that any ability to catch every instance to add my stuff into is now somehow being made into "there can be only one" extension modifying these type of overrides.
    Last edited by SilentRuin; June 17th, 2022 at 18:20.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  10. #10
    Actually now I'm really confused - that error does not occur in the extension that overrides that code. I narrowed it down to an extension which as far as I can tell never touches handleAnyDrop. So not sure what is going on.
    Free(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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
STAR TREK 2d20

Log in

Log in