Bucket Mouse
Active member
I've been trying to rig my autotext tile so that it doesn't display the text again when a screen trigger is tripped. I used the code they use for detecting triggered screens elsewhere:
I've run into a problem...turns out that code doesn't check to see if a trigger is active on the screen. It checks to see if a trigger has been assigned to that screen AT ALL, whether it's tripped or not. So if I've assigned a trigger number to the screen, the text won't appear.
I don't know how to adjust it because I'm unfamiliar with the math involved here. How do I get this stupid code to check if A TRIGGER IS ACTIVE, not IF A TRIGGER IS ASSIGNED?
Code:
;; CHANGE to a "0 - Walkable" special Tile "UnderSecret"
LDA screenType
;; divide by 32
LSR
LSR
LSR
;LSR
;LSR
;;; now we have the right *byte* out of the 32 needed for 256 screen bytes
TAY
LDA screenTriggers,y ;; now the rigth bit is loaded into the accum
STA temp
LDA screenType
AND #%00000111 ;; look at last bits to know what bit to check, 0-7
TAX
LDA ValToBitTable_inverse,x
AND temp
BNE finishedWithAutoText
CPX player1_object ;; check if it is the player (not a monster)
BNE finishedWithAutoText
ChangeTileAtCollision #$00, underSecret
LDA #$01
STA textBoxFlag
JSR dodrawTextBox
finishedWithAutoText:
;;RTS
I've run into a problem...turns out that code doesn't check to see if a trigger is active on the screen. It checks to see if a trigger has been assigned to that screen AT ALL, whether it's tripped or not. So if I've assigned a trigger number to the screen, the text won't appear.
I don't know how to adjust it because I'm unfamiliar with the math involved here. How do I get this stupid code to check if A TRIGGER IS ACTIVE, not IF A TRIGGER IS ASSIGNED?