Help! Currency, Moving Platforms and Path Keys

User avatar
DanielT1985
Posts: 61
Joined: Sat Sep 01, 2018 7:44 pm

Help! Currency, Moving Platforms and Path Keys

Post by DanielT1985 » Fri Oct 05, 2018 1:20 am

IDK if it's possible to ask too many questions on here. I'm not trying to be desperate, I just wanna know about certain things.

1. Currency. I got it so my character could pick it up the item, but I want to be able to add points to the score, and add to a separate coin counter, similar to the one in Super Mario Bros.

2. Moving Platforms/Stairs. I was wondering how to be able to make Moving Platforms/Stairs. I saw someone making a Moving Platform possible in NESMaker, but I can't find out how to install it. And I also wanna know if stairs are possible to the game, for the player to just walk up, a little bit like a slope but not quite like one.

3. Path keys. In PressStart by Dale Coop (https://youtu.be/UOzfLf6guuU) he got Path Keys working. I was wondering how to do this, because in my game, I wanted to have the player find an area with a key to continue to the next area. And I tried to get keys working, but nothing seemed to work.
User avatar
dale_coop
Posts: 1627
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Help! Currency, Moving Platforms and Path Keys

Post by dale_coop » Fri Oct 05, 2018 9:52 am

Not easy questions...

1) you mean you want to modify 2 HUD variables in the same script (on currency pickup)? increase or decrease the variables is easy... but if you display both variables on your HUD, it's quite difficult to update them at the same time (but not impossible): http://nesmakers.com/viewtopic.php?f=23 ... 4618#p4618

2) I think your already saw this post: http://nesmakers.com/viewtopic.php?f=28&t=779&start=30

3) you will need to assign the "Routines\UserScripts\AdventureGame_Base\PowerUpCode\Powerup_Key.asm" script ASM file to the "Power Up 02" in "Project settings > Script settings". (I think this script doesn't exist in the "PlatformGame_Base" folder, but if you can copy/paste it or just use/assign the one from the "AdventureGame_Base" folder).
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
DanielT1985
Posts: 61
Joined: Sat Sep 01, 2018 7:44 pm

Re: Help! Currency, Moving Platforms and Path Keys

Post by DanielT1985 » Fri Oct 05, 2018 6:10 pm

dale_coop wrote:
Fri Oct 05, 2018 9:52 am
Not easy questions...

1) you mean you want to modify 2 HUD variables in the same script (on currency pickup)? increase or decrease the variables is easy... but if you display both variables on your HUD, it's quite difficult to update them at the same time (but not impossible): http://nesmakers.com/viewtopic.php?f=23 ... 4618#p4618

2) I think your already saw this post: http://nesmakers.com/viewtopic.php?f=28&t=779&start=30

3) you will need to assign the "Routines\UserScripts\AdventureGame_Base\PowerUpCode\Powerup_Key.asm" script ASM file to the "Power Up 02" in "Project settings > Script settings". (I think this script doesn't exist in the "PlatformGame_Base" folder, but if you can copy/paste it or just use/assign the one from the "AdventureGame_Base" folder).
Well I could forgo the Score, but what about the coin counter itself? I can't seem to get that working.
User avatar
DanielT1985
Posts: 61
Joined: Sat Sep 01, 2018 7:44 pm

Re: Help! Currency, Moving Platforms and Path Keys

Post by DanielT1985 » Fri Oct 05, 2018 6:33 pm

DanielT1985 wrote:
Fri Oct 05, 2018 6:10 pm
dale_coop wrote:
Fri Oct 05, 2018 9:52 am
Not easy questions...

1) you mean you want to modify 2 HUD variables in the same script (on currency pickup)? increase or decrease the variables is easy... but if you display both variables on your HUD, it's quite difficult to update them at the same time (but not impossible): http://nesmakers.com/viewtopic.php?f=23 ... 4618#p4618

2) I think your already saw this post: http://nesmakers.com/viewtopic.php?f=28&t=779&start=30

