5E Product Walkthrough Playlist
Page 2 of 2 First 12
  1. #11
    No, the windowlist is also implemented like in CORE and is not being deleted.

    Since I log all scripts in the console I am able to see the sequence of function calls:
    [10/20/2020 5:52:13 PM] ct/scripts/ct.lua, toggleEffects, Ende
    [10/20/2020 5:52:26 PM] ct/scripts/ct_entry.lua, onMenuSelection
    [10/20/2020 5:52:26 PM] ct/scripts/ct_entry.lua, delete

    1st entry: toggling the effects to have a larger ct_entry to click on for deletion - note the time difference to the next entry - 13 seconds!
    2nd step: open the radial menu and select the menu-item for deletion
    3rd step: deletion is triggered with the already posted sequence of steps before...
    there must be some kind of memory mis-management since it believes that an object is missing that is actually there ...

    I really appreciate you trying to help and I wish your guess was right because the problem would already be solved then. Unfortunately, it does not seem to be so simple.

  2. #12
    Since it's working in all the other rulesets, I don't think it's a memory issue. Perhaps you could package up just your CT changes into an extension (not the entire ruleset), so that myself or others can see the issue without all the other overhead?

    Plus, it sometimes works out that trying to simplify the issue actually leads to the solution.

    Regards,
    JPG

  3. #13
    I found a solution that works:

    ct_entry.lua
    Code:
    function delete()
    	local node = getDatabaseNode();
    	if not node then
    		close();
    		return;
    	end
    	
    	-- Remember node name
    	local sNode = node.getNodeName();
    	
    	-- Clear any effects and wounds first, so that rolls aren't triggered when initiative advanced
    	effects.reset(false);
    	
    	-- Move to the next actor, if this CT entry is active
    	if DB.getValue(node, "active", 0) == 1 then
    		CombatManager.nextActor();
    	end
    
    	-- Delete the database node and close the window
    	-- local cList = windowlist; -- removed
    	node.delete();
    
    	-- Update list information (global subsection toggles)
    	-- cList.onVisibilityToggle(); --removed
    	-- cList.onEntrySectionToggle(); removed
    end
    ct.lua:
    Code:
    function onInit()
    [...] --like Core with the addition of an Event Handler:
    DB.addHandler(DB.getPath(node), "onChildDeleted", onChildDeleted); -- added for testing
    [...]
    end
    
    function onChildDeleted()
    	Debug.console("ct/scripts/ct.lua, onChildDeleted : self", self);
    	
    	-- Update list information (global subsection toggles)
    	Debug.printstack();
    	local cList = self;
    	Debug.console("ct/scripts/ct.lua, onChildDeleted : cList", cList);
    	if cList then
    		cList.onVisibilityToggle();
    		cList.onEntrySectionToggle();
    	end
    	DebugM.printLogMessage("ct/scripts/ct.lua, onChildDeleted, Ende");
    end
    The error message does not appear anymore. My guess is that the reason might be a timing issue. The node is being deleted before the code attached to the node has finished executing. This is why it is failing (or was).
    And if my assumption is correct then it is an architectural problem and any other ruleset can be affected as well.

    I think the implementation that you explained how it was before is more stable - let things hang around for a frame.

    FGC uses a lazy deletion mechanism which means that windows will hang around for an extra frame; whereas FGU was optimized to immediately remove deleted objects within the same frame for performance reasons.
    Cheers, Jens

  4. #14
    It's not that easy. It was a performance issue; because FGU handles things under the cover differently. The faster cleanup is in line with how it should work (i.e. FGU style).

    Again, I think distilling into a simple extension as a CoreRPG add-on to recreate the issue with minimum pieces will highlight the real issue...

    Regards,
    JPG

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
  •  
FG Spreadshirt Swag

Log in

Log in