Language…
14 users online: 15Tails, Abdu, ale, drinkcept, dubiousdinobot,  Fernap, Green, Isikoro,  Java, mittenfitz, pixlrik, Saela, tOaO, Zener_j - Guests: 267 - Bots: 98
Users: 70,559 (2,465 active)
Latest user: Warden_Roney

Lunar Helper & Lunar Monitor

Tool

  • Pages:
  • 1
  • 2
I encountered a bizarre issue after updating to this new version of Helper - after updating, I did a Build of my project, but when playing to test it, I noticed that every single one of my Message Box Expansion-using NPC sprites (wye's NPC sprite here) just broke. By "broke", I mean every NPC only displays message #1, and their idle/standing GFX suddenly used the walking frame! I had made no changes to either of the Lunar Helper config files, nor did I add any new patches, sprites, uberasm or anything of the sort! All I did was replace the EXE of the previous Helper's EXE with the new version.

Could Lunar Helper actually have caused it somehow? Or am I crazy? Out of curiosity, I did a standalone test with Lunar Magic 3.32 to see if maybe that caused it somehow, but no dice, my NPCs remained totally fine. I'm very confused...
Which version of Lunar Helper were you using previously? Does this happen consistently or was it just the first build? Also, do you remember if you used build or quick build?

EDIT: Actually, please try changing this code in the NPC sprite starting at line 493
Code
if read1($00A1DF|!BankB) == $22 && read1(read3($00A1E0|!BankB)+3) == $C2
        %load_extra_byte(4)                     ; \
        STA !MessageToShow                      ;  | if the message box expansion patch is applied,
        LDA #$01                                ;  | set the message number and activate the message box
        STA !MessageBoxState                    ; /
        %load_extra_byte(8)
        AND #$04
        BEQ .nosound
        LDA #$22
        STA $1DFC|!addr
.nosound
else
        %load_extra_byte(4)                     ; \
        BPL .dontChangeLevelNumber              ;  |
        LDA $13BF|!addr                         ;  | temporarily change the level number
        STA !LevelNumberBackup                  ;  | if set to use another level's message(s)
        %load_extra_byte(4)                     ;  |
        AND #$7F                                ;  |
        STA $13BF|!addr                         ;  |
.dontChangeLevelNumber                          ; /
        %load_extra_byte(8)                     ; \
        AND #$04                                ;  |
        BEQ .noSound                            ;  | play message sound if set to
        LDA #$22                                ;  |
        STA $1DFC|!addr                         ;  |
.noSound                                        ; /
        %load_extra_byte(1)                     ; \
        LDY #$01                                ;  |
        AND #$C0                                ;  | show the given message
        CMP #$80                                ;  |
        BNE +                                   ;  |
        LDY #$02                                ;  |
+       STY $1426|!addr                         ; /
endif
++
.dontShowFirstMessage

if read1($00A1DF|!BankB) != $22 || read1(read3($00A1E0|!BankB)+3) != $C2
        LDA !MessageTimer                       ; \
        CMP #$13                                ;  | if the message box expansion patch is not applied,
        BNE .dontShowSecondMessage              ;  | the message timer is at #$13
        %load_extra_byte(1)                     ;  | and it's not using a VWF dialog,
        AND #$20                                ;  | show the second message if set to
        BNE .dontShowSecondMessage              ;  |
        %load_extra_byte(1)                     ;  |
        AND #$C0                                ;  |
        CMP #$C0                                ;  |
        BNE .dontShowSecondMessage              ;  |
.showSecondMessage                              ;  |
        LDA #$02                                ;  |
        STA $1426|!addr                         ;  |
.dontShowSecondMessage                          ; /
endif

to
Code
; if read1($00A1DF|!BankB) == $22 && read1(read3($00A1E0|!BankB)+3) == $C2
        %load_extra_byte(4)                     ; \
        STA !MessageToShow                      ;  | if the message box expansion patch is applied,
        LDA #$01                                ;  | set the message number and activate the message box
        STA !MessageBoxState                    ; /
        %load_extra_byte(8)
        AND #$04
        BEQ .nosound
        LDA #$22
        STA $1DFC|!addr
.nosound
; else
;         %load_extra_byte(4)                     ; \
;         BPL .dontChangeLevelNumber              ;  |
;         LDA $13BF|!addr                         ;  | temporarily change the level number
;         STA !LevelNumberBackup                  ;  | if set to use another level's message(s)
;         %load_extra_byte(4)                     ;  |
;         AND #$7F                                ;  |
;         STA $13BF|!addr                         ;  |
; .dontChangeLevelNumber                          ; /
;         %load_extra_byte(8)                     ; \
;         AND #$04                                ;  |
;         BEQ .noSound                            ;  | play message sound if set to
;         LDA #$22                                ;  |
;         STA $1DFC|!addr                         ;  |
; .noSound                                        ; /
;         %load_extra_byte(1)                     ; \
;         LDY #$01                                ;  |
;         AND #$C0                                ;  | show the given message
;         CMP #$80                                ;  |
;         BNE +                                   ;  |
;         LDY #$02                                ;  |
; +       STY $1426|!addr                         ; /
; endif
++
.dontShowFirstMessage

; if read1($00A1DF|!BankB) != $22 || read1(read3($00A1E0|!BankB)+3) != $C2
;         LDA !MessageTimer                       ; \
;         CMP #$13                                ;  | if the message box expansion patch is not applied,
;         BNE .dontShowSecondMessage              ;  | the message timer is at #$13
;         %load_extra_byte(1)                     ;  | and it's not using a VWF dialog,
;         AND #$20                                ;  | show the second message if set to
;         BNE .dontShowSecondMessage              ;  |
;         %load_extra_byte(1)                     ;  |
;         AND #$C0                                ;  |
;         CMP #$C0                                ;  |
;         BNE .dontShowSecondMessage              ;  |
; .showSecondMessage                              ;  |
;         LDA #$02                                ;  |
;         STA $1426|!addr                         ;  |
; .dontShowSecondMessage                          ; /
; endif

and let me know if that helps.
Originally posted by underway
Which version of Lunar Helper were you using previously? Does this happen consistently or was it just the first build? Also, do you remember if you used build or quick build?

EDIT: Actually, please try changing this code in the NPC sprite starting at line 493
Code
(edited code)

and let me know if that helps.



So, previously I was using v2.0.0-LMC. Normally I'm pretty good at keeping up with every tiny update for any software I use, but I fell behind anyway! I used Build, not Quick Build (I actually almost never use Quick Build). Regardless, it happens consistently on each new Build.

After changing the lines you mentioned, it.... vaguely fixed it? So only a *few* random NPC display their correct respective dialogue, though most still repeat message #1. And now the button for interacting with ALL of them was reset to UP instead of X and Y, which I had set them to previously. That, and the aforementioned graphical bug is still there.

I've never seen such an odd issue caused by a tool like this! I'm not annoyed or anything, I have plenty of backups of my project and I can always revert to an older Helper version - I just saw the update you posted yesterday and wanted to update since the changes all looked fantastic to use. Still, I'm curious what's going on...
That's fairly strange. The insertion order for tools was changed in Lunar Helper v2.0.0, which moved patches all the way to the end of the build process. I would assume that that'd be where your problems were coming from and I'm unsure how you could have used v2.0.0 without running into the same problems, since the sprite clearly checks for the presence of the message box expansion patch, which would not yet be there for it to detect in versions higher than v2.0.0. Though even then, I would assume any problems you'd encounter would probably be tied purely to the messages, not the graphics or behavior of the sprites.

My other theory is that the sprite's extra bytes may have gotten corrupted somehow, though I'm not sure why that would happen, maybe some odd interaction between PIXI and Lunar Magic, it's hard to say.

I took a quick look at the changes between v2.0.0 and v2.4.0 and there shouldn't be anything in there that would cause this either as far as I can tell.

If you wouldn't mind, it might help me out if you could check whether the extra bytes of the sprites still describe the behavior you would expect them to have or if they have changed since you put them in there.

Since I think this is probably largely tied to insertion order, I've decided to come up with a system to customize in what order Lunar Helper builds your ROM, should be ready in a few days hopefully and might help depending on what the source of the problem is.
Here's an example of one of my NPC sprites. *This* GIF shows how the NPCs now stop moving on their walking frame, instead of their standing/idle frame. And *here* is another one, showing two NPCs that are set to the same walking speed, which is unchanged at least - but then you'll notice they're both displaying the same message, which they should not be. (And though you can't see it, I have to use UP to talk instead of X/Y)

