UPDATE 9/13/2020
I think I have both of these bugs fixed now!
Yay me!
------BUGS I NEED HELP WITH-------
1. My player death plays inconsistently. Some screens it plays fine, others it doesn't play. It for sure plays fine on screen 0x0 not sure why that is. I have copied this screen to another screen and it doesn't play the death animation. Death is caused by Monster Weapon object that is transparent.
Here is my doHandleHurtPlayer.asm
Code:
LDX player1_object
LDA Object_x_hi,x
STA tempA
LDA Object_y_hi,x
STA tempB
LDX Object_screen
LDA Object_screen,x
STA tempC
;Death
CreateObjectOnScreen tempA, tempB, #$0A, #$00, tempC
;Legs
LDA tempA
ADC #$10
STA tempA
LDA tempB
ADC #$18
STA tempB
CreateObjectOnScreen tempA, tempB, #$0B, #$00, tempC
LDX player1_object
DestroyObject
It saves the player position, destroys it, then creates 2 objects, the main death animation and then the legs as a separate object. So I think something else is interfering with this, but I am not sure where to start looking.
2a. I am working with (what is essentially) the Brawler mod script WaitForXproximity.asm. I would like to have my monster only check Proximity in the direction it is facing. The code currently gets the players position, then compares it with the monster and if it is within so many pixels then ChangeActionStep. But I need to add something so it based on direction. How does this sound? Do i need to rethink this?
Code:
LDA Object_direction,x
if its Left go compare the players x (tempA) to Object_x_hi,x
If it is less than then doProxyThing
otherwise +skip
but if check Object_direction,x is Right
if its Left go compare the players x (tempA) to Object_x_hi,x
If it is greater than then doProxyThing
otherwise +skip
I can't quite wrap my brain around the logic yet. I need more sleep.
2b. I am also trying to skip the Proximity when Object_vulnerability bit 6 is checked.
Code:
LDX player1_object
LDA Object_vulnerability,x
AND #%00000100
BEQ +skip
JMP doProxyXCheck
doProxyXCheck:
;;; this behavior will wait until there is proximity between the object and the player in the x position,
;;; and then jump to the next behavior when the condition is true.
TXA
PHA
LDX player1_object
LDA Object_x_hi,x
STA tempA
LDA Object_screen,x
STA tempB
PLA
TAX
LDA tempB
CMP Object_screen,x
BNE +skip
LDA tempA
SEC
SBC Object_x_hi,x
BCS +distIsPos
;; dist is neg
EOR #$FF
ADC #$01
+distIsPos
CMP #$64
BCC +updateActionStep
JMP +skip
+updateActionStep:
;; jump to next action state.
TXA
STA temp
;GetActionStep temp
;CLC
;ADC #$01
;AND #%00000111
;STA temp1
ChangeActionStep temp, #$06
+skip
And here is my player details and what Bit i have checked
This is pretty much the Brawler WaitForXproximity.asm, but I added a check Object_vulnerability at the beginning. However, checking the Object_vulnerability doesn't appear to be working. My player action steps 02 and 03 have Object_vulnerability bit 6 on the PLAYER is checked. My monster action step has the Proximity script set on repeat, which works as intended. The Object_vulnerability part at the beginning won't trigger the proxy code and won't allow me to activate the player animations that are checked as bit 6.
Any help is appreciated! Thanks