Monster Deaths and Monster Drops

Joshua Mason

New member
Hello.
I finally got my melee working! Woot. I'm using the adventure module with custom objects/monsters. Right now when my mobs die they're dropping a sprite, but it could be one of many. It's a chunk of my player's head.

nesfrag.jpg

nessprites.jpg


What I'd like is for that 1x2 bone to be the health pickup, but I'd like it to drop randomly, not every time.
I've also been searching for a tutorial for monster death animations. If anyone's seen one, let me know.

Thanks in advance.
 

WillElm

New member
If your handleDrops is like mine, you should have this at the bottom:

donePickup:
;;; ALL cases create a "pow"
CreateObject temp, temp1, #$09, #$00, temp3

the number after temp1 is your monster death animation- for me it corresponds to my tenth object, as seen here.

Capture.PNG

Then, just set up that object (object details->actions-tick ignore gravity and end of action destroyme with a timer of 1)

play around with the animation and see what you like
 

dale_coop

Moderator
Staff member
Yep, it 's your monster death animation and your monster drops ;)
set your Monster Death Animation object (the 9th element... starting from 0 - Player)... and your Health Pickup, your Charge Pickup and you Currency Pickup ;) (because when you kill a monster, it drops one of these items randomly and sometimes none... it's coded that way)
If not set, each objects is just the tile 0 (the first tile of your gameobjecttiles.bmp) and currently that tile is your player head (left half of his head :p)
 

Joshua Mason

New member
Cool, Thanks for the help. Got the monster death working, but they're still not dropping anything - killed like 100 of the buggers. I've set the pickup objects, but I'm missing something. Not seeing anything about drops in any of the tutorials.
 

Anthrax101

New member
Hey! I'm new to the Nesmaker forums, and Nesmaker, for that matter. I'm having trouble getting my melee to work. How did you get yours to work?
 

dale_coop

Moderator
Staff member
Joshua Mason said:
Cool, Thanks for the help. Got the monster death working, but they're still not dropping anything - killed like 100 of the buggers. I've set the pickup objects, but I'm missing something. Not seeing anything about drops in any of the tutorials.

You need to fix the Handle Monster Drops script first:
http://nesmakers.com/viewtopic.php?f=35&t=1740
 

baardbi

Well-known member
I can't get this to work in the Platform module. At first nothing happened. Then I realised there was an RTS at the top of the script (HandleDrops.asm). When I uncommented the RTS things started happening. But monster death does not work. Randomly the monster death animation will appear in the HUD. I'm guessing the monster death animation is acting like a pick-up of some sort. Is there an easy way to get monster death animation working in the Platform module?

Here's a screenshot of the monster death animation in the HUD:

monsterdeath.png


My HandleDrops.asm file:

Code:
	;RTS ;; skip drops
;;; monster objects drop at random.
	LDA Object_x_hi,x
	STA temp
	LDA Object_y_hi,x
	STA temp1

	JSR GetRandomNumber
	AND #%00000111 ;; now, we have a number between 0 and 7
	BNE notPickup0 ;; 
	;; zero case here;
	;;; here, we'll create health
	CreateObject temp, temp1, #$04, #$00, currentNametable
	JMP donePickup
notPickup0:
	CMP #$01
	BNE notPickup1
	;; one case here;
;;; here, we'll create currency
	CreateObject temp, temp1, #$07, #$00, currentNametable
	JMP donePickup
notPickup1:
	CMP #$02
	BNE notPickup2
	;; two case here;
	;;; here, we'll create currency
	CreateObject temp, temp1, #$07, #$00, currentNametable
	JMP donePickup
notPickup2:
	;;;; do the same for each case.
	;;;; blank cases will simply return 'nothing'.
	
	
	
	
donePickup:	
	;;; ALL cases create a "pow"
	CreateObject temp, temp1, #$09, #$00, currentNametable
 

baardbi

Well-known member
It certainly works much better now. But the monster death animation still acts as a pick-up. The monster death animation appears randomly. I mean it only happens sometimes when an enemy is killed. I looked at HandleDrops.asm and as far as I can see, all cases in HandleDrops should en up with donePickup. So this does not make sense to me...

PS! I have created the OBJ_MONSTER_DEATH constant in Project Settings.
 

dale_coop

Moderator
Staff member
hmmm... I am pretty sure that the constant OBJ_MONSTER_DEATH should already exist in your Project User > User Constants (you should check again... at the begining of the list)
 

baardbi

Well-known member
You're right. OBJ_MONSTER_DEATH was the second constant, so I removed the one I made. However I still can't get this to work... The monster death animation only appear sometimes. Seems like I have some bug hunting to do... ASM here I come :lol:
 

dale_coop

Moderator
Staff member
Depends how well you followed my tutorials about Handle Drops...
But basically, there are 3 way to executes it: when you kill a monster with your projectile object or your Melee object... when you kill a monster with a sprite based weapon... and when you kill amonster jumping on him.
Each of them are in 3 different scripts (handle hurt monster... handle sprite weapon... and handle object collision)

So, it depends of how you kill the monsters in your game.
 

baardbi

Well-known member
I kill my monsters with a projectile. So I'm pretty sure I have done everything according to your tutorials.

I have found a dirty trick that makes it work now. But obviously I can't have random drops with this solution.

There almost seems to be something strange going on with my GetRandomNumber.

Here's my little hack in HandleDrops.asm: :lol:

Code:
	;JSR GetRandomNumber
	LDA #$00 ;************ Bårds dirty hack :) :) :) *********************
	;AND #%00000111 ;; now, we have a number between 0 and 7
	BNE notPickup0 ;; 
	;; zero case here;
	;;; here, we'll create health
	CreateObject temp, temp1, #$04, #$00, temp3
	JMP donePickup
 

dale_coop

Moderator
Staff member
Hmmm... but now you don't have random anymore.
It's always the first pickup object. Right?

the "normal" way of handle drops is... it creates randomly pickup 0 or pickup 1 or pickup 2 or no pickup object.... and creates in every case, the animation death object.
In the default script... I think pickup 0 is the "health pickup", pickup 1 & pickup 2 are the same, the "currency pickup".

If you need help, tell exactly what you want for your handle drops... and share your script ;)
 

baardbi

Well-known member
Thank you, but I'm finally starting to get a little comfortable around 6502 assembly, so I'm going to try a couple of things by myself first :) I'll post the code here if I get completely stuck... :oops: :D
 

baardbi

Well-known member
Actually there is something I need help with, but I'll post it in a new thread, since it has nothing to do with this.
 
Top Bottom