Weapon damage question

User avatar
red moon
Posts: 148
Joined: Mon Aug 12, 2019 12:19 am

Weapon damage question

Post by red moon » Tue Oct 08, 2019 3:32 am

Hello,
I wanted to check and see if I could get a little help with understanding weapons and enemy health.

When attacking an enemy that is set to 4 health, the projectile works as intended, but my melee weapon destroys the enemy with a single hit. Is there a way to set the melee weapon damage to work like the projectile source? I looked at the object settings and see strength settings but no damage.

Thank you, I looked through the forums but did not see anything similar.

And I am still looking into the sprite positioning of the projectile and its facing when shooting left. I am not sure what happened there yet, the melee sprite is in the right place but not the projectile.
Thanks in advance!

User avatar
dale_coop
Posts: 4206
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Weapon damage question

Post by dale_coop » Tue Oct 08, 2019 8:49 am

Hey red moon,
For the projectile offset, I replied on the other post ;) (you need to click on the the "Melee" buton to change it to "Projectile"... for settings the projectile offsets)

And about the damage of your sprite weapon... it's because it's designed to be a death weapon (1 hit kill), by default in NESmaker. But you can modify this behaviour to make it work like the projectile (1 hit = -1 on monster's health), following this tutorial:
http://nesmakers.com/viewtopic.php?f=35&t=1738
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE / UNDERGROUND ADVENTURE (Arcade version - Byte-Off-2019)
User avatar
red moon
Posts: 148
Joined: Mon Aug 12, 2019 12:19 am

Re: Weapon damage question

Post by red moon » Tue Oct 08, 2019 8:08 pm

Wow, I did not know that box could toggle between the two! That did it Dale and I switched to the script you wrote to replace handlespriteweapon which allows for multiple strikes on the enemy. One thing that changed however is enemies no longer drop pickups after dying.
They were when it used the original 1 hit punch.
Thank you for all your help so far!
I placed a screen here in case its set improperly,
Attachments
enemydeath.jpg
enemydeath.jpg (730.32 KiB) Viewed 111 times
User avatar
dale_coop
Posts: 4206
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Weapon damage question

Post by dale_coop » Tue Oct 08, 2019 11:32 pm

Check again your HandleSpriteWeapon.asm script...
And compare with the one from http://nesmakers.com/viewtopic.php?f=35&t=1738
Make sure the line "JSR HandleDrops" is in the script, around line 121 (and not commented out).
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE / UNDERGROUND ADVENTURE (Arcade version - Byte-Off-2019)
User avatar
red moon
Posts: 148
Joined: Mon Aug 12, 2019 12:19 am

Re: Weapon damage question

Post by red moon » Wed Oct 09, 2019 12:20 am

Hey Dale,
there is a line about monter (monster) locks afterward, should I cut that out?
Attachments
line121.jpg
line121.jpg (456.2 KiB) Viewed 99 times
User avatar
red moon
Posts: 148
Joined: Mon Aug 12, 2019 12:19 am

Re: Weapon damage question

Post by red moon » Wed Oct 09, 2019 12:44 am

I found this as well, its an earlier post you had made to limit 1 projectile at a time. I wasn't sure if it was compatible with the b_create_projectile_platformer code I added from your earlier post. I added it, but did not notice a change.
Attachments
limit.jpg
limit.jpg (164.02 KiB) Viewed 95 times
User avatar
dale_coop
Posts: 4206
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Weapon damage question

Post by dale_coop » Wed Oct 09, 2019 2:16 pm

Those scripts look correct.
How about the script assigned to the "Handle Monster Drops" element (in Project Settings > Script Settings) ? Could you also share it?
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE / UNDERGROUND ADVENTURE (Arcade version - Byte-Off-2019)
User avatar
red moon
Posts: 148
Joined: Mon Aug 12, 2019 12:19 am

Re: Weapon damage question

Post by red moon » Wed Oct 09, 2019 4:59 pm

Dale,
I located the handle drops script here: ModuleScripts\HurtWinLoseDeath
I did not find one that was specific to monsters, only this one.

Code: Select all

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
User avatar
dale_coop
Posts: 4206
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Weapon damage question

Post by dale_coop » Wed Oct 09, 2019 6:15 pm

Yeah as you can see, this script is the default one...
And starts with a "RTS" which means "stop the script here". So this script does nothing.
You'll have to follow (agin?) the tutorial "[4.1] Quick fix for the monster drops issue" to get back your MonsterDrops:
http://nesmakers.com/viewtopic.php?f=35&t=1740
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE / UNDERGROUND ADVENTURE (Arcade version - Byte-Off-2019)
User avatar
red moon
Posts: 148
Joined: Mon Aug 12, 2019 12:19 am

Re: Weapon damage question

Post by red moon » Wed Oct 09, 2019 7:24 pm

Dale,
It's so close!
I went ahead and updated the handledrops, handlehurtmonster and handleobjectcollision and in most cases it works fine. There are some instances of it dropping health pickups for some reason and a odd combination of sprite elements as you can see at the end of orb2. Its really close, thanks for the help so far!
I can always revert some of these, I was not sure if I was meant to change all of them!


Post Reply