New account registration is temporarily disabled.

INSUFFICIENT MEMORY [RM2K3]

Posts

Pages: 1
So I'm working on making a custom menu with the text plugin for dynrpg when all of a sudden it says I have insufficient memory, but this only happens sometimes and not every time I open the custom menu. Any ideas why this is? It always works the first time I open the menu, but then if I restart the game via F12 and try to open the menu I get the error message Insufficient memory. This happened after I added a few @append_lines(about 10 of them). I'm guessing to much text is on screen. It might be because I'm refreshing the text every second because there is a time system, but I made it just refresh the time only and it still says insufficient memory.
Since this is directly related to the text plugin, it makes more sense to post it on the existing utility page for the plugin. That way Kazesui will get a notification. He's one of the few people that can help you.
Basically what link_2112 said, such specific stuff would be better on the corresponding comment field.

Either way, I took a quick look at it, and there's definately a bug in there which I haven't noticed so far. It has nothing to do with the refresh rate, but rather some kind of memory problem, where the memory usage exponentially grows with each append_line. It works fine as long as you don't use append_line more than roughly 4 times, but after that it gets a bit nasty.

I don't really have time to fix this right now though, so the bug fix will have to wait for a tiny while. You could always try to simply use several "write_text" commands instead though if you don't want to wait for the fix. If you make some heroes, items or skills with the name of the custom menu options, you should be able to easily make them with a loop, similar to that shown in the lower left event in the demonstration project.
I've always used the change_text command when I need to make changes to something already written. Doesn't write_text only work to write something the first time, and if you use it again it doesn't affect anything? Unless you used an erase_text command between them. I haven't used it a while but I remember it being like that.
@Kazesui
Thanks for the quick response, I guess I'll just use @write_text for now. I'll have to look at the sample project for the loop you mentioned.

@Link_2112
I just use the @remove_text command as the first command in a parallel process to refresh the text and add a wait command at the end. Seems to work fine that way, haven't had any issues doing it that way so far.
write_text only works once per tag, so if you have a text with the tag "option1" then you won't be able to write again using write_text and "option1".
However, you can mix in the text commands into the tag text, meaning you can create variable names with ease.

example:

@write_text "option\v[0]", "text", ...


If you create a loop, where you increase variable 0 with 1 each time, you now get different tags in each iteration. Also, if you trade "text" with

"\i[\v[1]]"

You could easily write some item names from the database depending on variable 1. And of course, there's nothing stopping you from just creating some items in the database which cannot actually be found in the game itself.
There are a couple of other options as well, using hero names, skill names as well.

That's gist of handling this in a loop fashion, and saving some work. If you have several instances showing the same kind of options, this could also be a good way of making sure you only have to change the item names, to make sure the change is done everywhere, where the draw_text is used
@Kazesui
Awesome, didn't know I could do that. Thanks for the advice. Now I can create a custom menu system with ease. The only problem will probably be equipping and unequipping items, but I'll figure it out.
Pages: 1