PDA

View Full Version : DCC onCharItemDelete not working



leozelig
February 4th, 2018, 15:35
CharManager.onCharItemDelete does not run when an item is deleted from the inventory, so weapons stay in the weapon list on the Actions tab, and AC does not recalculate. Debug confirms that the function simply isn't running when the item is deleted, which is strange because CharManager.onCharItemAdd works great.

The ruleset is layered on CoreRPG and borrows heavily from 5E. I have this in the CharManager.onInit function...


function onInit()
ItemManager.setCustomCharAdd(onCharItemAdd);
ItemManager.setCustomCharRemove(onCharItemDelete);
end

No extensions running, created a new campaign, restarted the computer - still nothing... I feel like I am missing something very basic.

Any ideas?

LordEntrails
February 4th, 2018, 18:34
I only know that it has been said elsewhere multiple times that FG does not delete any actions or such when things are removed from the character sheet. Don't know if it can be made to work though.

Moon Wizard
February 4th, 2018, 19:52
I’d probably have to get a copy of entire ruleset as it stands to understand why it’s not being called.

Do you have a link for me? You can send PM if it’s a work in progress thing you don’t want to post yet.

Regards,
JPG

leozelig
February 4th, 2018, 19:55
It worked in DCC v2.9 with no major changes to that part of CharManager. I checked the db files, and the data nodes are the same. Maybe I should reinstall FG??

I will PM you the ruleset Moon, thank you...

MadBeardMan
September 23rd, 2018, 21:14
Was there a 'fix' for the issue, as I have this with the 'Traveller' ruleset at the moment.

Cheers,
MBM

leozelig
September 24th, 2018, 02:56
Yes, JPG helped me. Here is his explanation:

I think I found the issue. You are overwriting the script for char_invitem window class; so it's not calling any of the built-in functions. Try adding super.onInit(); as the first line of your new script for char_invitem. That will set up the event callback for the delete event, which ends up calling the ItemManager event chain.

That fixed it for me!