Some Improvements for Scripts

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
WeiYiHua
Posts: 12
Joined: Mon Mar 25, 2024 10:27 pm

Some Improvements for Scripts

Post by WeiYiHua »

Hello,

I’d like to suggest some small improvements:

StandardUIQTEControls.cs – Add a null check in IsQTEIndicatorVisible to prevent issues when QTEIndicator is destroyed in certain cases.

DialogueSystemTrigger.cs – Modify Start to check colliders in child objects to support scenarios where colliders are not directly attached to the main object. Also, make most functions virtual for better extensibility, allowing easier subclassing, such as implementing IInteractableTarget.

Condition.cs – Add a bool option for IsAcceptedGameObject and IsAcceptedTag to determine whether the parent or grandparent object should be checked when a child collider is passed. This ensures that if a child object with a collider is used, it can still correctly recognize the intended parent.

BarkOnIdle.cs – Modify TryIdleBark to check barkUI.isPlaying and skip Bark if playing. This prevents the current Bark from being interrupted by a new one, as Bark texts can have varying lengths and durations.

BarkController.cs – Modify PlayBarkSequence, as the calculation of BarkDuration seems problematic. It would be more appropriate to process barkText first and then pass it to DialogueManager.GetBarkDuration to ensure accurate timing.

DatabaseManager.cs – Add OnBeforeDatabaseAdd, OnAfterDatabaseAdd, OnBeforeDatabaseRemove, and OnAfterDatabaseRemove events to allow custom logic to track and modify the database before and after changes occur.

DialogueSystemController.cs – In InitializeDatabase, after new DatabaseManager(initialDatabase), add an OnDatabaseManagerCreated event to allow custom logic to track and modify the database when it is initialized.

DialogueActor.cs – Split applyColorToPrependedName into two separate bool parameters, allowing three configurations for text output:
Colored text only
Colored name + colored text
Colored name + uncolored text

Hope these can be considered. Thanks!
User avatar
Tony Li
Posts: 22655
Joined: Thu Jul 18, 2013 1:27 pm

Re: Some Improvements for Scripts

Post by Tony Li »

Hi,

Thanks for your suggestions! Most of these can be added. The ones that change existing functionality probably will need to be modified if they're added at all, so they don't break existing projects.
WeiYiHua
Posts: 12
Joined: Mon Mar 25, 2024 10:27 pm

Re: Some Improvements for Scripts

Post by WeiYiHua »

Thanks! Looking forward to the next update!
Post Reply