Language…
12 users online: Batata Douce, buzz_lightzyear,  Deeke, Gamet2004, Golden Yoshi, Gorry, Green, LunarianNEET, MellowYouth, RicardoDeMelo, SiameseTwins, sinseiga - Guests: 267 - Bots: 280
Users: 64,795 (2,376 active)
Latest user: mathew

Help with the Screen Scrolling Pipes

The block pack in question: https://smwc.me/s/24957

I followed all the standard instructions and everything is working fine. (The manual: https://smwc.me/s/24974)

However, in section 5. Notes, I did not understand the instructions on how to edit a custom carriable sprite's code, so that it won't be visible while inside the pipes.

Here are the codes indicated to be inserted and their instructions:
------------------------------------------------------------------
If you carry any custom sprites through these pipes, they will not go behind the layer; appearing superimpose of the pipe as mario is being behind the layer. Unless you can make it change the yxppccct using this code to be used in a custom sprite's code:
Code
SSPPriority:
	LDA $14C8,x	;\If sprite not carried, go in front
	CMP #$0B		;|
	BNE .InFront		;/
	LDA !FR_PipeDir		;\or if mario is not in a pipe, go in front
	BEQ .InFront		;/
	.Behind
		LDA !15F6,x
		AND.b #%11001111
		BRA .Skip
	.Infront
		LDA !15F6,x
		ORA.b #%00xx0001 ;>Replace the Xs with a binary number that is the sprite's original priority:
			;00 = Appear behind everything except Layer 3 tiles with priority setting 0
			;01 = Appear behind everything except Layer 3 tiles (unless they have priority setting
			;     1 and the "force above everything" bit is set)
			;10 = Appear in front of Layer 3 tiles (unless they have priority setting 1 and the
			;     "force above everything" bit is set) and Layer 1 and 2 tiles with priority setting 0;
			;     appear behind Layer 1 and 2 tiles with priority setting 0 (this is SMW's normal setting
			;     for most sprites)
			;11 = Appear in front of everything, except Layer 3 tiles with priority setting 1 if the
			;     "force above everything" bit is set
	.Skip
		STA !15F6,x

Also, this SSP package is intended to make both the player and the carried sprite invisible when he fully enters the pipe (when his entering animation timer hits 0) so that you can have non-physically-connected pipes without the carried sprite revealing the player's position. However, this only works with SMW's sprites handled by Fixes.asm.

To have this be applied to carryable custom sprites, I provided a small subroutine in Pixi/routines/DetectSpriteCarriedInSSP.asm, for use in PIXI's routines folder, and any carryable custom sprite used in your hack, on their graphics handler, do this (this is a template/example, most sprites uses different label names):

Code
CodeStart:
		JSR GRAPHICS

turns into:
Code
	CodeStart:
		%DetectSpriteCarriedInSSP()
		BCS SkipGFX
		JSR GRAPHICS
	SkipGFX:

And that will cause the sprite to skip the entire graphics routines folder when carried fully into the pipe.
------------------------------------------------------------------
The custom sprite I'm trying to get working is the Carriable Pipe. (https://smwc.me/s/20835)

I tried inserting this code into the sprite's code on my own (I changed the xx to 11 since that's the original priority of the sprite), but Pixi kept giving errors like these:

I need to be clear that my knowledge about ASM is extremely limited, as all I have done before was editing values in commented code made by other people.
UPDATE:

About the smaller second piece of code, the reason it wasn't working was because I forgot to insert the "SkipGFX:" into the code.

That's half of the issue solved. However, I still have no idea on how to insert the first main code. I'll update again and close the thread if I manage to solve this issue by myself or with help from somewhere else.