Which object is the default monster object death?

drexegar

Member
I got lucky with the player death being on "effect 1" with the scrolling module,

but I seem to not figure out which effect is the monster death,

I remember I ran into code showing where this points to, but I already spent the last 4 hours trying to figure this out and Im going crazy

Does anybody know how to set up a death effect for the monster? By default it just disappears. I tried every effect and it didn't work.

and its no where to be found in the latest videos.
 

Icon-Ninja

New member
Was literally about to post a very similar question, myself. According to the quick Maze game tutorial, the monster death object is Effect 2, but I'm not 100% sure it even works. I can't find a definition for handling monster death anywhere in code, so I'm in a similar boat as you. I thought maybe there was something in the Handle Monster Hurt script, but the ASM is going a little over my head. Can't seem to find where, if at all, to tell it to change the anim state to the death anim. I really hate the idea of not being able to have unique death anims for each enemy type, so surely it's gotta be in there somewhere...
 

Mugi

Member
this should do it:

monsterhurt.png
 

drexegar

Member
Mugi said:
this should do it:

monsterhurt.png

Im trying but I have a problem:

LDX player1_object
LDA Object_x_hi,x
STA temp
LDA Object_y_hi,x
STA temp1

DeactivateCurrentObject

CreateObject temp, temp1, #OBJ_MONSTER_DEATH, #$00, currentNametable

The object gets created in player1 instead and I cant find the zero page variable for the monster, I look into the monster create code and its use player1_object to create monster??? Im so confused.
 

Mugi

Member
you're loading player object into X (LDX player1_object) and then storing player's position into the temp values.

in the code shown on my screenshot, the monster is already loaded in X
so you can do:

Code:
LDA Object_x_hi,x
STA temp
LDA Object_y_hi,x
STA temp1

to obtain the monsters location
then spawn the monster death object.

keep in mind that this has to be done before the monster dies (DeactivateCurrentObject kills it)
 

drexegar

Member
Mugi said:
in the code shown on my screenshot, the monster is already loaded in X
so you can do:

Code:
LDA Object_x_hi,x
STA temp
LDA Object_y_hi,x
STA temp1

to obtain the monsters location
then spawn the monster death object.

keep in mind that this has to be done before the monster dies (DeactivateCurrentObject kills it)


Well I got this:

LDA Object_x_hi,x
STA temp
LDA Object_y_hi,x
STA temp1

DeactivateCurrentObject

CreateObject temp, temp1, #OBJ_MONSTER_DEATH, #$00, currentNametable


And the object just disappears again with no creation.

OBJ_MONSTER_DEATH is pointed to 9, and there is graphics there.

Weird if I put the Createobject before it, then the monster doesn't die at all, its like its getting created again when I was sure at least the animation will come out.

EDIT: WTF? I comment out the DeactivateCurrentObject and the object is still deactivating!
 

Mugi

Member
seems to work fine for me:

https://youtu.be/kPhR3RLLKM0

though i noticed i accidentally left the "DeactivateCurrentObject" twice in the code, the second one can be removed.

only difference to mine is that i used a straight number #$09 to define the object, instead of the OBJ_MONSTER_DEATH variable, but if your variable is set right, it should do the same thing.
 

drexegar

Member
Mugi said:
seems to work fine for me:

https://youtu.be/kPhR3RLLKM0

though i noticed i accidentally left the "DeactivateCurrentObject" twice in the code, the second one can be removed.

only difference to mine is that i used a straight number #$09 to define the object, instead of the OBJ_MONSTER_DEATH variable, but if your variable is set right, it should do the same thing.

Thank you so much for taking the time out, but its just doesn't work, I check all the code line by line and its exactly the same I change all the settings exactly the way you have, and it still just disappears.

All the code changes Ive made before does not interfere with any of the create an object code, and player death works right out the box...

What could be wrong?

Sheesh I already spent the whole day on this.

EDIT: I can tell ya one thing... I feel like the code is just being skipped over for whatever reason I have a simple code to deactivate controls that works instantly and that doesnt even run when I change the variables there!
 

Mugi

Member
i really have no idea to be honest. Did you double check that your monster death object has it's attributes set properly ? that it has a timer and endaction of destroy me (it will not work without a timer set.)
i would love to help more but im drowning in my own problems with the junk you see running on the screen too. xD
maybe Dale_coop has an idea of what else could cause it.

also just for the sake of sanity checking, try using the straight number #$09 instead of the death object variable too like i did and see if that makes a difference (it should not but im not surprised of anything with this engine anymore.)
 

drexegar

Member
Mugi said:
i really have no idea to be honest. Did you double check that your monster death object has it's attributes set properly ? that it has a timer and endaction of destroy me (it will not work without a timer set.)
i would love to help more but im drowning in my own problems with the junk you see running on the screen too. xD
maybe Dale_coop has an idea of what else could cause it.

