Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I import huge text files into roblox scripts without crashing?

Asked by 1 year ago

I'm trying to import a custom text file I made using python, however copy and pasting it into a roblox scripts completely crashes roblox studio. The text is a 644mb table which I want to use in roblox studio.

Is there any way for me to somehow get the text from a .txt on my computer to roblox studio via an api or something?

0
Have you tried changing it to a .lua file? T3_MasterGamer 2189 — 1y
0
I changed the filetype to a .lua file, however importing the file still crashes roblox studio. Is there any other alternatives? waffle792 8 — 1y

1 answer

Log in to vote
0
Answered by 1 year ago

This will not work, even if you manage to get the text into the script for many reasons:

Roblox will likely not save a script of that size onto their servers, so it will get deleted whenever you publish the game

Even if it is saved, Roblox game servers do not have much memory and using 644MB on a variable will almost definitely crash the game.

Are you absolutely certain that every part of this file is important? 644mb of text is a crazy amount. That is over 60 million letters in the file; I really cannot think of any reason you would ever need this much data in any game, let alone a roblox game.

if you really want to use this text file, what you need is a HTTP server to host it in chunks of no more than 10MB (ideally less) and then you can download them individually, process them, and then delete them. Remember, if you download too much into a script, the game will crash.

For the host I recommend using github (since basically no one else will store a text file of that size for free) and on Roblox you would need to use the HTTPService. I can't provide specific details since its not clear what you need exactly.

0
I managed to trim it down to a *mere* 244 mbs, but your idea does sound like the way to go. It's late for me right now, but I'll give it a try in the morning. Thanks! waffle792 8 — 1y
Ad

Answer this question