This probably is a VERY weird issue, but I am using a script to convert a Roblox Map to a different game.
Currently, the generated output (mapdata) has 3,233,716 characters in it. I obviously cant store that in a stringvalue then copy the value to my clipboard, and using HTTPService doesn’t work because the POST data is 5615kb (over Roblox’s 1024kb limit).
Is there any way to get this string out of studio?
Is this map user-generated while in-game? And by “another game”, do you mean another place within your universe that a the same user is teleported to? If this is about moving a hand-built map in Roblox Studio to another game, you can just copy the map to your clipboard or download it as a .rbxm
file
Break it up into shorter strings maybe…
I’m converting it to a VMF file for GMod. I need to have it as text/string
You can try @2112Jay’s idea by uploading the string over time. You can combine string.len with HttpService:JSONEncode to get an estimate on the number of bytes your string yields. The result is usually an overestimate, so slicing your strings into comfortable but packed chucks to meet the POST size limit won’t be difficult. You can post the data to a locally hosted server and reassemble the string as it’s received. The external language used to host the server will have no trouble copying it to your clipboard. You could even directly produce the VMF file. Alternatively, you can build a file conversion tool that works directly with .rbxm
and VMF. As far as I know, the RBXM encoding is just XML, but there may be some additional compression. It might help to look at how the Remodel CLI tool handles Roblox files.
HttpService is quite limiting due to its max size. I haven’t used this thoroughly before so you’d need to do your own research but have you tried sending the data to your local plugin?
I did look into this, but I didn’t see any helpful methods after a light scan. After looking again, this might be a viable path,:
- Develop your tool as a plug-in.
- Produce the string and write it to a script.
- Call Selection:Set to auto-select the script.
- Call Plugin:PromptSaveSelection
- Save the file as a
.txt
file
Took a bit of tinkering, but I made it work. Finalized code for saving it incase anybody is curious:
local vmfDat = Instance.new("Script")
vmfDat.Parent = workspace
vmfDat.Name = "VMFData"
task.wait()
SelectionService:Set({vmfDat})
local success, err = ScriptEditorService:OpenScriptDocumentAsync(vmfDat)
if success then
task.wait()
ScriptEditorService:UpdateSourceAsync(vmfDat,function()
return output
end)
plugin:PromptSaveSelection("map.vmf")
else
print(`Failed to open VMF DATA. Please retry. Error: {err}`)
vmfDat:Destroy()
end
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.