start text 1 tile code 4.1.5

Logana

Well-known member
Is there any way to have a tile trigger the npc text in the adventure game style, for example if i had the player teleport in on or falling on this tile it would triger text 1 in the text group i have set for
that specific room ?
 

Bucket Mouse

Active member
Yep, it's called the Autotext tile.

Code:
    ;; set this tile as a NPC text tile:
    LDA npc_collision
    ORA #%00000010
    STA npc_collision

    LDA tileCollisionFlag
    BEQ +
    JMP finishedWithAutoText
    + 
    LDA #$01
    STA tileCollisionFlag

    ChangeTileAtCollision #$00, underSecret  ;<<-- change the collision data of the current tile to null walkable and graphics to undersecret

    ;;; !! HERE !!  you can set the text you want (Text 1="00" or Text 3="01" or Text 4="02" or Text 4="03" from the TextGroup assigned to your screen):
    LDA #$00  ;;<<-- it will use the "Text 3" of your screen
    STA textVar

    ;; activate the text-box:
    LDA gameHandler
    ORA #%00100000
    STA gameHandler
    LDA #%10000000
    STA textboxHandler
    

    ;TriggerScreen screenType

finishedWithAutoText:
 
Top Bottom