[4.1] Adding Ammo system (charging weapon) for your projectiles in the Platformer module

dale_coop

Moderator
Staff member
Ii think there migh be a bug in the var tiles hud code (by default in nesmaker)... I could take a look at your project and try to find how to fix that issue.
 

laurentpb

New member
Hi , I did my code to show my ammo by myself and I have the exact same bug as you (it seems the hud takes the Health every time you change screen and distribute the value to every var tile of the hud).

I think too that it is a problem from the software by itself, have you find it?
 

dale_coop

Moderator
Staff member
Yup, it's an issue in the 4.1.5 engine (In the script assigned to the "Hud Element 0"), it's hardcoded to read the health variable.
 

laurentpb

New member
Yes you are right, do you know how we could inplement a condition to change the value in the scripts. Is there anyway to have access to the hud number to hardcode it by ourself.
like myAmmo is the third element

LDA (the hud number)
cmp #$04
BNE +
LDA myAmmo
STA hudElementTilesToLoad
JMP ++
+
LDA myHealth
STA hudElementTilesToLoad
++
 

dale_coop

Moderator
Staff member
Yep you could try something like:

Code:
	LDA DrawHudBytes
	AND #%00100000   ;; if 3rd element
	BEQ +
	LDA myAmmo
	STA hudElementTilesToLoad
	JMP ++
	+
	LDA myHealth
	STA hudElementTilesToLoad
	++
 

dale_coop

Moderator
Staff member
De rien ;)
You still can do like I do... try to understand, guess, try some code, break everything, try again :p haha
 

Hollow

New member
I'm trying to do this on 4.5. Despite the directories not matching up with what I see on my side I still tried to follow along, I'm not having any luck.

Ex. \GameEngineData\Routines\BASE_4_5 My directory looks like this, there's no "Basic" folder
 

dale_coop

Moderator
Staff member
It's an old script.
That is a script for the 4.1.x, you can't use it for a NESmaker 4.5.x. It won't work... It might break your project.
All the topic have the version specified, the tutorials and scripts will work ony for the version that is made for.
Sorry
 
Top Bottom