I just compared the extra bytes of several NPCs, and it shows that there's no change before and after running the tool. *Here's* a random NPC in LM. All the bytes you see were unchanged.

Originally posted by underway
Since I think this is probably largely tied to insertion order, I've decided to come up with a system to customize in what order Lunar Helper builds your ROM, should be ready in a few days hopefully and might help depending on what the source of the problem is.


That sounds really great! And if nothing else, I'm sure other people would have a use for customizing the order. I'll wait for that and see if it does anything for my issue! I appreciate the help, Underway!
Just updated Lunar Helper, you should now hopefully be able to customize the build order to suit your hack's specific needs via the new "build_order" config variable, here's an example (the config files and readmes go into more detail):
Code
build_order
[
    Graphics                -- Insert standard GFX
    ExGraphics              -- Insert ExGFX
    Map16                   -- Insert Map16

    SharedPalettes          -- Insert Shared Palettes 
    GlobalData              -- Insert Overworld, Title Screen and Credits 

    Patches                 -- Insert all remaining patches from the patches list that 
                            -- are not explicitly mentioned in this build order

    PIXI                    -- Insert custom sprites
    Levels                  -- Insert all levels

    AddMusicK               -- Insert custom music
    GPS                     -- Insert custom blocks
    UberASM                 -- Insert UberASM code

--  Patches/some_patch.asm  -- Example of inserting a specific patch at a different time
]

