4.5.9 Monsters With Hit Points In Platformer Module

TheRetroBro

Active member
To my shock, I've discovered monsters with hit points are not standard in modules that are not Adventure. This means it is not possible in the unaltered Platformer module to create a boss that takes more than one hit to go down! Sure hope someone got fired for that blunder.

But we can fix it! Go to the PlatformBase module and find the hurtPlayer-PlatformBase script (should be in the Common folder). Open it and around line 20, you'll spot this:

LDX otherObject
That's the moment your sprite's foot hits the monster. We're gonna borrow some code from Adventure and paste it right below that, The end result should look like this:

Code:
        LDX otherObject
            TXA
    STA temp
    GetActionStep temp
    CMP #$07 ;; we will use action step 7 for hurt.
    BEQ +doSkipHurtingThisObject ;; if he is hurt, he can't be hurt again.
        ChangeActionStep temp, #$07
        DEC Object_health,x
        LDA Object_health,x
        BNE +doSkipHurtingThisObject
            DestroyObject
    +doSkipHurtingThisObject
      
        CountObjects #%00001000
..and it continues from there unaltered.

Now your bosses have hit points and won't disappear instantly. You set these hit points by going to the monster GUI in NESMaker, hitting the "Object Details" button, hitting the "Details" tab and adjusting the Health number. KEEP IN MIND the default for every monster in Platformer is zero, and this must be changed to at least one! When hit points are applied, "zero" is interpreted as "invincible."

Note: if you've modified your platformer to use melee weapons or guns, you might also have to paste this code somewhere else. I don't know where that would be at this time, as I don't have a game ready that's been modified like that. If you find it yourself, post a follow-up.


BONUS PROJECT: GIVE YOUR BOSS A DEATH ANIMATION
If you want your boss to have a death animation before it disappears, then take the code above and replace "DestroyObject" with this:

ChangeActionStep temp, #$06

Now assign that animation to Action Step 6 in the monster GUI. Be sure to set the End Action to "Destroy Me."
In fact, if you use this you will have to make every monster's Action Step 6 end in Destroy Me or they will live forever. That's why this is optional. Not a big deal for everyone, but it might be for some people.
Yeah this didn't work Just made my enemy invincible lol
 

101010

Member
yeah, it doesn't work anywhere. sad...
I'm trying to figure this out now. what's silly is that hurtMonter has the code to hurt the monster...it just doesn't do anything lol
nesmaker is just a hot mess
 

tbizzle

Well-known member
@101010 @TheRetroBro
Has anyone figured this out for the shooter module too?
Is this what you guys need????

 
Top Bottom