MZ Scrolling descriptions?

I want to create item descriptions that go beyond the two-line limit. I figured the best way to go would be make it a scrollable window... but for some reason it doesn't work. Didn't look too far into it, because I quickly figured that trying to scroll the item description would interfere with scrolling windows in the scenes that the help window is used in.

My next thought was attempting to create a scrolling window, like what is used for scrolling messages, and stick it on the help window in the menuBase scene. But.... I'm not entirely sure how to go about it. Scenes are an area I haven't really touched, I've only dealt with minor tweaks until now, mostly sticking to mechanic scripts.

I've already got word wrap on the default help window working, so I don't have to worry about trial and error formatting when setting up my bigger descriptions. I'm not sure if I can replicate it in the scrolling window itself, but I have a few ideas to test on that front when I get there. I also believe I know how to keep the window "active" and not cleared the entire time the help window is open, either through resetting or reversing the scroll when it reaches the end instead of clearing.

I've got a few assumptions, based on looking at the code(not stepping through it, I'm hoping not to. For scenes in menus it can jump around a LOT as I attempt to follow it at runtime, and a lot of the functions would be minutiae I don't need to follow).

-the scrolling window doesn't have a frame, per the description in the code. This means it sits on TOP of whatever you're putting it on.
-the text in the scrolling window is separate from the text in its "base", meaning I would have to set the text to the scrolling window directly, and have the base text blanked to prevent overlap.
-since the help window and scrolling window are two separate windows added to the same scene, I'd need a way to tie them together, so that updates to the help window automatically affects the scrolling window.
-this would be achieved by adding two functions to the help window prototype, one to set the reference to the scrolling window created by the scene, and one to actually provide the reference.

Are my assumptions correct? Am I missing/overlooking anything important? I'd like to get a handle on the work flow ahead of me before I start diving into the guts of a scene window. I'm wanting this to affect ALL iterations of the help window, so I have no problems overwriting the whole prototype if I have to, but I'm hoping to not modify the scrolling window much, if at all. I don't want to screw up the original. I could always create a separate version if I have to tweak it TOO much.
so I have no problems overwriting the whole prototype if I have to, but I'm hoping to not modify the scrolling window much, if at all. I don't want to screw up the original. I could always create a separate version if I have to tweak it TOO much.
I'll preface this with the caveat that I don't use MZ, only MV.

However, I do believe Window_ScrollText works the same way in both, in that its update() function runs constantly in the background checking $gameMessage every single frame for whether its "scrollMode" property was set to true, at which point it grabs whatever text is loaded into $gameMessage and draws it to display.

This is exactly how it worked in VXAce as well, so I doubt they changed it altogether too much in MZ.

Unfortunately, because of this hardwired check to $gameMessage, I do believe that you WOULD need to tweak it significantly to make it work with Window_Help instead.

With the extent of modification you'd need to do, you'd would probably be better served making a separate window only using the code from Window_ScrollText as a base to build on instead.