also just for the sake of sanity checking, try using the straight number #$09 instead of the death object variable too like i did and see if that makes a difference (it should not but im not surprised of anything with this engine anymore.)

Yes I tripled check and forced 9, but like I say any other variable code I add in that spot will not go through anyway! Im on 4.1.5 I wonder if the update has anything to do. Thanks for your time, if you help with any illustration or music, or something i'm pretty good with that stuff.
 

dale_coop

Moderator
Staff member
I think you’re « handle sprite weapon » s riot might the cause of your issue... ?
Are you using a sprite based weapon ? Or the mellee object one ?
If the object Melee, you could try to diable it, for testing purpose (assign a blank script to the element in the Projet Settongs > Script Settings).
If your using the sprite based weapon, check in the handle sprite weapon script, you would need there to add the monster death createoject lines there.
And if your player’s using a « harmful invincible » action step flag... you would have to take a look at the Handle object collisions script too.
 

dale_coop

Moderator
Staff member
Don't see a lot of possibilities ... Could you check:
1) your monster death animation not set or 2) your handle sprite weapon script that is deactivated (replace with a blankScript)... 3) your player is not set 'harmful invincible' for one of his action step?

Now that a lot of users are using customized scripts... I think it would help me if you could share your NESMaker folder (just need your project MST file, your GraphicAssets and GameEngineData folders)...?
 

drexegar

Member
dale_coop said:
Don't see a lot of possibilities ... Could you check:
1) your monster death animation not set or 2) your handle sprite weapon script that is deactivated (replace with a blankScript)... 3) your player is not set 'harmful invincible' for one of his action step?

Now that a lot of users are using customized scripts... I think it would help me if you could share your NESMaker folder (just need your project MST file, your GraphicAssets and GameEngineData folders)...?

i havent check but with your tutorial you told us to deactivate the handle sprite script with a blank script, so would that interfere with your script if I put it back in?

Also none of my player actions have a "harmful invincible" should I set the attack to that?
 

dale_coop

Moderator
Staff member
Sorry, yes, you need to to deactivate the handle sprite script, else it will interfere with my script. And no, don't set "harmful invincible", this was used by the sprite based sword.

So if you already did all those 3 points... Don't see any obvious reason.
Could your send your NESMaker folder zipped (just need your project MST file, your GraphicAssets and GameEngineData folders)...?
 

drexegar

Member
dale_coop said:
Sorry, yes, you need to to deactivate the handle sprite script, else it will interfere with my script. And no, don't set "harmful invincible", this was used by the sprite based sword.

So if you already did all those 3 points... Don't see any obvious reason.
Could your send your NESMaker folder zipped (just need your project MST file, your GraphicAssets and GameEngineData folders)...?

When you mean monster death animation, You are talking about the object death animation (effect 2 #$09) or do i need to set up a death animation for my monster object???
 

Mugi

Member
okay, so if you're using a sprite weapon, that's one thing that will explain why my code didnt work for you.

im using sprite weapon too, but incidentally i have identical code in place in both handlespriteweapon and handlehurtmonster.asm
the deal is, with sprite weapon the monster hurting is done in handlespriteweapon, and the entire handlehurtmonster.asm can be deleted and has no effect on anything whatsoever.

here i have the same code i had on the handlemonsterhurt.asm inside my handlespriteweapon.asm which does the thing for me.
i actually tested this by deleting my entire handlemonsterhurt.asm and nothing changed lol.... (i really wish we'd have some actual documentation of this engine sometimes lol)
asdasdasdasd.png
 

drexegar

Member
dale_coop said:
Sorry, yes, you need to to deactivate the handle sprite script, else it will interfere with my script. And no, don't set "harmful invincible", this was used by the sprite based sword.

So if you already did all those 3 points... Don't see any obvious reason.
Could your send your NESMaker folder zipped (just need your project MST file, your GraphicAssets and GameEngineData folders)...?

I private message you.
 

drexegar

Member
Mugi said:
okay, so if you're using a sprite weapon, that's one thing that will explain why my code didnt work for you.

im using sprite weapon too, but incidentally i have identical code in place in both handlespriteweapon and handlehurtmonster.asm
the deal is, with sprite weapon the monster hurting is done in handlespriteweapon, and the entire handlehurtmonster.asm can be deleted and has no effect on anything whatsoever.

here i have the same code i had on the handlemonsterhurt.asm inside my handlespriteweapon.asm which does the thing for me.
i actually tested this by deleting my entire handlemonsterhurt.asm and nothing changed lol.... (i really wish we'd have some actual documentation of this engine sometimes lol)

Its called use sprite bases weapon.asm, this is 4.1.5 and i change it to blank.asm for dale code.
 
Top Bottom