Need HELP!! 4.1.5 hud weapon, unlock door in all screeen and crazy npc!!

Post Reply
User avatar
CGdfc
Posts: 39
Joined: Sat Jun 08, 2019 12:40 am

Need HELP!! 4.1.5 hud weapon, unlock door in all screeen and crazy npc!!

Post by CGdfc » Fri Jul 12, 2019 6:08 pm

Hello, I have been working on this game for several weeks, I have seen much tutorials by the forum and the videos of nesmaker. (20min to 3h).
Everything was fine until it started to explode everything and strange things appear that I do not understand.

basically this happens.

- The npc gives the melee weapon, but the weapon does not appear in the HUD above.
- After opening the locked door, in the next room there is an enemy, kill it, change the tiles again and put the door open.
- But also, the npc of the other room is here, transparent inside a tile (this is very crazy)

The tutorials used for the unlockdoor and melee weapon are created by dale_coop
I add the links here of their tutorials.
[url]http://www.nesmakers.com/viewtopic.php?f=35&t=1777[/url]
[url]http://nesmakers.com/viewtopic.php?t=1750[/url]

the NPC is from the official 3h video of nesmaker.
something I did wrong and I am very lost. I can assure you, that this npc is not in that screen and has another screen type number.
Last edited by CGdfc on Sat Jul 13, 2019 7:33 pm, edited 1 time in total.
User avatar
dale_coop
Posts: 4238
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Need HELP!! 4.1.5 hud weapon, unlock door in all screeen and crazy npc!!

Post by dale_coop » Fri Jul 12, 2019 6:48 pm

Maybe just some adjustements...

1) If you are using the 4.1.5, the HUD drawing of the weapon is no more a default feature. If you have to put back the code in order to have it work.
Modify the script assigned to your "Handle Sprite Pre-Draw" element in the "Project Settings > Script Settings", around line 52, just after the ";;;;;;;;;;;;;;;;;;;" line, add those lines (for Weapon 1):

Code: Select all

	LDA gameState
	BEQ skipDrawingItemInHud
	
	;; check if Weapon 1 is unlocked :
	LDA weaponsUnlocked
	AND #%00000001
	BEQ +
	;; if Weapon 1 unlocked:
	DrawSprite #$74, #$14, #$0D, #%00000001, spriteOffset
	;; DrawSprite arguments are:
	;; 	arg0 = x
	;; 	arg1 = y
	;; 	arg2 = chr table value (the tile index from GameObjectTiles.bmp you use for the weapon1 icon)
	;; 	arg3 = attribute data
	;; 	arg3 = starting ram position	
	inc spriteOffset
	inc spriteOffset
	inc spriteOffset
	inc spriteOffset
+
skipDrawingItemInHud:
2) About your invisible npc... it looks like your monster locks have been replaced by something else...? Do you have NPC tiles?
How are your COL_MONSTER_LOCK, TILE_MONSTER_LOCK and TILE_MONSTER_LOCK_OFF user constants?
And how about your screen-types on all your screens? (have you set a different screen-type number on the screen where your NPC is? because NPC triggered the screen... and all screens that have the same screen-type number).
-----
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
CGdfc
Posts: 39
Joined: Sat Jun 08, 2019 12:40 am

Re: Need HELP!! 4.1.5 hud weapon, unlock door in all screeen and crazy npc!!

Post by CGdfc » Fri Jul 12, 2019 8:36 pm

dale_coop wrote:
Fri Jul 12, 2019 6:48 pm
Maybe just some adjustements...

1) If you are using the 4.1.5, the HUD drawing of the weapon is no more a default feature. If you have to put back the code in order to have it work.
Modify the script assigned to your "Handle Sprite Pre-Draw" element in the "Project Settings > Script Settings", around line 52, just after the ";;;;;;;;;;;;;;;;;;;" line, add those lines (for Weapon 1):

Code: Select all

	LDA gameState
	BEQ skipDrawingItemInHud
	
	;; check if Weapon 1 is unlocked :
	LDA weaponsUnlocked
	AND #%00000001
	BEQ +
	;; if Weapon 1 unlocked:
	DrawSprite #$74, #$14, #$0D, #%00000001, spriteOffset
	;; DrawSprite arguments are:
	;; 	arg0 = x
	;; 	arg1 = y
	;; 	arg2 = chr table value (the tile index from GameObjectTiles.bmp you use for the weapon1 icon)
	;; 	arg3 = attribute data
	;; 	arg3 = starting ram position	
	inc spriteOffset
	inc spriteOffset
	inc spriteOffset
	inc spriteOffset
+
skipDrawingItemInHud:
2) About your invisible npc... it looks like your monster locks have been replaced by something else...? Do you have NPC tiles?
How are your COL_MONSTER_LOCK, TILE_MONSTER_LOCK and TILE_MONSTER_LOCK_OFF user constants?
And how about your screen-types on all your screens? (have you set a different screen-type number on the screen where your NPC is? because NPC triggered the screen... and all screens that have the same screen-type number).

Hi thanks Dale
the weapon hud code worked well for me, changed x - y for the position. :)
the npc is a monster object, use the same system that was used in the 3 hour video with the redwizard (green) npc.

constants:

-COL_MONSTER_LOCK = 14
-TILE_MONSTER_LOCK = 3
-TILE_MONSTER_LOCK_OFF =66

the npc is invisible in the other screen, also breaks the collision of that tile block.
the screen type is different in the 4 rooms that you see in the video (there's no more in the demo)
0 - first room
200 -for npc screen
1 and 2 - for the other 2 screens

In addition to all this, the enemy to die again creates open door tiles in the same position as those of the previous screen.
it seems that any enemy dying does the same problem (this I must check later)
but all the enemies of the screen must die, if there are 3 enemies, until you kill the 3 does not break the barrier. (this seems to work well)
User avatar
CGdfc
Posts: 39
Joined: Sat Jun 08, 2019 12:40 am

Re: Need HELP!! 4.1.5 hud weapon, unlock door in all screeen and crazy npc!!

Post by CGdfc » Fri Jul 12, 2019 8:44 pm

I just tested again, I put an enemy in another scren different, and killing him does not seem this problem ...
it seems that it is only on that screen.
User avatar
dale_coop
Posts: 4238
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Need HELP!! 4.1.5 hud weapon, unlock door in all screeen and crazy npc!!

Post by dale_coop » Fri Jul 12, 2019 8:55 pm

Yeah it might be specific to the screen.
Could you share a screenshot of the collision data of the screen? (click on the button "collision" to display 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
CGdfc
Posts: 39
Joined: Sat Jun 08, 2019 12:40 am

Re: Need HELP!! 4.1.5 hud weapon, unlock door in all screeen and crazy npc!!

Post by CGdfc » Fri Jul 12, 2019 9:15 pm

dale_coop wrote:
Fri Jul 12, 2019 8:55 pm
Yeah it might be specific to the screen.
Could you share a screenshot of the collision data of the screen? (click on the button "collision" to display it)
Image

I made some small changes and I covered a bit the tile where the npc is invisible so that the character does not enter in place.
but if I kill the enemy, the unlockdoor tile appears.
It's very strange ... but in other screens it does not happen.
for now ... the solution is not to add enemies here ...

a question, is it possible to make the hud's icon for the weapon bigger? currently it is 8x8, passing it to 16x16.
Post Reply