MV How do I make Line Breaks function in CGMV Encyclopedia? [Solved]

When I write in an enemy description, it treats the text all as one line even despite me adding line breaks into it. This leaves the descriptions feeling very messy when I want to include stuff like weaknesses in said description so I was wondering if anyone knew a way on how to go about fixing it and guiding me on how to? I already went to Casper Gaming's discord for help (pictured as well) and I dont exactly know what do to to fix it since I have little javascripting experience but im willing to learn a bit to fix this and make my enemy descriptions look better. Maybe even a javascript commission? But idk exactly what that entails, I just wanna fix this somehow
Screenshot 2025-02-04 120107.png
Screenshot 2025-02-04 120506.png
Screenshot 2025-02-04 123926.png
you can try using the escape character like "\n" for a line break.
the way I draw it inside a window can have empty spaces.

if the escape character is not working, I need to check how it works and
try a few things.

if you can use "\c[number]" for color code, than I'm pretty sure "\n"
would do the trick.
you can try using the escape character like "\n" for a line break.
the way I draw it inside a window can have empty spaces.

if the escape character is not working, I need to check how it works and
try a few things.

if you can use "\c[number]" for color code, than I'm pretty sure "\n"
would do the trick.
I tried it and it did not work unfortunately, the \n just showed up like normal text. Same for color codes
one said VE_EscapeCodes can work with CGMV and use it everywhere.
so you can try that one and see if that works.

if that doesn't work, than I check what's blocking it or a way to make it work.
one said VE_EscapeCodes can work with CGMV and use it everywhere.
so you can try that one and see if that works.

if that doesn't work, than I check what's blocking it or a way to make it work.
Sadly it didnt... same issue as before
try this (but no promises.

on line 2040 you read
JavaScript:
CGMV_Window_EncyclopediaDisplay.prototype.drawEncyclopediaDescription = function(description, y) {
    if(description === "") return y;
    var desc2 = description.split("\n"); // <== line 2040
    var txtArray = [];
    
    // make it read
    
    var desc2 = description.split(/[\r\n]+/);

// or try this after

    var desc2 = description.toString().split(/[\r\n]+/);

I can't say if that works or a new function or line to add multiple lines.
see if any of it works or I search further,
try this (but no promises.

on line 2040 you read
JavaScript:
CGMV_Window_EncyclopediaDisplay.prototype.drawEncyclopediaDescription = function(description, y) {
    if(description === "") return y;
    var desc2 = description.split("\n"); // <== line 2040
    var txtArray = [];
  
    // make it read
  
    var desc2 = description.split(/[\r\n]+/);

// or try this after

    var desc2 = description.toString().split(/[\r\n]+/);

I can't say if that works or a new function or line to add multiple lines.
see if any of it works or I search further,
Hm, actually looking at this now, I think I need similar code to what you sent but applied elsewhere due to the enemy descriptions using Notetags to have said description added rather than the code for normal descriptions? I think I need to change something with this part of the code if you know what to do here?
Screenshot 2025-02-04 162014.png
the one above that has similar split the text at a space for a new line.

if you want it to be manually so
"very long description text inside the window like a text like this wont wrap automatically!"

so you need to insert a manually \n escape code.

so you do

JavaScript:
meta.toString().split(/[\r\n]+/);
but you have to manually
add a new line for this to work. (cant say this will work though).
the one above that has similar split the text at a space for a new line.

if you want it to be manually so
"very long description text inside the window like a text like this wont wrap automatically!"

so you need to insert a manually \n escape code.

so you do

JavaScript:
meta.toString().split(/[\r\n]+/);
but you have to manually
add a new line for this to work. (cant say this will work though).
Alright! I'll see what happens
Alright! I'll see what happens
Ok so what I tried didnt work, probably bc im not experience in javascript BUT! I finally was able to figure out something else I was having issues with that actually solved the problem I was having so... in a strange way this still helped! Thank you!
what you could try as well with default code is:

Code:
// this auto wrap at a space
<cgmvdesc: here is a long description that you use>

// this removed the line (enter)

<cgmvdesc: like the description

that was long>

what you can do is set 3 spaces between the enter or space enter and see what happens.
the same thing to test it differently is to add a dot "." and then enter.

if that works, it can be hopefully be fixed differently as a work around.
but to make a clean with just enter twice require multiple places to read
it correctly, which I need to dig into where exactly.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-make-line-breaks-function-in-cgmv-encyclopedia-solved.175151/