mcmilstead
New member
If anyone is running into an issue where some of your monsters are recoiling, there's code somewhere that's causing that, but I'm not sure where. I've found a workaround that works for me. In the doHandlePhysics_PlatformBase script around line 160 is where you find your recoil speed. Right after that, you'll see the code that handles the recoil. You'll need to add some code in there that will check to see if the object is a player or not. Here's what I did.
-----------------------------------
;;;; THESE CONSTANTS WILL DETERMINE THE SPEED OF RECOIL
;;;; THE HURT STATE DURATION
RECOIL_SPEED_HI = #$02
RECOIL_SPEED_LO = #$00
HURT_DURATION = #$01
TXA
STA temp
GetActionStep temp
CMP #$07
BNE +notHurt
;;; this object is hurt.
;;; so it's speed will be determined by the recoil speed above.
;;; any caveats to that, put here. For instance, if there is a monster bit
;;; that prevents recoil.
LDA Object_type,x ;Check to see if the object is a player
CMP #00 ; this assumes your player is in slot #00
BNE +noRecoil ; if not your player skip recoil
LDA #RECOIL_SPEED_LO
STA Object_h_speed_lo,x
LDA #RECOIL_SPEED_HI
STA Object_h_speed_hi,x
+noRecoil
JMP gotHandVspeeds
+notHurt
--------------------------------------------------
I hope this helps someone. I struggled with this on my game for weeks.
-----------------------------------
;;;; THESE CONSTANTS WILL DETERMINE THE SPEED OF RECOIL
;;;; THE HURT STATE DURATION
RECOIL_SPEED_HI = #$02
RECOIL_SPEED_LO = #$00
HURT_DURATION = #$01
TXA
STA temp
GetActionStep temp
CMP #$07
BNE +notHurt
;;; this object is hurt.
;;; so it's speed will be determined by the recoil speed above.
;;; any caveats to that, put here. For instance, if there is a monster bit
;;; that prevents recoil.
LDA Object_type,x ;Check to see if the object is a player
CMP #00 ; this assumes your player is in slot #00
BNE +noRecoil ; if not your player skip recoil
LDA #RECOIL_SPEED_LO
STA Object_h_speed_lo,x
LDA #RECOIL_SPEED_HI
STA Object_h_speed_hi,x
+noRecoil
JMP gotHandVspeeds
+notHurt
--------------------------------------------------
I hope this helps someone. I struggled with this on my game for weeks.