And yes, you would need to manually insert this new window into every Scene that has a help window. Even if you wanted to try modifying the actual Window_ScrollText, only Scene_Map and Scene_Battle create any instance of Window_ScrollText by default (because those are the only scenes where the message box window is meant to be used/created, after all message windows aren't used in the item menus). So it's not like you'd somehow be able to automatically reach every help window instance across the engine just by altering Window_ScrollText anyway.

The only way to "automatically" alter every help window in the engine is by.... surprise, surprise... modifying Window_Help itself.
I'll preface this with the caveat that I don't use MZ, only MV.

However, I do believe Window_ScrollText works the same way in both, in that its update() function runs constantly in the background checking $gameMessage every single frame for whether its "scrollMode" property was set to true, at which point it grabs whatever text is loaded into $gameMessage and draws it to display.

This is exactly how it worked in VXAce as well, so I doubt they changed it altogether too much in MZ.

Unfortunately, because of this hardwired check to $gameMessage, I do believe that you WOULD need to tweak it significantly to make it work with Window_Help instead.

With the extent of modification you'd need to do, you'd would probably be better served making a separate window only using the code from Window_ScrollText as a base to build on instead.

And yes, you would need to manually insert this new window into every Scene that has a help window. Even if you wanted to try modifying the actual Window_ScrollText, only Scene_Map and Scene_Battle create any instance of Window_ScrollText by default (because those are the only scenes where the message box window is meant to be used/created, after all message windows aren't used in the item menus). So it's not like you'd somehow be able to automatically reach every help window instance across the engine just by altering Window_ScrollText anyway.

The only way to "automatically" alter every help window in the engine is by.... surprise, surprise... modifying Window_Help itself.
Yeah, I went ahead and created a new scrolltext prototype just for this, I copied over the base text to see what I would need to modify... and it was too much to keep the original functionality intact.
I'm inserting it in the menuBase scene function that creates the help window, which should make it run in all scenes without having to do it in each one.

I knew I'd need to modify the help window prototype, but since I want all help windows to do the same thing, that's not a problem.

I think my biggest challenge now is the text. For the word wrapping, it generates new lines on the fly, where the scrolling text grabs the total height of all lines at the beginning, so I may need to implement the word wrapping BEFORE setting the scrolling text, possibly by storing the lines as a multiline string.
I'm inserting it in the menuBase scene function that creates the help window, which should make it run in all scenes without having to do it in each one.
It won't, at least in MV, Scene_Battle also create its own instance of the help window - and it doesn't inherit from Scene_MenuBase (because it isn't a menu scene).

In MZ, I doubt its version of Scene_Battle would inherit from Scene_MenuBase either.

Scene_File (parent of Scene_Save and Scene_Load) also overwrites the function used by MenuBase to create the help window in MV, you might want to check if it works the same way in MZ.
It won't, at least in MV, Scene_Battle also create its own instance of the help window - and it doesn't inherit from Scene_MenuBase (because it isn't a menu scene).

In MZ, I doubt its version of Scene_Battle would inherit from Scene_MenuBase either.

Scene_File (parent of Scene_Save and Scene_Load) also overwrites the function used by MenuBase to create the help window in MV, you might want to check if it works the same way in MZ.
I don't need the new functionality in the save/load scenes, so that's fine. I'll just need to add a check to make sure it doesn't try to reference something that doesn't exist.

I'll have to look into Scene_Battle and add the function if I need to, since I WILL need the functionality there.
I actually had one assumption partially incorrect. I don't need to clear the help window's text when I set the scrolling text. I assumed that the "doesn't have a frame" part of the scrolling window meant that it simply didn't draw the frame, meaning it only drew the text, and nothing else. Instead, it overwrites everything in its rectangle, meaning if it's the same size as the help window, the help window's frame and background completely disappear. I'm experimenting with shrinking the scrolling window's area to fit inside the help window's frame, but that only works for the default frame, and the lack of window background is pretty noticeable, and will be VERY noticeable on colored backgrounds.

So... now I need to figure out either what makes the scrolling window not have a frame so I can make it match the help window... or how to make everything in the scrolling window except for the text show what's underneath it. I have a sneaking suspicion that I can't do the latter, that all windows are on the same graphics layer, so when the scrolling window is drawn, there isn't a help window under its rectangle anymore. (tbh, if I were designing this engine, I'd do the same thing to save on memory usage)

Any thoughts?
Ok, so I had the scrollwindow variant working perfectly, aside from the no frame thing, which I don't think I have NEARLY the time, patience, or expertise to figure out on my own. So I had the brilliant idea that, if I were wanting the scrollwindow to look just like the help window, why not just convert the help window to the scroll window variant directly? Managed to hilariously freeze the game due to an interesting loop created by merging the two testing features I put in. But now I have an odd issue. The help window, even with code overwritten/added from the variant... only draws the first two lines. Even when it KNOWS (through debug/feature additions) that there are MORE than two lines. It still scrolls the text as if all lines were present... but the extra lines aren't being drawn.

Edit: Ok, I figured that part out. But now I can't get the text to clear when the text changes to an empty string. It re-updates when selecting another item with a description, but not when there's no value in the text string.

Edit 2: Figured that part out too. Half the functions copied over or merged only ran if the text WASN'T blank, so it was never resetting on cleared text. The whole thing's up and running now!
I assumed that the "doesn't have a frame" part of the scrolling window meant that it simply didn't draw the frame, meaning it only drew the text, and nothing else. Instead, it overwrites everything in its rectangle, meaning if it's the same size as the help window, the help window's frame and background completely disappear.
Oh, so it works that way in MZ too?

In MV all the windows are drawn on the same layer ("windowLayer") making them overwrite one another when they are created using the "addWindow()" function. You can get around it by using addChild() instead of addWindow(), so they don't get placed on the same layer, but I didn't know whether MZ did the same thing.

VXAce certainly didn't chuck them all onto the same layer, it actually put them on different layers and used to have a z-value property on windows giving you control over their overlap (MV doesn't support z assigning, even if you use addChild(), you have to manually draw them in the correct order or write your own function to manipulate how they're ordered in the backend array to change the order afterwards).

Guess MZ ended up doing it the same way.

One of the other reasons why just altering Window_Help directly is the cleaner choice I guess.

@Drakkonis, please avoid double posting, as it is against the forum rules. You can use the "Edit" function on your posts to add additional information you've forgotten or respond to multiple people. You can review our forum rules here. Thank you.


This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/scrolling-descriptions.135138/