-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request
Description
I encountered an issue where my companion keeps spamming callout messages to a specific enemy NPC even though we avoided combat with that enemy. The companion continues sending messages to the same NPC repeatedly.
I’m not entirely sure how the callout logic works internally, but I temporarily fixed this on my side by adding a distance check in the callout validation function to limit callouts only to nearby enemies.
Here is my fix to the is_valid_callout function:
local MAX_CALLOUT_DISTANCE = 30 -- adjust as needed
function is_valid_callout(npc_obj, target_obj)
local is_valid =
(queries.get_game_time_ms() - last_callout_time_ms) > callout_cooldown_ms and
queries.is_living_character(npc_obj) and
queries.is_living_character(target_obj) and
queries.are_enemies(npc_obj, target_obj) and
not queries.is_in_combat(npc_obj) and
queries.get_distance_between(npc_obj, target_obj) <= MAX_CALLOUT_DISTANCE
if is_valid then last_callout_time_ms = queries.get_game_time_ms() end
return is_valid
endCopilot
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request