[4.5.6] Strange Object Drop Down Issue (SOLVED)

Jonny

Well-known member
Hello, im totally Bamboozled!

I'm getting a quite peculiar problem where, a monster that is set to ignore gravity is drawing 1 pixel too low but only on certain screens.
After about an hour of checking loads of different things I've narrowed it down to 1 thing that seems to be causing it.

If I change my first tileset to anything other than the first one ( BckCHR_00.bmp ) the monster draws 1 pixel down. Like so....


111.gif222.gif

Does anyone know what could be happening? I've tried all my BckCHR tilesets to confirm it only draws in the correct place if I'm using BckCHR_00.bmp.
 

Logana

Well-known member
I think it had to do with the way objects are spawned on the first screen an only the first screen since this also happens with players and that’s why you never want the hit box to go al the way down
 

Jonny

Well-known member
I think it had to do with the way objects are spawned on the first screen an only the first screen since this also happens with players and that’s why you never want the hit box to go al the way down

I tried this and I also changed the doDrawSprites.asm to be sure.
It happens on the first screen too, but only when I'm not using that tileset.

Thankyou anyway.
 

Logana

Well-known member
Hmm strange, maybe then a quick fix would to give it a script to move up for a second befor it goes into the loop of shooting bullets, this should most definitely work al you got do is get the move up script out of the go random direct script from the adventure Ai and I’m sure this will be a weird way to fix it but it’s easy just make sure that you have the monster stop on solid :3 if not then that’s my last fix sorry if that doesn’t work but I’m like 90% sure it will
 

Jonny

Well-known member
Hmm strange, maybe then a quick fix would to give it a script to move up for a second befor it goes into the loop of shooting bullets, this should most definitely work al you got do is get the move up script out of the go random direct script from the adventure Ai and I’m sure this will be a weird way to fix it but it’s easy just make sure that you have the monster stop on solid :3 if not then that’s my last fix sorry if that doesn’t work but I’m like 90% sure it will
I considered doing something like that but I'd prefer to find out what's causing it rather than adding something to balance it out. Plus it's an object that will be used in all levels so on the one where it draws correctly it would then be 1 pixel up. I know it's a minor detail but its really noticeable.

Although, in theory if I have a solid above it, they should all end up the same. I'll try it. Feels like a bodge up rather than a fix but if it's the only thing that'll work I guess I'll have to do it.

I'm hoping someone might come along with some clues as to why it's happening. Something to do with putting a tileset that's not the first one into memory. I just don't have a clue.
 
Last edited:

Jonny

Well-known member
Even the bodge up didn't do anything. :unsure:

I'm such an idiot, it's actually dropped down when using every tileset. Back to square one...
 
Last edited:

CutterCross

Active member
Even the bodge up didn't do anything. :unsure:

I'm such an idiot, it's actually dropped down when using every tileset. Back to square one...
It has to do with the y-coordinate offset drawing each sprite when using objects. A simple fix is to just add DEC tempB in this section of doDrawSprites.asm.
Code:
        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
        ;; ACTUALLY DRAW THE SPRITES.
        LDY tempC ;; right now, this is the offset to find the right sprite index to draw from
                    ; the tile table.
        
        LDA tempx ;; right now, this is the x value of the object.
        STA temp1 ;; store it into temp1, so that we can
                    ; restore the left most position
                    ; when we're done drawing a row.
        LDA tempy ;; right now, this is the y value of the object.
        STA temp2 ;; store it to temp2, so that we can
                    ; use it to count the drawn columns.
        DEC tempB
        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Keep in mind that means you'll also have to account for this offset if you're drawing hardware sprites individually, though that's a trivial issue compared to fixing it for objects.
 

Jonny

Well-known member
Thank-you CC. I was getting seriously confused by it all! :confused:

Worked a treat when I finally realised I was editing the doDrawSprites script that wasn't assigned! Really need to get things organised. Now my player actually stands ON the wall instead of in it.
 
Last edited:
Top Bottom