First I tried to use this: [url]http://nesmakers.com/viewtopic.php?f=40&t=3387[/url]
After messing with the code for awhile to get it to actually not crash, for some reason it ignored all bounding boxes for everything. I don't know why, but all monsters/players bounding box was only the bottom right pixel of their sprite, which obviously messed up pretty much everything. I never intentionally messed with that part of the script, and removing the above scripts put everything back to normal. So...
Second I messed with this: [url]http://nesmakers.com/viewtopic.php?f=40&t=2298&sid=1ee16fd48aed4f1f603054eaacd97711[/url]
This is what I'm working with now, which still doesn't seem to work. When monsters get hit they fly off in the opposite direction until their Action 0 is forced to kick in again. This happens even if I disable recoil completely. I was able to make a boss switch to a specific action state when hit but when I put the same code in the "normal monsters" area it never activates. Plus they still fly off in the opposite direction when they're hit so... there's that.
This is how that script looks as of now:
Code: Select all
HandleObjectTimers: ;; Updated version by Chronicler Of Legends 3_3_19 ;;; handle object timers, tool LDA Object_timer_0,x BEQ ++ DEC Object_timer_0,x LDA Object_timer_0,x BNE ++ ;; timer is still going. ;;;;; object timer 0 has cycled and is finished. ;;;;; right now, we'll use this to flip hurt/invincible to just invincible, to normal. JMP continueTimer ++ JMP ObjectTimer0Finished continueTimer: LDA Object_status,x AND #%00000001 ;; is it hurt and invincible? BEQ notHurtAndInvincible ;; hurt and invincible LDA Object_status,x AND #%11111110 ORA #%00000010 STA Object_status,x ;; Is this a player, boss, or other object? LDA Object_type,x CMP player1_object BNE + LDA Object_type,x CMP player2_object BNE + ;; Changed this to custom invincibility timer. LDA #PLR_INVINC_TIM ;; my custom invincibility timer constant STA Object_timer_0,x JMP handleObjectTimer_afterSetInvincibility +: ;; Not player object ;; Is it a boss? LDA Object_flags,x AND #%01000000 ;; is it a Boss ;; CUSTOM ID SET IN USER CONSTANTS, you can change this to however you want to flag an enemy as a 'boss' BNE + LDA #INVINCIBILITY_TIMER ;; Same as a normal enemy STA Object_timer_0,x JMP handleObjectTimer_afterSetInvincibility ; +: ;; Add other things that you want to have custom invulnerablity timers here. ; LDA Object_type,x ; this can be any type of comparison that flags the object ; CMP #SOME_ID_HERE ; BNE + ; LDA #CUSTOM_TIMER ; STA Object_timer_0,x ; JMP handleObjectTimer_afterSetInvincibility +: ;; Normal object LDA #INVINCIBILITY_TIMER STA Object_timer_0,x handleObjectTimer_afterSetInvincibility: ;; Is it a boss? LDA Object_flags,x AND #%01000000 ;; is it a Boss BNE + JMP ObjectTimer0Finished ;; Skip resetting the movement +: LDA Object_movement,x AND #%00001111 STA Object_movement,x LDA #$00 STA Object_h_speed_hi,x STA Object_h_speed_lo,x STA Object_v_speed_hi,x STA Object_v_speed_lo,x JMP ObjectTimer0Finished notHurtAndInvincible: LDA Object_status,x AND #%00000010 BEQ ObjectTimer0Finished ;; no longer invincible...not sure what this timer would be doing at this point. ;;; it IS still invincible, need to change it back to normal. LDA Object_status,x AND #%11111100 STA Object_status,x ;;; activate state 0 ;ChangeObjectState #$00,#$02 ;; Is it a boss? LDA Object_flags,x AND #%01000000 ;; is it a Boss BNE + JMP ObjectTimer0Finished ;; Don't reset the action for bosses. +: JSR DoNewAction ObjectTimer0Finished: RTS
I had to change the above script some so the game would not crash and to add the 2nd player, but any other code involving this issue was not really changed from the default script provided or that comes with Dale's 2 Player core. Any help would be vastly appreciated!