Views: 496,647,302
Time: 2017-01-23 09:56:37 PM
29 users online: Alcaro, Amaraticando, Chillah, DarkFeposo, Delta, FlamingRok, o GlitchMr, Golden Yoshi, Horrowind, o imamelia, Joe Smo, Kagami Hiiragi, Katerpie, Luansilva12, Magiluigi, Mathos, Pixel-Gon Gamer, Pokopo708, snoruntpyro, Sokobansolver, SuperMegaNick, TheBiob, Theultimate12, Tsutarja, VilelaBot, Vitor Vilela, Vivid, WhiteYoshiEgg, Zandro - Guests: 59 - Bots: 230Users: 30,521 (1,270 active)
Latest: werd2
Tip: The lowest row of 16x16 tiles in a level do not appear. Avoid having a low platform that looks like a bottomless pit.Not logged in.
Help with loop[!]30
Forum Index - SMW Hacking - General SMW Hacking Help - Help with loop[!]30
Pages: « 1 »
Please, help me, I'm going crazy on this code since 2 weeks!!!

;	Kill sprite
;	HuFlungDu
;	This block will kill cause every one of one specific NON CUSTOM sprite to disapear in a puff of smoke
;	when mario touches it. To choose which sprite, just change !spritenum to the sprites number. Currently
;	kills regular boos, but you can make it kill whatever you like.
;	It doesn't really matter how it acts, just make it act like whatever you place it as.
;	No credit necessary

db $42
JMP Mario : JMP Mario : JMP Mario : JMP Return : JMP Return : JMP Return : JMP Return
JMP Mario : JMP Mario : JMP Mario

!spritenum = $37		;The number of the sprite you want to disapear. You can find this on the wiki or in LM

print "This block will kill all of a certain sprite (0x",hex(!spritenum),") that is on screen when the player touch it."

	PHX					;Push the X register
	LDX #$00			;innitiate the counter
	LDA $3242,x
        CMP #$08
        BCC notkill
        LDA $3200,x			;Load the sprite numbers of all the sprites on screen (one at a time)
	CMP #!spritenum		;\If it's not the one you specified, don't kill it
	BNE notkill			;/
	LDA #$04			;\ Make the sprite dissapear in a puff of smoke
	STA $3242,x			;/
	LDA #$08
        STA $7DF9
	LDA #$1F
	STA $32C6,x

	INX					;Move on to the next slot
	CPX #$0C			;\If they haven't all been checked, go back to the beginning
	BCC loop			;/
	PLX					;Pull the X register from the stack

I want to use a block that, when touched by Mario, ALL Boos on screen will killed; it works correctly on a normal rom, but when I convert the code to install the block on a SA-1 rom, it kills only one Boo!!! And worse still, when it kills the Boo, touching again the block, nothing happens! It's not an emulator problem, I've tested the block with different emulators with SA-1 support! So where's the error? Maybe, the looping method for SA-1 Mod has something different? Please, help!!!
With sa-1 there can be up to 20 sprites on screen at once however you still only loop through 12 sprites. So what you want to change is the 0C to 15 I think.
It was just that?!? I had not idea of meaning of that #$0C, I thought it was a constant value for looping; now it works correctly, finally! Thanks a lot!!! #tb{:)}

Another question: we assume that I want a block that will make disappear a key or a springboard when touched by one of them:

db $42
JMP Return : JMP Return : JMP Return : JMP Sprite : JMP Sprite : JMP Return : JMP Return
JMP Return : JMP Return : JMP Return

	LDA $3200,x	;\ Check if the sprite is a key...
	CMP #$2F	;/
	BEQ Remove
	LDA $3200,x	;\ ... or a springboard
	CMP #$80	;/
	BEQ Remove
	STZ $3242,x	;\ Make disappearing the sprite
	%create_smoke() ;/ with a puff of smoke

... is there a better code to list sprites (like an array or something similar) instead of using

LDA $3200,x
BEQ Label

for each sprite I need to interact with block? The more compact code, the better.
You could try a table.

	LDA $3200,x
	PHY : LDY.b #check_end-check-1
-	CMP check,y
	BEQ .remove
	DEY : BPL -
	STZ $3242

	db $2F,db $80

e: Whoops forgot the labels lol
You probably want to use the table like this though :P
	db $2F,$80

Anime statistic on MyAnimeList:
400 animes completed ✓
6000 episodes completed ✓
100 Days
Okay was I even thinking when I made this? I forgot the labels and now this, oh well. But yeah db $2F,db $80 is complete nonsense lol
Sorry for the delay of this reply, I was busy for job and other codes for my rom... howerer, thanks a lot for your help, I'll test that code soon. ^^
Pages: « 1 »
Forum Index - SMW Hacking - General SMW Hacking Help - Help with loop[!]30

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2017 - SMW Central
Legal Information - Privacy Policy - Link To Us

Total queries: 23


Follow Us On

  • Facebook
  • Twitter
  • YouTube
  • Instagram


  • Talkhaus
  • SMBX Community
  • GTx0
  • Super Luigi Bros
  • MFGG
  • Gaming Reinvented