AI Interaction Manager
Last updated
Was this helpful?
Last updated
Was this helpful?
The AI Interaction Manager (AC_AI_InteractionManager) is responsible for handling NPC interactions, primarily focusing on dialogue and vendor logic. It determines which dialogue should be displayed based on the player's progress and displays the associated dialog entry upon interaction. Additionally, it allows NPCs to function as vendors, providing a seamless transition from dialogue into a shop or trade interface.
It is added to the Soulslike NPC (B_Soulslike_NPC) class by default.
Dialogue Handling
Upon interaction with an NPC, the BeginDialog
method is triggered. It ensures that a reference to the player's Progress Manager and the NPC’s Dialog Asset is valid before proceeding.
It fetches the appropriate Dialog Table based on the player’s progress and resets the dialog index to 0.
The dialog index is adjusted accordingly, either moving to the next line or exiting the conversation.
If the player exits mid-dialog, the system ensures that the dialog index is adjusted appropriately (so that entries that execute gameplay events cannot be re-triggered).
Executing Gameplay Events
Vendor Handling
Upon completing the last dialog entry, the system checks if the NPC has an associated vendor asset.
If a vendor asset is found, the NPC Window is set up, transitioning the player into the vendor/shop interface.
If no vendor asset is present, the conversation simply ends.
If the current dialog entry has an event, it triggers it via -> ExecuteGameplayEvent().