I tried to add connectors in a specific case, runtime rather than littering the def files with hook definitions.
And I get an untraceable error (event-triggered, which dumps the event-handling stack and kindly omits anything I ever did).
Saying that "map" is nil. My scripts (for this) do not reference "map"
It may be particular to items, or their attack/action components.
Adding a connector with the same arguments, in the def files, works without error.
But requires editing all the def files. Trying to cut back on tediousness...
Code: Select all
function set_hook (item)
local act_nm = item:getPrimaryAction()
local compo = item.go:getComponent (act_nm)
compo:addConnector ("onHitMonster", self.go.id, "onHitMonster")
And it was verified that:
- This script includes a valid "onHitMonster" function.
- "self" is this script, not reused as something else (like vanilla def files tend to do...)
It's pretty annoying to have to edit all the defs when trying to do something that using "addConnector" - in one place - was pretty clearly intended to do, but can't seem to handle.
<Frodo> We've been here before. We're going in circles!" </Frodo>