PDA

View Full Version : Savage Worlds ruleset, removing attacks from NPC in Combat Tracker via scripts



chillhelm
November 29th, 2021, 16:00
Hi,

I want to remove an attack from an NPC in the Combat Tracker via script.
My current method is to simply delete the corresponding node in the NPCs weaponlist database node, since I couldn't find a function in the API to do it.
This works, but when you afterwards reload the campaign or return to launcher you get the following error message:

Object (DATABASENODE) deleted without cleaning up attached Lua object.

I've created a minimal example that reproduces the error reliably.

How to reproduce the error:

- Download and enable the attached extension
- add an NPC to the Combat Tracker that has an attack
- type "/removeIt" in the chat
- return to launcher
- look at your console in confusion

So my questions are:
Is this error my fault and is there an API call that I should be making to avoid producing this error?
I can't seem to find any sideeffects from the error, so I'm assuming it's harmless. But it does have a memory-leak-smell about it, so I want to be on the safe side here, before publishing my extension that requires this. Can I just tell my users to ignore this error?

Edit: Forgot to upload the example extension.
Edit 2: The combat tracker has to be open, when /removeIt is typed in the chat, otherwise the error does not appear.