Lunar Monitor also got updated to support Lunar Magic 3.33.
Just pushed another update for Lunar Helper:
- asar now comes pre-packaged with Lunar Helper, so you no longer need to specify or even have an asar executable on hand
- you can now insert globules (global routines and data) with Lunar Helper that are automatically inserted and cleaned up and can be used by any other tool or resource without having to manually keep track of addresses
- Lunar Helper now generates a file before every (quick) build that contains defines that can be used to determine which Lunar Helper version is being used in patches or other resources, these defines are also included by default in any patch or globule, which could be useful for ensuring patch compatibility with Lunar Helper
- The default build order specified in the config files that come with the tool has changed to be entirely vanilla, this is to provide a minimal initial setup for vanilla hacks that can be easily extended for other types of hacks

The project template includes these changes, it also has been updated to use Lunar Magic 3.33 and UberASM Tool 1.5.

I also have plans to further improve quick build at some point, which should remove arbitrary dependencies for good and make quick build even faster.
I have a new Lunar Helper version I wanna release alongside a lot of pretty detailed documentation, so if anyone has been wanting to port a project to the workflow or start a new project with it and wants to also be a guinea pig for a new version/documentation for some reason, please send me a PM here or a DM on discord and I'll get you hooked up (I'll do my best to help you out if there are any issues of course).
No one wanted to test #smrpg{sad}, so here's Lunar Helper v4.0.0 for public consumption.

Hottest news:
- An actual semi-organized wiki for setting up new and preexisting projects, as well as any potentially interesting features
- All the involved tools are now merged into one repository, mostly so I don't have to maintain 1000 version numbers and slowly drift into the abyss
- "R - Run" and "T - Test" will now use your Lunar Magic emulator by default if no other emulator is specified
- Lunar Helper will offer to extract vanilla resources for you when setting up a new project
- New "O - Open project in File Explorer" function (it does what it says, I promise)
- No more Lunar Magic popups inside Lunar Helper, all the popup dialog boxes have been converted to actual in-terminal text using magic and other tricks
- Globules are cooler now (I like globules, I won't shut up about them)
- EDIT: Forgot to mention, but I know some people have had issues with antiviruses including even windows defender wrongly flagging Lunar Monitor as malware or outright nuking it in the past, it seems like some of the changes I've made for this version have resulted in antiviruses being much less inclined to do any of that, which would be real swell

Let me know what you think or if there's any bugs. I'm very curious if the wiki is helpful and what could be improved or expanded on, thanks #smrpg{sick}
  • Pages:
  • 1
  • 2

Tool