[4.5.6] Monsters Control Players Vulnerability (Using Action Step Flag)

Jonny

Well-known member
Limitations to this tutorial...
  • This only works because I know the monster object is the 2nd object drawn to the screen ( #$01 ) as there are no others.
    If you had pickups, other monsters etc you'd need to do something else to ensure you're loading that specific monster object.
  • Skips player hurt entirely so if you DID have another monsters on the screen it wouldn't be able to hurt you either.
    Probably fixable with some extra checks but I'm only a beginner so still figuring that part out.
I hope someone finds this useful. It's a mash up of information from DaleCoop, CutterCross and Vanderblade.
It's not perfect but it's a start if you're thinking of doing something similar to this...

ZAPPER2.gif

This goes at the start of your hurtPlayer_MetroidVania.asm (I've only tried it for this module)
Make a copy before changing it, if you so desire.

Code:
LDX #$01                    ;; LOAD OBJECT INTO X      ;;
LDA Object_vulnerability,x  ;; LOAD VULNERABILITY BYTE ;;
    AND #%00000010          ;; ACTION STEP FLAG        ;;
    BEQ +harmlessCheck      ;; CAN STILL HURT PLAYER   ;;
        JMP +skipHurt       ;; SKIP HURTING PLAYER     ;;

+harmlessCheck:

LDX player1_object          ;; LOAD PLAYER INTO X      ;;

Change the Monster Action Step Flag to whatever you'd like to call it.

actionflags.jpg

For the action step where you do not want the player to be hurt (in this example, when the laser is OFF)
Select the flag in your Object details / Actions.

monsterinfo.jpg

I hope someone found this interesting. It's not very advanced and more of a starter to manipulate into what you want.

Thanks to all the NesMaker gurus for all your help.
 

Jonny

Well-known member
Thank you so much Jonny. Finally I understand how to manipulate monsters directly in code.
This is a more recent and improved way to do it by Dale...
 

Sersichm

New member
Limitations to this tutorial...
  • This only works because I know the monster object is the 2nd object drawn to the screen ( #$01 ) as there are no others.
    If you had pickups, other monsters etc you'd need to do something else to ensure you're loading that specific monster object.
  • Skips player hurt entirely so if you DID have another monsters on the screen it wouldn't be able to hurt you either.
    Probably fixable with some extra checks but I'm only a beginner so still figuring that part out.
I hope someone finds this useful. It's a mash up of information from DaleCoop, CutterCross and Vanderblade.
It's not perfect but it's a start if you're thinking of doing something similar to this...

View attachment 3904

This goes at the start of your hurtPlayer_MetroidVania.asm (I've only tried it for this module)
Make a copy before changing it, if you so desire.

Code:
LDX #$01                    ;; LOAD OBJECT INTO X      ;;
LDA Object_vulnerability,x  ;; LOAD VULNERABILITY BYTE ;;
    AND #%00000010          ;; ACTION STEP FLAG        ;;
    BEQ +harmlessCheck      ;; CAN STILL HURT PLAYER   ;;
        JMP +skipHurt       ;; SKIP HURTING PLAYER     ;;

+harmlessCheck:

LDX player1_object          ;; LOAD PLAYER INTO X      ;;

Change the Monster Action Step Flag to whatever you'd like to call it.

View attachment 3905

For the action step where you do not want the player to be hurt (in this example, when the laser is OFF)
Select the flag in your Object details / Actions.

View attachment 3906

I hope someone found this interesting. It's not very advanced and more of a starter to manipulate into what you want.

Thanks to all the NesMaker gurus for all your help.
I know u said u haven't tried this on other modules. I wanted to make alligators that only hurt u when their mouths are open. U think this would work?
 
Top Bottom