Kanbei85
Member
The AI behavior script : MoveTowardsPlayer_AdventureBase has some major problems.
1) It contains no code to change the monster's facing direction, so it causes the monster to appear to float instead of actually walking under its own power
2) It seems to override or interfere with the recoil mechanic somehow, so it seems to be negating the monster's Health entirely and the monster always dies in one hit.
3) For some reason, it also doesn't play nicely with the StopMoving script, so once the monster starts moving toward the player, it never stops regardless of action step commands.
I cannot fix this, I don't know assembly! This is pretty important, since monsters should be able to actually be aggressive to the player.
Here's the code:
;;; aim towards player.
TYA
PHA
TXA
PHA
STA tempx
LDA Object_x_hi,x
STA tempA
LDA Object_y_hi,x
STA tempB
LDX player1_object
LDA Object_x_hi,x
STA tempC
LDA Object_y_hi,x
STA tempD
LDX tempx
MoveTowardsPoint tempA, tempC, tempB, tempD
LDA Object_direction,x
AND #%00000111
ORA #%00001000
STA Object_direction,x
PLA
TAX
PLA
TAY
1) It contains no code to change the monster's facing direction, so it causes the monster to appear to float instead of actually walking under its own power
2) It seems to override or interfere with the recoil mechanic somehow, so it seems to be negating the monster's Health entirely and the monster always dies in one hit.
3) For some reason, it also doesn't play nicely with the StopMoving script, so once the monster starts moving toward the player, it never stops regardless of action step commands.
I cannot fix this, I don't know assembly! This is pretty important, since monsters should be able to actually be aggressive to the player.
Here's the code:
;;; aim towards player.
TYA
PHA
TXA
PHA
STA tempx
LDA Object_x_hi,x
STA tempA
LDA Object_y_hi,x
STA tempB
LDX player1_object
LDA Object_x_hi,x
STA tempC
LDA Object_y_hi,x
STA tempD
LDX tempx
MoveTowardsPoint tempA, tempC, tempB, tempD
LDA Object_direction,x
AND #%00000111
ORA #%00001000
STA Object_direction,x
PLA
TAX
PLA
TAY
Last edited: