My game wont compile anymore!

McCully96

New member
I've been having trouble with NESMaker, it works but when you restart your computer it just messes up the program. Yesterday, my adventure game was working 100% fine, now I can't compile it and it keeps giving me script errors which I didn't change so I don't know what's happened. When I compile the game I get this:
pass 1..
pass 2..
last try..
Routines\Basic\ModuleScripts\PowerUpCode\Powerup_IncreaseHealth.asm(33):playSound(3): Unknown label.
demo.txt written.

Anyone know how to fix this?
My HUD colour also changed from black to green and I don't know how to change it back
 

dale_coop

Moderator
Staff member
If you open the Powerup_IncreaseHealth.asm script at the line 33 (as the error), you'd see:
Code:
skipGettingHealth:
	PlaySound #SFX_INCREASE_HEALTH

Now, in NESmaker, check your Sounds > SFX... if you don't have the sfx named "SFX_INCREASE_HEALTH" add a new one and name it "SFX_INCREASE_HEALTH" (and associate a sound to that SFX Label).

2019-05-17-14-29-54-Window.png


Save your project and retry ;)
 

McCully96

New member
That worked perfectly thank you very much! Although I do have one more question, how do I actually pick up the health pickup? When I place it in the game I just end up walking over it, do I have to assign the game object to the health pickup script?
 

dale_coop

Moderator
Staff member
Check your Pickup object... open its "Object Details". Then, in the "details" tab, set it as "pickup / powerup".
Also set the "Edge Object Reaction" to "Screen Extend". And don't forget to set a Bounding Box.
 

McCully96

New member
Thanks, I can pick up the item now but it doesn't add another heart to my overall health, do I need to add that to the script?
 

dale_coop

Moderator
Staff member
How have you assigned the Powerup_IncreaseHealth.asm script to your project? (in "Project Settings > Script Settings"?)
Which object are you using as health pickup? The 1st pickup object in the hierarchy list (under "Game Objects")?

Also :
What is the value of your Player 's Health (in the "Object Details > Details" tab)?
What is the value of your myHealth HUD variable (in the "HUD & boxes > Hud variables" tab)?
How do you display the myHealth element (in the "HUD & boxes > Hud elements" tab)? as a number? as hearts?

Don't hesitate to share screenshots... ;)
 

McCully96

New member
Okay so I looked through other threads and found a slightly modified script so it works perfectly and updates the HUD, I just now need to figure out how to make the pickup disappear completely once picked up. If I move to the next screen and back again it reappears which, y'know, could be exploited!
 

dale_coop

Moderator
Staff member
If you don't want it to be again on the screen, if you re-enter the screen, you need to trigger the screen.
Triggered screen don't load the same objects (monsters). When a screen is triggered, all the screens that have the same screen-type value are triggered too (you can set the screen-type of your screen in the "Screen Info" dialog).

If you want to trigger the current screen when you pickup the object, modify the Powerup_IncreaseHealth script, adding at the end:
Code:
	TriggerScreen screenType
 
Top Bottom