News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

Transparent BTS Block?

Started by TheUnproPro, February 25, 2013, 06:39:55 PM

Previous topic - Next topic

TheUnproPro

Alright so I've installed the patch that makes the transparent layer 2 by using BTS blocks, but I'm having trouble figuring out what layer 2 is and how to target specific blocks as layer 2. Can anybody help with this? I want to make tunnel like walls that are somewhat see through. I tried looking at the code, but being a guy who literally just learned how to patch ASM files last night, I haven't the tiniest clue on what I'm doing.
lorom

org $9498BA

DW $B500

org $94B500
;7E:1982 - 7E:1983    FX3 'A'.
;7E:1984 - 7E:1985    FX3 'B'.


;Turns layer2 transparent, BTS 07
LDA $7E8802
CMP #$7777
BEQ nopes
LDA #$7777
STA $7E8802
LDA $1982
STA $7E8804
LDA $1984
STA $7E8806
LDA #$001A
STA $1982
STA $1984
nopes:
RTS


;Turns layer2 back to what it was, BTS 08
org $9498BC

DW $B530

org $94B530
LDA $7E8802
CMP #$7777
BEQ yeps
BRA nopes
yeps:
LDA #$0000
STA $7E8802
LDA $7E8804
STA $1982
LDA $7E8806
STA $1984
RTS


This is his script, but I don't have the tiniest clue what does what lol

Quietus

OK, I'll try and tackle this in order: :^_^:

Each room is comprised of three layers:
Layer 1 - The foreground, which you run around in.
Layer 2 - The background, which can either be drawn from graphics in certain locations, or manually created like layer 1.
Layer 3 - Normally used for stuff like water or fog.

So, in order to really have this code target certain blocks, you need to have both layers available for editing.  If your room doesn't have an editable layer 2 (you can tell because your mouse won't move when you press F1), you'll need to add one in.  Check my document here.  If you need more space for tile data, you're then into repointing level data.  For that, see Squishy's guide here.

Once you've got both layers available, you can then build your room.  Generally speaking, layer 2 is behind layer 1, but you can kind of trick the game by having layer 2 tiles appear in front of Samus, and layer one tiles appear behind.  To do so, open the graphics editor - Tools > Graphics Editor.  If you select a tile in the window at the bottom (for example, the spike tile), you'll see some of them have red dots on them in the Tile Table Editor.  To add / remove the red dots, just click on the relevant corner in the Tile Table Editor.  Red dots mean that Samus appears in front, and no dot means she appears behind.  For example, you draw your layer 2 tiles, which are set to appear in front of Samus.  You then draw your layer 1 tiles, which are set to appear behind Samus.  You then set up the BTS (Air Fool xray in your case) to turn layer 2 on and off.  Because it is set to appear in front of Samus, it'll look like the top layer is disappearing, but it's actually layer 2.

As a quick example, [noembed]here[/noembed]'s an old vid I made using Layer 2 transparency.

Hope that helps! :^_^: