[4.5] First screen of game goes black

offparkway

Active member
Howdy.

I made some changes to my HUD and hurt scripts. All seemed to work, soI tried running the game from the start screen.

My start screens show hearts in the HUD (even though I have it set to hide the HUD), and when the game starts, the first screen flashes for a second and goes completely black, still playing music.

I tried placing the player on other screens, and those seem to work just fine. It's just the first game screen that now won't work properly (it always worked before). I tried walking from another screen to the first screen, and it just goes all black.

Any ideas?

EDIT: I have 3 clones/backup copies of my game and Nesmaker and all its files. I tried loading the backup copies and the first screen goes black on those too. Those have not been altered in days.

EDIT2: I cloned the first screen and placed a copy somewhere else. When I booted the game from the copied screen, it also goes black. So it's something with that particular screen, but I have no idea why.
 

mouse spirit

Well-known member
i think i understand some now.When this happened to me in 4.1.5, it had to do with hide hud and sprite 0.
Anyway, Can you turn hide hud off for now? On all screens. Also did you hide hud on certain screentypes in a script anywhere.
 

mouse spirit

Well-known member
Also when doing something new especially early on,make a backup first for when it doesnt work. So when something doesnt work you can also undo it. When using something like notepad++, leave stuff open after you save so you can simply undo and resave if it doesnt work. Helps me alot.
 

offparkway

Active member
I figured out the black screen, sort of. The first screen went all black if I had 2 NPCs on the screen. When I removed an NPC (or all NPCs) then the screen would show up. I have no idea why, because it doesn’t happen on any other screens.

Now my issue is the heart graphics on my HUD showing on all screens, even when hiding the hud. I’m hiding the hud on all special screens (start screen, win screen, game over, etc). The hearts still show up at the top (but all the hud text hides just fine).
 

mouse spirit

Well-known member
Something to try is put a black colored monster over those hearts on that screen if you dont figure it out. Assuming those screens are black when i say this.
 

mouse spirit

Well-known member
Ok so make sure not to click the hide hud box if you are hiding those screens in code also. Know what im sayin? Dont hide the same screen twice. Try that.

And are you using a sprite based hud? That may be why the hud text is dissapearing fine but not these hearts.

Lastly are you using both huds? A tile based and a sprite based?
 

offparkway

Active member
I didn't think about a black monster... interesting, and could work!

I'm hiding the HUD in the UI, not in the code.

I'm using both HUDs, yes... the tile based hud goes away as it should. The sprite based hud remains, showing the hearts. Is the sprite based hud not affected when I choose to hide it?
 

offparkway

Active member
I've been looking at the code (and the video) to hide hud and sprites, and I'm not sure how to treat the sprite hud separately. I labeled flag 3 as Hide Sprite Hud, but don't know what code is needed to just affect the sprite hud.

Do I need to change something in the HideHud macro?
 

mouse spirit

Well-known member
Well label just labels.it doesnt do anything. But find where it tells it to draw sprite hud and use thisright before the code says to draw the sprite hud.

LDA screenType
CMP #(here put the screentype number of the screen you want to not show the sprite hud)

BNE +noHudPlease

( then put a ) +noHudPlease(directly after all the script thats says to draw the sptie hud.


So it will say "is this screentype.. 7?(whatever) Skip draw sprite hud then" or" oh its not? Go ahead and draw it then"
 

offparkway

Active member
Great, thank you. I'll give this a shot... screentype number is not the same number I use in screen info for triggered screens right? should it be the game state number? (sorry I have so many questions, lol)

I want the sprite hud to hide on all my special screens (start, game over, etc)

If it IS the same screentype that I use for triggers, I guess that means I have to go through every screen in the game and change all the screen types
 

mouse spirit

Well-known member
Well sort of. Thats why we say"is it type 47? If so skip."
Instead of asking every screentype and saying if not. That will save about 255 lines of code. And yeah its in screen info or whatever when you are at a screen in the overworld underworld editor. There you can set a screen which yes can be triggered, but in thos case we are simply reference it and comparing it instead of triggerin. So yeah not the state number, screentype number 0-255.
 

mouse spirit

Well-known member
I had all of these same questions believe me. But there should be answers spread throughout here. Try looking through the tutorial section,pick somethin you like and read about it,try it , ask stuff. Hopefully alot of questions get answered looking through the topic that looks good already. Reading all the mistakes and fixes is nice. Recently since i have had these questions dale_coop has probly already answered them somewhere.Just a matter of finding them.
 

offparkway

Active member
I spend most nights before bed just reading through the forums about stuff. It's really helpful.

One of the issues I'm finding is that I'm on 4.5, and many of these questions have been answered for 4.1, which involve different macros or different code and stuff like that. So someone will say "oh, just change your "______.asm" in subroutines, and I don't have that asm file in 4.5. (i think that might be the problem with the pause script. mine is identical to other users, and I created the same variable, but no one seems to have the same issue that I'm having, and it looks like most of the posts before mine are from before 4.5).

Ok, so it sounds like I need to change all my special screens to a new screen type, and then try to CMP with that new screen type
 

mouse spirit

Well-known member
Yes 4.1.5 is pretty different in those regards. So yeah is it doesnt say 4.5(the newest) version,it may not work. Kinda gotta wait and do aallll the summercamp to understand and properly start to use 4.5. And its still buggy n quirky. And yes the scripts will most likely not directly translate well from one to another without headaches.
 

offparkway

Active member
I'm hearing that response fairly often to my questions, so I was going to wait. But then Joe made a comment sounding like a more definitive 4.5 is coming, but won't be much different than what I'm already using. So that might not solve my problems either.

I tried your code... no luck. The game runs, so the code works. But I set my start screen to screentype 9, and told the code to CMP #09. But it's still showing the health hearts in my sprite hud on the start screen. (i added it to my doHandleSpriteHud_adventure.asm, which is what I've been using)
 

mouse spirit

Well-known member
Can you share the code . Copy and paste the whole code, in the full editor here and preview right below.when its there select it all and then scroll to the top of the page where there are buttons. Press the </> one. That will show it in a code form when you press submit. The whole code that involes the one where its drawing the sprite hud.
 

offparkway

Active member
sure thing:

Code:
;;; Here is an example of how to do a sprite hud.
;;; Arg5, the one that has the value of myVar, must correspond to a user variable you have in your game.
;;; Don't forget, you can only draw 8 sprites per scanline, so a sprite hud can only be 8 sprites wide max.

LDA screenType
CMP #09 ;;screenType for special screens

BNE +noHudPlease


;DrawSpriteHud #$08, #$08, #$11, #$10, #$10, myVar, #$00
	; arg0 = starting position in pixels, x
	; arg1 = starting position in pixels, y
	; arg2 = sprite to draw, CONTAINER
	; arg3 = MAX	
	; arg4 = sprite to draw, FILLED
	; arg5 = variable.
	; arg6 = attribute

DrawSpriteHud #56, #06, #$7f, #$08, #$1D, myLives, #$00  ;;;this draws health


;;;;; DrawSpriteHud #16, #24, #$7F, #$05, #$0C, myAmmo, #$00 ;;;; this draws ammo

+noHudPlease
 
Top Bottom