NPC Tile Misbehaving

cargo

spam bots yandex
I created a sign for my game and assigned it the "NPC Tile" attribute. Sure enough if the player is pushing up while walking over the sign then a pop up message is triggered. By accident I discovered that if a monster is touching the sign while the player is pressing up the message gets triggered too regardless of the player's position on the screen:

npctile-shenanigans.gif
 

dale_coop

Moderator
Staff member
LOL, very fun issue ;)

You could try to fix the NPCtile.asm script, modifying it like that:
Code:
;;; NPC TILE
	CPX player1_object
	BNE +		;; if not the Player, skip
	
	LDA gamepad
	AND #%00000010
	BEQ +
	LDA textBoxFlag
	BNE +
	LDA #$00
	STA stringTemp
	LDA #$01
	STA textBoxFlag
+:
 

cargo

spam bots yandex
Thanks Dale. I think that did it. Am I to understand when this script gets triggered the value of a monster_object should be on the accumulator?
 

dale_coop

Moderator
Staff member
cargo said:
Thanks Dale. I think that did it. Am I to understand when this script gets triggered the value of a monster_object should be on the accumulator?

In fact the monster_object is loaded in the X registry ;)
It's the reason we can compare X to the player1_object ("CPX player1_object") and if it's equal ("BEQ"), we can skip the script ;)
 
Top Bottom