No worries. No need to do dbl work. Thanks!
Printable View
Hello
This is what I found: When I removed these lines, the effect added messages display now. Not sure yet if it breaks anything.
Those two lines break the normal CT effect chat because they **replace Fantasy Grounds’ original effect-add handler with the extension’s custom handler**.
```lua
oldonEffectAddMain=EffectManager.onEffectAddMain
EffectManager.onEffectAddMain=newonEffectAddMain
```
What the first line does is save the original FG function. What the second line does is **take over the whole effect-add path** for that extension. After that, every effect add goes through `newonEffectAddMain` first, not the normal ruleset handler.
Why that matters: your A/B test already proved the behavior change. In the session with **5e Reactions loaded**, the log shows the extension active, and in the later clean session without it, the normal chat lines for `Blinded`, `Cursed`, and `Encumbered` come back.
So the simple summary is:
The extension is overriding the base effect-add handler.
Once it does that, the normal Fantasy Grounds “Effect [...] -> [to ...]” chat output no longer comes from the original path.
That is why removing the extension restores the chat messages.
So it is not that those two lines “break CT effects.” The effects still get added. What they break is the **normal chat announcement path for effect adds**.
That does allow the chat to work but the (RCT) function no longer works meaning the main point of the ext is not working with this fix. At least we know where the issue might be.
I tracked down the issue with effect messages not showing in chat and made a fix that seems to be working on my end.
The problem was the old override of `EffectManager.onEffectAddMain`. I removed that hook and switched it to the current CoreRPG-supported hook instead:
`EffectManager.setCustomOnEffectAddIgnoreCheck(... )`
Here is the exact code change.
Old code removed:
```lua
local oldonEffectAddMain = EffectManager.onEffectAddMain
EffectManager.onEffectAddMain = newonEffectAddMain
```
New hook added in `onInit()`:
```lua
EffectManager.setCustomOnEffectAddIgnoreCheck(newo nEffectAddIgnoreCheck)
```
And this is the replacement function:
```lua
function newonEffectAddIgnoreCheck(nodeCT, rNewEffect)
if not nodeCT or not rNewEffect or not rNewEffect.sName then
return nil
end
if not checkeffectforreaction(rNewEffect) then
return nil
end
local sSource = ""
if rNewEffect.sSource == "" then
sSource = DB.getPath(nodeCT)
else
sSource = rNewEffect.sSource
end
if sSource == "" then
return nil
end
if reactionused(sSource) == 1 then
local nodeSource = DB.findNode(sSource)
local sActorName = ""
if nodeSource then
sActorName = ActorManager.getDisplayName(nodeSource)
end
if sActorName == "" then
sActorName = rNewEffect.sName
end
return sActorName .. " tried to use " .. rNewEffect.sName .. " but couldn't react in time"
end
DB.setValue(sSource .. ".reaction", "number", 1)
return nil
end
```
From my testing so far, this seems to bring back the normal effect-added chat messages while still keeping the reaction check logic working for `(RCT)` effects.
Can someone double-check this on their side and make sure I didn’t break anything else?
Hi,
I already have this fix sat in Test ready to go to Live when the new update is published (hopefully this month).
Cheers, Steve.
Found the issue:
You have a typo:
EffectManager.setCustomOnEffectAddIgnoreCheck(newo nEffectAddIgnoreCheck) should not have the space?
Still not working. It looks like the function takes arguments but your code does not pass them through....
Not sure...not working for me.