[4.5.9] End of Text Action --> warps

dale_coop

Moderator
Staff member
For those who need this feature... When a text is finished, it executes a warp.
This does not currently exist, but we could hijack the "Open Shop" text completion action for this (as it is not used in the current 4.5).
2023-03-02 13_53_47-NES MAKER 4.5.9 - Version_ 0x176 - AdventureTutorial.MST.png


1) Modify your DoDrawText.asm script (located in the "GameEngineData\Routines\BASE_4_5\Game\Subroutines\" folder). Around line 279, between the "notEndTrigger:" line and the "CMP #_MORE" line:
2023-03-02 13_56_31-● doDrawText.asm - NESmaker_4_5_SummerCamp (Espace de travail) - Visual St...png
Insert that piece of code:
Code:
        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
        ;; "Open Shop" -> warp
        CMP #_ENDSHOP
        BNE +notEndShop
            LDA textPointer
            CLC
            ADC #$01
            STA textPointer
            LDA textPointer+1
            ADC #$00
            STA textPointer+1
            ;; "open shop" warps:
            LDA textQueued
            ORA #%00000100    ;; text warps
            STA textQueued
            LDA #$00
            STA textHandler
            JMP endOfText
        +notEndShop:
        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Should now looks like that:

2023-03-02 14_03_01-doDrawText.asm - NESmaker_4_5_SummerCamp (Espace de travail) - Visual Stud...png


2) Modify your DoDrawBox.asm script (located in the "GameEngineData\Routines\BASE_4_5\Game\Subroutines\" folder). Around line 328, between the "STA gameStatusByte" line and the "JMP notDoneWithBoxDrawOutterLoop" line:

2023-03-02 13_59_14-● doDrawBox.asm - NESmaker_4_5_SummerCamp (Espace de travail) - Visual Stu...png

Insert that piece of code:
Code:
                            ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            ;; "Open Shop" -> warp
                            LDA textQueued
                            AND #%00000100    ;; text warps
                            BEQ +skipTextWarp
                                LDA textQueued
                                AND #%11111011
                                STA textQueued
                                WarpToScreen warpToMap, warpToScreen, #$01
                            +skipTextWarp:
                            ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Should now looks like that:

2023-03-02 14_01_09-doDrawBox.asm - NESmaker_4_5_SummerCamp (Espace de travail) - Visual Studi...png

Voilà, now when you set a text to do a "Open shop" as end action... it will warp when the text closes.
 
Last edited:

tbizzle

Well-known member
Edit** Never mind figured it out. Unbelievable a nooby like me can somewhat code now lol.

@dale_coop Can this somehow be used on different screens? I have a warptoscreen macro inside my hurt monster script that will load by screen type and i can branch off and use multiple times. Is there a way to do that here???
 
Last edited:

tbizzle

Well-known member
I modified it so I can use it screentype #1. But now I do not know how to branch it off to use it with more screenType rooms. Here is my modified script:
Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            ;; "Open Shop" -> warp
                            
                            LDA screenType
                            CMP #1
                                
                            BNE +otherStuff
                                
                              +otherStuff: 
                            BNE +skipTextWarp
                            LDA textQueued
                            AND #%00000100    ;; text warps
                            
                                LDA textQueued
                                AND #%11111011
                                STA textQueued
                                WarpToScreen #$00, #$40, #$01
                            +skipTextWarp:
                            ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 

tbizzle

Well-known member
@dale_coop I wanted to also have the script check for screenType #2 and do another WarptoScreen to a totally different set of map coordinates.
 

Jonny

Well-known member
Thanks Dale. I've been thinking about a way to end a conversation between two characters. I'm using various lookup tables to change the box size, sprite decorations, text to draw etc. I'd thought about having a certain value in a table for ending the conversation but I think a modified version of this will be better.
Also, I love how you've put together the tutorial with images of code and snippets for the parts to add. It looks really neat.
 
Top Bottom