3) you will need to assign the "Routines\UserScripts\AdventureGame_Base\PowerUpCode\Powerup_Key.asm" script ASM file to the "Power Up 02" in "Project settings > Script settings". (I think this script doesn't exist in the "PlatformGame_Base" folder, but if you can copy/paste it or just use/assign the one from the "AdventureGame_Base" folder).
Well I could forgo the Score, but what about the coin counter itself? I can't seem to get that working.
Oh, and I also see that they were using Flag 6 for just the platform tiles, so I know this won't affect the other enemies. Looking more into it, NESMaker programming is a lot easier than what I thought.
User avatar
dale_coop
Posts: 1627
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Help! Currency, Moving Platforms and Path Keys

Post by dale_coop » Fri Oct 05, 2018 7:03 pm

For the coin script, it’s exactly the same... assign the currency or coin script to the correct Power Up ;)
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
DanielT1985
Posts: 61
Joined: Sat Sep 01, 2018 7:44 pm

Re: Help! Currency, Moving Platforms and Path Keys

Post by DanielT1985 » Fri Oct 05, 2018 7:44 pm

dale_coop wrote:
Fri Oct 05, 2018 7:03 pm
For the coin script, it’s exactly the same... assign the currency or coin script to the correct Power Up ;)
My first ever modification in coding was a SUCCESS!!

In Routines\UserScripts\PlatformGame_Base\PowerUpCode, I copied Powerup_IncreaseScore and made a duplicate, Powerup_IncreaseScore2. I edited the code that replaces all indication of myScore with myMoney, the currency counter. And it worked!! I went and copied the code and made a line under it, replacing those indications to myScore again, and THAT worked too!

Code: Select all

;;; Increase Score
;;; works with variable myScore
;;; works with HUD variable HUD_myMoney.
	TXA
	STA tempx
	
	AddValue #$06, myMoney, #$01, #$00
	
	

	;;; we also need to set up the routine to update the HUD
	;; for this to work right, health must be a "blank-then-draw" type element.
	;STA hudElementTilesToLoad
	;	LDA #$00
	;	STA hudElementTilesMax
		LDA DrawHudBytes
		ora #HUD_myMoney
		STA DrawHudBytes
	
	LDX tempx
	
;;; Increase Score
;;; works with variable myScore
;;; works with HUD variable HUD_myScore.
	TXA
	STA tempx
	
	AddValue #$06, myScore, #$01, #$00
	
	

	;;; we also need to set up the routine to update the HUD
	;; for this to work right, health must be a "blank-then-draw" type element.
	;STA hudElementTilesToLoad
	;	LDA #$00
	;	STA hudElementTilesMax
		LDA DrawHudBytes
		ora #HUD_myScore
		STA DrawHudBytes
	
	LDX tempx[code]
User avatar
DanielT1985
Posts: 61
Joined: Sat Sep 01, 2018 7:44 pm

Re: Help! Currency, Moving Platforms and Path Keys

Post by DanielT1985 » Fri Oct 05, 2018 7:49 pm

To make things even better, adding another line that makes it play a sound worked too.
User avatar
dale_coop
Posts: 1627
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Help! Currency, Moving Platforms and Path Keys

Post by dale_coop » Fri Oct 05, 2018 7:57 pm

For a sound, at the end of your code, you could add:

Code: Select all

PlaySound #SFX_GET_COIN
And set the sound you want for the SFX_GET_COIN in NESMaker "Sound > SFX".
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
DanielT1985
Posts: 61
Joined: Sat Sep 01, 2018 7:44 pm

Re: Help! Currency, Moving Platforms and Path Keys

Post by DanielT1985 » Fri Oct 05, 2018 8:05 pm

dale_coop wrote:
Fri Oct 05, 2018 7:57 pm
For a sound, at the end of your code, you could add:

Code: Select all

PlaySound #SFX_GET_COIN
And set the sound you want for the SFX_GET_COIN in NESMaker "Sound > SFX".
That's what I did. Again, it worked. But now, there's another problem I'm having. The currency is not using the pallet I want it to use. It goes for the player's pallet. And unlike the monster pallets, where you can just assign the pallet manually in the screen info, it's stuck that way. And another weird thing is the coin's animation moves incredibly slow. That might be something I can fix soon, but IDK.
User avatar
dale_coop
Posts: 1627
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Help! Currency, Moving Platforms and Path Keys

Post by dale_coop » Fri Oct 05, 2018 8:24 pm

For the palette, sadly, it's normal. ALL the "game objects" use the player's palettes. Even if you try to change you Coin palette... in game, it will use the player ones. Joe explains that in the videos.
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
Post Reply