Can you combine the Dynamic Title and Title Menu scripts?

I tried to use both Dynamic Title by Racheal and Title Menu by NerdiGaming for my game, but it seems like they can't work together.

If I put Dynamic Title over Title Menu in materials, the dynamic title just doesn't work when the used variable changes, and if I put it vice versa the game crashes:
Unbenannt.PNG


So is it possible to edit that part so that both scripts can be used in the same game?
The issue is that both scripts overwrite the create_background method of Scene_Title but neither coder seems to have discovered the joys of aliasing yet, so they aren't compatible with each other. You can fix this by aliasing that method in whichever script you place second.

For example, if you have Title Menu after Dynamic Title, find the line "def create_background" and above it write

Code:
alias_method(:tlb_create_background, create_background)

Note that tlb is just a prefix I use for my own aliases, you can call it anything you want as long as it's something unique. I also often put a randomised 4-character string in the name to ensure uniqueness.

Then in the first line of the method, put
tlb_create_background (or whatever you called your alias)

before the other code, and it'll run the create_background method from the other script too before doing its own thing. That should solve the compatibility error.
Oh thank you.
View attachment 149674
Like this? I wrote that into Title Menu.
I usually put my aliases right above the method I'm aliasing just to keep things tidy.
Oh no. You ment the line in Dynamic Menu, right? I now wrote it into that, not into Title Menu. So what next?
Unbenannt2.PNG
After def create_background, add a new line and put

Code:
lnaf_create_background
Note that if you're doing it that way, Dynamic Menu has to come after Title Menu in the script list (whichever one you added the alias for must come second)

Edit: Whoops, sorry. Meant to edit that, not double post.

I've moved this thread to Script Support. Thank you.

Unbenannt3.PNG

Like this?
Yep! That should sort it out.
Unbenannt4.PNG

It doesn't work (I named it Title Stars). Do I also have to write that into Scene_Title?
You've missed the colon on create_background in the alias_method line. Sorry, that's my bad, I forgot it in the code snippet I gave you.

It should be

Code:
alias_method(:lnaf_create_background, :create_background)
Ah. It works now. Thank you again!
Excellent! Glad to be of assistance.
I've tried my hardest, but I still can't get this to work.
I'm just supposed to write these extra bits in TitleMenu, correct?
I tried the other way around too and a bunch of other weird combinations, but when I increase the variable, nothing happens. Please help

Screenshot (88).png

Original thread: https://forums.rpgmakerweb.com/threads/can-you-combine-the-dynamic-title-and-title-menu-scripts.123495/