Amarok

Veteran
Veteran
Joined
Dec 15, 2016
Messages
298
Reaction score
733
First Language
Spanish
Primarily Uses
RMMV
Hello guys! so ive recently started to learn coding but this is still too much for me, if you don't know exactly what im talking about

Combat_report.png


Just be able to open and close a window that shows up more lines of text as i add them, then once its filled it clears the window and starts again.
I got the persistent custom window to show up, but i don't even know how to close it or update the text.
Im assume this cant be that hard to add, but im still too much of a noob to figure it out, if anyone could give me a hand that would be awesome. Thanks in advance people!

EDIT: i got this, was a lot easier than i thought! just declare a global variable on a plugin then use that variable to create the window, add text, close it, whatever.

URHQVvp.jpg
 
Last edited:

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,548
Reaction score
3,310
First Language
Binary
Primarily Uses
RMMZ
you just need to store an array of strings as text, or an array of objects for text elements,, for example:

Code:
var text_array = [];

function addToTextLog(newtext, otherdata){
  let text_obj = {};
  text_obj.text = newtext;
  text_obj.other = otherdata;
  text_array.push(text_obj);
}

function clearTextLog(){
  text_array = [];
}

// use functions as:..
addToTextLog("my string of text", "someotherdataforathing");
clearTextLog();

Hope this helps :*
 

Amarok

Veteran
Veteran
Joined
Dec 15, 2016
Messages
298
Reaction score
733
First Language
Spanish
Primarily Uses
RMMV
@?????? thanks! im still struggling to understand all the different stuff, for reference i used this little script @Astfgl66 posted on a previous thread (thanks a lot for sharing it btw!):

var win = new Window_Base(150, 150, 100, 100); //x,y,width,height
SceneManager._scene.addChild(win) //adds the window to the curent scene
win.drawText("Your text", 0, 0, 100, "left"); //draws the text

Would it be possible to use your solution on this window? sorry if what i ask sounds ridiculous but i genuinely don't know, just got started with arrays and cycles recently
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,548
Reaction score
3,310
First Language
Binary
Primarily Uses
RMMZ
I feel like your using that as a script call from within some event, in which case, i recommend you look further into how object oriented programming works.

In short, yes, my solution would work, but only if used in the right way. I'd recommend a guide for how to create a plugin for a custom window. once your at that point, it should be easier to understand how to make the window show the text you want. :)
 

Amarok

Veteran
Veteran
Joined
Dec 15, 2016
Messages
298
Reaction score
733
First Language
Spanish
Primarily Uses
RMMV
@?????? thanks again! i guess i really tried to bite more than i can chew haha i will start following tutorials from the basics again, if you have any recommendation to get started i would appreciate that a lot aswell.
 

Astfgl66

Veteran
Veteran
Joined
Jan 5, 2016
Messages
734
Reaction score
605
First Language
French
Primarily Uses
You probably want to create your custom window with a plugin for this.
Look into window base and draw your text within your own update function.
Use the built in show and hide methods to close or open the window.

There's a lot of example of what you want to do, look into the core scripts for inspiration. At least within window base since that's what you're creating.
 

Amarok

Veteran
Veteran
Joined
Dec 15, 2016
Messages
298
Reaction score
733
First Language
Spanish
Primarily Uses
RMMV
@Astfgl66 awesome, will do that, thanks again!
 

Latest Threads

Latest Posts

Latest Profile Posts

I have game ideas, but none of them would fit the theme for IGMC. XD
Why the heck do I keep comparing my games to ones made by huge companies? I'd love them to have that level of polish but I'm simply not good enough.
Hell of a day at the London Games Market! :D

1656892272017.png

Check out my haul!

Forum statistics

Threads
123,303
Messages
1,155,645
Members
161,722
Latest member
Shattered_Angel
Top