Language…
12 users online: 35TCB77, Buflen, crm0622, crocodileman94, fanfan21, Green Jerry, Hayashi Neru, KoJi, Maw, Metakabe, Neuromancer, signature_steve - Guests: 238 - Bots: 332
Users: 64,795 (2,377 active)
Latest user: mathew

Issue with setting sprite extra bit within Custom ? Block

So, I'm currently trying to insert a Custom ? Block into my hack which produces an upside down growing vine. I was able to take this disassembly of the growing vine and mess with the code a bit to produce the upside down vine, but I'm having some issues with putting it into a custom block.

I took question_block_e.asm from Question Mark Blocks v1.3.0 (because I'm not exactly too skilled with ASM and have no idea where to start with making these things) and it said in the readme file that it was used to spawn sprites, and that it had extra bit and extra byte support. Well, this is where the issue starts - I've inserted the upside down vine into the game normally, so I know that it works, but I don't know what value to change within the block's code to set the extra bit. Here's what it looks like:

Code
!Sprite = $79	; sprite number
!IsCustom = 1	; 0 for normal, 1 for a custom sprite
!GIEPY = 0		; Set this to 1 if you use GIEPY
!ExtraBit = 1	; extra bit activated, should be 1
!Group = 0		; group number/extra byte, should range from 0-3
!State = $08	; $08 for normal, $09 for carryable sprites
!1540_val = $00	; If you use powerups, this should be $3E
				; Carryable sprites uses it as the stun timer

!ExtraByte1 = $00	; First extra byte (only applyable if extra bytes are enabled)
!ExtraByte2 = $00	; Second extra byte
!ExtraByte3 = $00	; Third extra byte
!ExtraByte4 = $00	; Fourth extra byte


Note: I included the '!ExtraByte' because I'm still not quite sure if it's relevant to extra bits or not.

So I'm not exactly sure what to input where. I'm trying to set the extra bit to 2, as that is what the disassembly uses, but I don't know where to put that. I thought at first it was at '!ExtraBit', but I'm pretty sure that value is simply meant to declare "yes, the extra bit is being used!", and I have no clue where to put it besides here.

All the !ExtraByte stuff just confuses me.

Any help would be appreciated!
From what I understand you just want to spawn a specific custom sprite you inserted, right? Since the sprite you linked doesn't use either extra bits nor extra bytes, so just having !IsCustom = 1 and !ExtraBit = 0 should work (extra bits = 2 in LM just means "This sprite is custom, and it doesn't have the custom extra bit set"). I think the problem here is the sprite number: you're using $79, which is the vanilla vine number, but you should use the number you have in PIXI's list to spawn the custom sprite.
Alright, I changed the !Extrabit value to 0 so it knows the sprite isn't using the extra bit.

Originally posted by KevinM
...you're using $79, which is the vanilla vine number, but you should use the number you have in PIXI's list to spawn the custom sprite.


If you're referring to the sprite number I assigned the vine disassembly in PIXI's list file, it is 79. I figured it would make sense to have the normal vine and upside down vine use the same number.

I reinserted the block using GPS, reopened the rom in LM and replaced the block, then ran in emulator - still spawns normal vine.

So, if the custom sprite is inserted into my rom (I've confirmed it works normally using insert w/ LM), and I'm telling the block code to spawn a custom sprite (!Sprite = $79, !IsCustom = 1 & !ExtraBit = 0) and it still doesn't work, then what now?
Decided to put in a GIF of the upside down vine and the block to show what's happening.

problem-Trim

So the vine itself works fine when inserted normally, but the block simply spawns a normal one.
Without seeing your files it's hard to know what the cause could be. I recommend that you upload the custom Vine asm and the block asm to your filebin, then link them here.