How do I change the sword hit damage?

vanderblade

Active member
I apologize if this is a stupid question, but I want to change the hit damage of the base sword in the Adventure Module. I am using 4.1 right now.

The "fireball" is perfect and seems to adjust to enemy hit points, but the "sword" oneshots everything.

Thanks!

And this is my second day using Nesmaker -- it's so great!
 
vanderblade said:
I apologize if this is a stupid question, but I want to change the hit damage of the base sword in the Adventure Module. I am using 4.1 right now.

The "fireball" is perfect and seems to adjust to enemy hit points, but the "sword" oneshots everything.

Thanks!

And this is my second day using Nesmaker -- it's so great!

You could try increasing the health of your enemies.
 

vanderblade

Active member
I tried that. It works for the fireball, but the sword ignores extra hit points and still oneshots everything.

Any solution?
 

dale_coop

Moderator
Staff member
You right, the weapon kill oneshot ennemies.
To change that, it would require some modifications in the HandleSpriteWeapon.asm script (because the weapon is not an object, but a sprite drawn when the player is in attacking state).
 

vanderblade

Active member
It seems the default sword is broken in 4.1 right now.

It ignores enemy hit points. It ignores "immune to player" option. It's basically a god weapon.

I'm afraid to mess with the code. Any quick fix that's easy to implement?
 

TurtleRescueNES

Active member
I temporarily deactivated my melee weapon for the same reason. I want to restore my object based weapon, but haven't gotten there yet.
 

dale_coop

Moderator
Staff member
I think it is doable but you would need to deactivate some code in the predraw script and the handleswordsprite.
 

dale_coop

Moderator
Staff member
Here's an HandleSpriteWeapon_UsingMonsterHealth.asm that I propose (based on the original HandleSpriteWeapon.asm script): http://nesmakers.com/viewtopic.php?f=3&t=1738
 

vanderblade

Active member
Thanks! I'll give it a try -- and hope for the best.

Are you going to try to fix the monster lock issue and the enemy dropping items issue too by any chance? :D
 

Mugi

Member
monster drops should start working if you open the file; ModuleScripts/HurtWinLoseDeath/HandleDrops.asm
and remove the first line of the file.

Code:
    RTS ;; skip drops
 

dale_coop

Moderator
Staff member
vanderblade said:
Thanks! I'll give it a try -- and hope for the best.

Are you going to try to fix the monster lock issue and the enemy dropping items issue too by any chance? :D

The fix for drops is here :
http://nesmakers.com/viewtopic.php?p=10649#p10649
 

vanderblade

Active member
Thanks, Dale!

So, the sword works now and enemies drop items.

However, when I pick up the heart, my health isn't replenished. By the way, you're a god damn hero!
 

dale_coop

Moderator
Staff member
For your health pickup... in the "Project scripts > Script settings", check that the corresponding PowerUp is assigned to the "Powerup_IncreaseHealth.asm" script.
 

vanderblade

Active member
Assigning any of the powerups to their corresponding code creates a compiling error.

So there must be something wrong in the code. This is probably why Joe disabled them. Damn it!

You have a fix?
 

vanderblade

Active member
This is what pops up when the emulator tries to load the game file.

Routines\Basic\ModuleScripts\PowerUpCode\Powerup_IncreaseHealth.asm(33):playSound(3): Unknown label.
demo.txt written.

Looks like I have to do something with the #SFX_Increase_Health sound?

UPDATE: I switched out the #sfx_Increase_Health sound for sfx_myst (the actual name in the game files).

So, now the game runs and the heart makes a sound when I pick it up, but my HUD still does not update with an increased heart.
 

dale_coop

Moderator
Staff member
Yep when label error on PlaySound, it’s just the SFX doesn’t exist in your project (you can add the missing SFX in the “Sounds > SFX”).
Or comment out the line in the script (adding a ; at the begin if of the line).

It doesn’t work? Weird...
To which powerUp did you assign the script?
Which gameonject are you using for health?
Can you share screenshots of your hud variables and the hud health element ?
 

vanderblade

Active member
I'm attaching the requested screens. Thanks!
 

Attachments

  • Screenshot (77).png
    Screenshot (77).png
    459.5 KB · Views: 1,598
  • Screenshot (78).png
    Screenshot (78).png
    510.1 KB · Views: 1,598
  • Screenshot (79).png
    Screenshot (79).png
    515.3 KB · Views: 1,598

dale_coop

Moderator
Staff member
Ok, I see... Your health is 6 !
The PowerUp script is hardcoded to check and give 3 for health.
Just replace the #$04 value with a #$07, it should work better in your case ;)
 

vanderblade

Active member
That worked! You're a life-saver!

Now...let's talk about that broken monster lock. It must be an issue with the Handle_CheckForMonsters.asm code.
 
Top Bottom