Tuna
Member
Hello everyone. I am not the most knowledgeable person when it comes to GML, but I can usually get around my issues and make things work. This has not been the case while dealing with this problem. I have been googling and trying different solutions for a couple days now.
My "game" is a simple one that is just for reading one or more HTML files, creating a folder for each, and extracting all of its images to its respective folder. I have been unable to get past reading the HTML files and making their folders because I am running into an issue when reading some of them. Not all of the files cause this issue, but it seems to be the ones where at least one of the base64 lines for an image are exceptionally long. I am adding each line of an individual file to a temporary list in order of the lines. If I restart the program and load a problem file again, it crashes when reading the same line it did the time before. The problem lines are usually around 150,000 characters. Could this be causing a crash in itself? If so is there a good way to read such a large string? I don't believe a memory leak is happening because I am clearing/destroying a list after using it, and I have watched on my resource manager and not seen spikes of any sort when a crash happens.
I am using an extension from the marketplace called Unboxed filesystem by kagamma to have access to files outside of the sandbox. I am doing this on GMS2 v2.3.0.529 Runtime v2.3.0.401 on Windows 10.
Here is the output. The compile errors window never has anything to say when this happens.
and finally, here is the script that reads each line into the list, the last script that is doing anything before a crash.
If there is any other information I can give, I would be happy to. This is driving me crazy. I would appreciate any help very much.
My "game" is a simple one that is just for reading one or more HTML files, creating a folder for each, and extracting all of its images to its respective folder. I have been unable to get past reading the HTML files and making their folders because I am running into an issue when reading some of them. Not all of the files cause this issue, but it seems to be the ones where at least one of the base64 lines for an image are exceptionally long. I am adding each line of an individual file to a temporary list in order of the lines. If I restart the program and load a problem file again, it crashes when reading the same line it did the time before. The problem lines are usually around 150,000 characters. Could this be causing a crash in itself? If so is there a good way to read such a large string? I don't believe a memory leak is happening because I am clearing/destroying a list after using it, and I have watched on my resource manager and not seen spikes of any sort when a crash happens.
I am using an extension from the marketplace called Unboxed filesystem by kagamma to have access to files outside of the sandbox. I am doing this on GMS2 v2.3.0.529 Runtime v2.3.0.401 on Windows 10.
Here is the output. The compile errors window never has anything to say when this happens.
Code:
**********************************.
Entering main loop.
**********************************.
>Dialogue initiated.
>File(s) loaded.
[FUNC] string_splitter_files
>Putting filenames into list
[ENDFUNC] string_splitter_files
>Destination folder loaded.
[FUNC] iterate_files
[FUNC] read_html
>Reading C:\Users\nigr3\Desktop\broken-picture-phone-recovery-master\bpp\bpp-1592622831089.html into list...
>Reading line 1
>Reading line 2
>Reading line 3
>Reading line 4
>Reading line 5
>Reading line 6
>Reading line 7
>Reading line 8
>Reading line 9
>Reading line 10
>Reading line 11
>Reading line 12
>Reading line 13
>Reading line 14
>Reading line 15
>Reading line 16
>Reading line 17
>Reading line 18
>Reading line 19
>Reading line 20
>Reading line 21
>Reading line 22
>Reading line 23
>Reading line 24
>Reading line 25
>Reading line 26
X://windows/Runner.exe exited with non-zero status (-1073741819)
elapsed time 00:00:09.0591987s for command "C:\ProgramData/GameMakerStudio2/Cache/runtimes\runtime-2.3.0.401/bin/Igor.exe" -j=8 -options="C:\Users\nigr3\AppData\Local\GameMakerStudio2\GMS2TEMP\build.bff" -v -- Windows Run started at 11/22/2020 23:12:32
"cmd" /c subst Z: /d
elapsed time 00:00:00.0581519s for command "cmd" /c subst Z: /d started at 11/22/2020 23:12:41
"cmd" /c subst Y: /d
elapsed time 00:00:00.0587835s for command "cmd" /c subst Y: /d started at 11/22/2020 23:12:41
"cmd" /c subst X: /d
elapsed time 00:00:00.0582920s for command "cmd" /c subst X: /d started at 11/22/2020 23:12:41
FAILED: Run Program Complete
For the details of why this build failed, please review the whole log above and also see your Compile Errors window.
GML:
function read_html(file){
show_debug_message(" [FUNC] read_html");
show_debug_message(" >Reading "+argument[0]+" into list...");
var thefile = argument[0];
var str = "";
var num = 0;
var line = 0;
var thelist = ds_list_create();
var read = file_text_open_read_ue(thefile);
while (!file_text_eof_ue(read))
{
show_debug_message(" >Reading line "+string(line+1));
ds_list_insert(thelist,line,file_text_readln_ue(read));
line++;
}
file_text_close_ue(read);
show_debug_message(" [ENDFUNC] read_html");
return thelist;
}