Stop Sprite Animations While Text Is Onscreen (4.1.5)

Post Reply
User avatar
Bucket Mouse
Posts: 384
Joined: Wed Mar 07, 2018 2:25 am

Stop Sprite Animations While Text Is Onscreen (4.1.5)

Post by Bucket Mouse » Sun May 24, 2020 1:48 am

If you stop an NPC and talk to them while they're in a walk cycle, they will continue to walk in place while talking to you. It looks bad, and the hack solution has been to make the sprites disappear entirely when the text box appears, which isn't always acceptable.

Fortunately the solution is so simple it can be solved in three lines. The text box has its own trigger that is only on while the box is onscreen. Three lines of code at the beginning of the script that handles sprite animation will skip it all if this text trigger is sensed to be on.

Look up DrawSprites.asm in Module Scripts / Main Scripts and scroll to near the end. The animation code is clearly marked with this:

;;;Handle This object's animation:

Directly below that line, insert this:

Code: Select all

;;; THIS ADDED BIT WILL STOP ALL SPRITE ANIMATIONS DURING TEXT DISPLAYS

    LDA gameHandler
    AND #%00100000
	BNE notAtEndOfFrame

;; END OF ADDED BIT
And now NPCs will no longer distractingly wiggle during your important speech!
Post Reply