Language…
12 users online: Anas, Batata Douce, Darolac, DasFueller, Dzing, Gamet2004, Hammerer,  icrawfish, jump_run_repeat, Mythundare,  Nanako, Rykon-V73 - Guests: 292 - Bots: 345
Users: 64,795 (2,377 active)
Latest user: mathew

Coin hunting design issues

Hello it'sa mi again...

Well I encountered some coin hunt issues in my previous projects, and I had to exaggerate things up to avoid misfuctions in the level design I wanted to make.

For instance, since the old BTSD 30-coin block would allow passing with coins collected in another level, I had to add a sprite that zeroes the coins at level entrance.

Now I want to find another solution because I want to add a 3-digit counter for my coins...

Also I prefer using BTSD over GPS since there are some .bin BTSD blocks tht have not been edited in .asm yet.

So my question is : is there a known functional 30-coin block that does this :
- Works on BTSD (Koopster's Coin Hunt Pack rendered invisible coins, which is odd)
- Counts only coins collected in a given level
- Does not reset the counter at level entrance
- Allows coin hunt in sublevels also

Another related issue I had is about the reset doors in coin hunt levels. I never know which coins respawn afer the new entrance and which coins does not. I can remember that in my last testing free coins don't respawn, but question block or turn block coins respawn.
Coin respawning is a problem since I design my coin hunting levels with the exact amount of coins to collect, no less, no more... And if the player collects respawned coins, he has twice the same.

Thanks in advance...


PS : I don't know if i'm in the correct section of the forum. ASM help section seemed too technical for my question, which is more level design-oriented.
This can be done by using the same counter as the green star block, since it only resets whenever you enter a level from the overworld. Something like this ought to work:

Code
db $42
JMP Main : JMP Main : JMP Main
JMP Main : JMP Main : JMP Main : JMP Main
JMP Main : JMP Main : JMP Main

Main:
    LDA $0DC0       ; if 30 coins collected in level,
    BEQ Return      ; branch
    LDA #$30        ;\ make block solid
    STA $1693       ; |
    LDY #$01        ;/
Return:
    RTL

Acts like setting should be 25.

As for coins respawning: if they are placed from Standard Objects they won't respawn, if they are placed from Direct Map16 Access they will. Coins from ? blocks will always respawn, although I don't think it'd be too hard to use Objectool to create a custom ? block object that stays hit when you reenter the area.
My YouTube channel
Get the official ASMT resource pack here!

Thanks a lot yoshicookiezeus. By the way I like a lot your works, there are many good ideas and I'd like to know ASM like you do.

I shalt try this code you gave to me.

But I know nothing about .asm making.

Should I use the entire code in a single .asm file? Or should I add/replace this code into an existing 30-coin block file?

Also I will try out this Objectool feature you tell me about, hoping I can understand some things.
No, just put that whole piece of code in a new .asm file and insert it as you normally would.
My YouTube channel
Get the official ASMT resource pack here!

Umm there was an issue, the block remains solid even if I get my coins :/

...OK so I tried to mess up a bit the passoncoins block made by smkdan.

As you will see I am now trying to make the block act like 25 if there are no coins; and like 105 (rope tile) if the coins are collected.
But! If I set the "acts like" to 105 or 25, it does not work as I thought it could work. What is wrong?

Code
;pass on a defined # of coins
;by smkdan
;act like tile 105 [because the "acts like" loads after code run]
JMP MarioBelow : JMP MarioAbove : JMP MarioSide : JMP Return : JMP Return : JMP Return : JMP Return
;don't touch those

;amount of coins the player can pass on


MarioAbove:
MarioBelow:
MarioSide:
	LDA $0DBF	;load current coins
	CMP $0DC0	;compare to required coins
	BCS Return	;return (don't act like solid) if carry set

;don't pass
	LDY #$00	;act like 25
	LDA #$25
	STA $1693
Return:
	RTL
Firstly, $0DC0 is a counter that starts at 30 and decrements when you collect a coin until it reaches zero, so comparing it your current coin count doesn't really make a whole lot of sense. Secondly, setting a block's Acts Like setting in the block code makes it act like both the new and the old setting at once, so trying to set a block to act like an empty tile when it already acts like something else won't do anything useful.
My YouTube channel
Get the official ASMT resource pack here!

Rude...

I have to learn ASM :'(
Concerning the act like set inside the code, it is originally made by smkdan with tile 130 where I replaced by 25.

Attempting to correct my code.

Testing your code again, maybe I inserted it wrong.
Okay then. The code you gave me did not work well (still remaining solid after coin collect).

But! I had bad faith in original jonwil's .bin block.

I tested it for real and it appears that "free" coins disappear on respawn as you said and not question block coins.

It appears that it counts only coins collected in the level.

So I will use this one, it it sufficient.

Case closed and sorry for all this. Thanks again.