(4.5.9) How would I make/use an Auto Text Tile in Platformer?

NightMusic

Active member
Please help me add a text tile to arcade platformer (4.5.9)
(How would I make/use an Auto Text Tile in Platformer?)
I tried using the NPC tile from adventure module and that and the tile for displaying text don't work. When it does draw on screen there are letters missing and it won't advance my text.
 

dale_coop

Moderator
Staff member
Can you share the script you used?

Oh, also, make sure to add the DrawNPCtext input script (from the Adventre module input script) to you B button (it's that script that close, and advence the text) and finally add a few lines of code at the beginning of the script, following that topic:
 

NightMusic

Active member
ActivateTextTrigger_AdventureBase
Code:
    LDA npcTrigger
    ORA #%00000001
    STA npcTrigger
    
    LDA screenText
    STA npc_text
    
    RTS

the text that does show up is missing characters (letters) and it wont advance when i hit the button


also tried this...

InstantActivateText_AdventureBase
Code:
;;; this tile will instantly activate text upon player collision with it
;;; and then will change it's collision type to walkable, so that the collision
;;; only happens one time per screen load.

    ;; from the jump, right now the tile offset should be loaded in temp1 and temp2 should determine what collision table we should look in.
    ;;;;;;;;; First, let's turn the underlying tile into a normal walkable tile.
    LDY temp1
    LDA temp2
    BEQ +isEvenCt
        ;; is an odd ct, so looking in collisionTable2
        LDA #$00
        STA collisionTable2,y
        JMP +doneWithTileUpdate
    +isEvenCt
        LDA #$00
        STA collisionTable,y
        
    +doneWithTileUpdate
    
    LDA npcTrigger
    ORA #%00000001
    STA npcTrigger
    

    DrawBox #BOX_1_ORIGIN_X, #BOX_1_ORIGIN_Y, #BOX_1_WIDTH , #BOX_1_HEIGHT, #TEXT_NPC, screenText

    ;;; x
    ;;; y
    ;;; width
    ;;; height
    ;;; text mode
        ;#TEXT_NPC pulls from the index in the following argument.
        ;#TEXT_FREE allows you to just write a label definition in the following argument
        ; and as long as you're in the right bank, will draw it.
    ;;; string or index.

   RTS


lastly, this is the input im using... (this works fine with normal NPCS and dialog also my npcs and player are taller than 16 pixels.)

drawNPCtext_AdventureBase
Code:
NPC_WIDTH = #$18
NPC_HEIGHT = #$18
 
   LDX player1_object
    LDA Object_direction,x
    AND #%00000111
    TAY
    
    LDA NpcFocusTableX,y
    STA tempA
    LDA NpcFocusTableY,y
    STA tempB
    
    LDA Object_x_hi,x
    CLC
    ADC tempA
    STA tempC
    
    LDA Object_y_hi,x
    CLC
    ADC tempB
    STA tempD
    
    LDX #$00
    doCheckForNpcLoop:
    LDA Object_status,x
    AND #%10000000
    BNE +keepChecking
        JMP +noNPCcollision
    +keepChecking

        ;; we have confirmed it is active.
        LDA Object_flags,x
        AND #%10000000
        BNE +keepChecking
        
            JMP +noNPCcollision
        +keepChecking
            ;; we have confirmed it is an NPC type.
            LDA tempC
            CMP Object_x_hi,x
            BCC +noNPCcollision
                ;; still possible.
                LDA Object_x_hi,x
                CLC
                ADC #NPC_WIDTH
                CMP tempC
                BCC +noNPCcollision
                    ;;; still possible
                    LDA tempD
                    CMP Object_y_hi,x
                    BCC +noNPCcollision
                        LDA Object_y_hi,x
                        CLC
                        ADC #NPC_HEIGHT
                        CMP tempD
                        BCC +noNPCcollision
                                LDA Object_id,x
                                TXA
                                PHA
                                    LDA stringGroupPointer,x
                                    STA npc_text
                                PLA
                                TAX
                                LDA npcTrigger
                                ORA #%00000001
                                STA npcTrigger
                            JMP +doNpc
                  
            +noNPCcollision
                INX
                CPX #TOTAL_MAX_OBJECTS
                BNE doCheckForNpcLoop
                    RTS
    +doNpc
    LDA npcTrigger
    AND #%00000001
    BNE dontSkipNPCtext
    JMP +skipNpcText
dontSkipNPCtext:
    DrawBox #BOX_1_ORIGIN_X, #BOX_1_ORIGIN_Y, #BOX_1_WIDTH , #BOX_1_HEIGHT, #TEXT_NPC, npc_text
    ;;; x
    ;;; y
    ;;; width
    ;;; height
    ;;; text mode
        ;#TEXT_NPC pulls from the index in the following argument.
        ;#TEXT_FREE allows you to just write a label definition in the following argument
        ; and as long as you're in the right bank, will draw it.
    ;;; string or index.
+skipNpcText
   RTS
  
  
NpcFocusTableX:
    ;; DOWN  DR    RIGHT   UR  UP    UL    LEFT  DL
    .db #$08, #$00, #$18, #$00, #$08, #$00, #$F8, #$00

NpcFocusTableY:
    .db #$18, #$00, #$08, #$00, #$F8, #$00, #$08, #$00

@dale_coop I've tried these and even a few edits of my own to no avail. any help in getting this to work will be extremely appreciated. Thank you.
 

smilehero65

Active member
I tried this out to no avail. any text that has been drawing has missing letters
Ah man that sucks.
I remembered being in the same place with the same bug years ago.
Couldn't fix it, though :(

At this point, maybe try to make your text appear under a monster behavior or something.
 

SHLIM

Active member
Please help me add a text tile to arcade platformer (4.5.9)
(How would I make/use an Auto Text Tile in Platformer?)
I tried using the NPC tile from adventure module and that and the tile for displaying text don't work. When it does draw on screen there are letters missing and it won't advance my text.
have you checked the characters are set correctly in the hud & boxes screen? some of them are set incorrectly so you get random letters or letters missing
 

NightMusic

Active member
have you checked the characters are set correctly in the hud & boxes screen? some of them are set incorrectly so you get random letters or letters missing
I think whats going on is if I have palette cycling (the palette goes through its colors) turned on in a bit on the screen, it causes these problems. when its off they dont exist. soution currently is no cycling on these screens.
I'm havign problems showing entry 2 3 4 on the screen if theyre different from entry 1. it always chooses the first one. This error is with NPC type objects too. if i make them object 2 or 3 or 4 they still only show text from entry 1.
 

tbizzle

Well-known member
@NightMusic I think I solved the palette cycling/ missing letters in text glitch. I added this bit of code to the HandleGameTimer asm:

Code:
    LDA gameStatusByte
    AND #%00000001
    BEQ beer
    JSR doWaitFrame
        beer:

I put it in right before this stuff:

Code:
    LDA palettesCycleTimer         
    BNE PaletteCycleTimerCountDown   
    JSR CycleThyPalettes

I've tested it a good 25 times and not a single glitch. Usually the glitch occurs after the second try.
 

NightMusic

Active member
@NightMusic I think I solved the palette cycling/ missing letters in text glitch. I added this bit of code to the HandleGameTimer asm:

Code:
    LDA gameStatusByte
    AND #%00000001
    BEQ beer
    JSR doWaitFrame
        beer:

I put it in right before this stuff:

Code:
    LDA palettesCycleTimer        
    BNE PaletteCycleTimerCountDown  
    JSR CycleThyPalettes

I've tested it a good 25 times and not a single glitch. Usually the glitch occurs after the second try.
i like this and beer is always good. :) thank you
 

tbizzle

Well-known member
@NightMusic Did you ever make any progress on the auto-text tile? This is the next thing I am going to go for. I want some auto text for certain objects that are collected in my game.
 
Top Bottom