Help! Currency, Moving Platforms and Path Keys

DanielT1985

Member
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.
 

dale_coop

Moderator
Staff member
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&t=725&p=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).
 

DanielT1985

Member
dale_coop said:
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&t=725&p=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.
 

DanielT1985

Member
DanielT1985 said:
dale_coop said:
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&t=725&p=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.
 

dale_coop

Moderator
Staff member
For the coin script, it’s exactly the same... assign the currency or coin script to the correct Power Up ;)
 

DanielT1985

Member
dale_coop said:
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:
;;; 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]
 

DanielT1985

Member
DanielT1985 said:
dale_coop said:
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:
;;; 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]
[/quote]

To make things even better, adding another line that makes it play a sound worked too.
 

dale_coop

Moderator
Staff member
For a sound, at the end of your code, you could add:
Code:
PlaySound #SFX_GET_COIN
And set the sound you want for the SFX_GET_COIN in NESMaker "Sound > SFX".
 

DanielT1985

Member
dale_coop said:
For a sound, at the end of your code, you could add:
Code:
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.
 

dale_coop

Moderator
Staff member
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.
 

DanielT1985

Member
dale_coop said:
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.

I could use that to my advantage, tho. I wanted them to be gold, but I could actually give off the illusion that it's Silver, since my character has a light gray color scheme to it. Similar to how in the 1983 Mario Brothers Arcade Game, Luigi had to use the same pallet as the Shellcreeper (Koopa Troopas), due to memory limitations. This might be more of an advantage, than anything.
 

DanielT1985

Member
dale_coop said:
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.

So what about the extremely slow animation? Is this a bug, or did I do something wrong?
 

DanielT1985

Member
dale_coop said:
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.

Also, thanks to you helping me on this, I was able to make 2 types of currency pickups. (One of my friends came up with the idea)

The silver one gives you 50 points and adds 1 on the counter, the red one gives you 100 points and adds 2 on the counter.

NyqJS7K.gif
 

dale_coop

Moderator
Staff member
How is you Currency Pickup object? did you set an "animation speed" (for the action step 0)?
Is it slow when you put it on a screen? Or when only when it's spawn after a monster death?
 

DanielT1985

Member
dale_coop said:
How is you Currency Pickup object? did you set an "animation speed" (for the action step 0)?
Is it slow when you put it on a screen? Or when only when it's spawn after a monster death?

I didn't spawn any monsters. I did set the animation speed to make it as fast as it could go (0) and yeah, it's set to be a pickup, like it should be.
 

DanielT1985

Member
DanielT1985 said:
dale_coop said:
How is you Currency Pickup object? did you set an "animation speed" (for the action step 0)?
Is it slow when you put it on a screen? Or when only when it's spawn after a monster death?

I didn't spawn any monsters. I did set the animation speed to make it as fast as it could go (0) and yeah, it's set to be a pickup, like it should be.

OKAY I FIXED IT!! Apparently, the fastest speed isn't so fast after all. I set one of them to 5 and it's at normal speed now.
 

DanielT1985

Member
DanielT1985 said:
DanielT1985 said:
dale_coop said:
How is you Currency Pickup object? did you set an "animation speed" (for the action step 0)?
Is it slow when you put it on a screen? Or when only when it's spawn after a monster death?

I didn't spawn any monsters. I did set the animation speed to make it as fast as it could go (0) and yeah, it's set to be a pickup, like it should be.

OKAY I FIXED IT!! Apparently, the fastest speed isn't so fast after all. I set one of them to 5 and it's at normal speed now.

Also, I'm having a problem importing the platform thing you linked me. I got an error messaged, and I posted about it in the post itself.
 

dale_coop

Moderator
Staff member
I can’t help on this one, didn’t try that script since looks like it’s not finished yet.
 
Top Bottom