NOTE: The online ide in Step One crashes with big maps. Use an ide and i/o with big maps (I use zerobrane) (see second post for details)
What it does:
* remove normal /* ** */ comments (but not any others; anything that's undefined seems to work as a comment)
* less whitespace (newlines, tabs and extra spaces become a single space)
* you can see big improvement in file size for a lot of maps, just because it puts everything on one line
Known Issues:
How to use:
Step One: Go to this websitehttps://www.jdoodle.com/execute-lua-online
Step Two: Delete the stock lua code
Step Three: Open your Random Map Script and copy it
Step Four: Paste your Random Map Script INBETWEEN THE [[...]]
It should look a little something like this
local MAP =
[[ ... DO STUFF ...]]
Step Five:
Run it. It should take a few seconds at most.
Step Six: Copy the output to an empty text file
Step Seven: Save your file.
Step Eight: Test your map to make sure this trick works
Did this need its own post: no.
USA
katsup or mustard
* remove normal /* ** */ comments (but not any others; anything that's undefined seems to work as a comment)
* less whitespace (newlines, tabs and extra spaces become a single space)
* you can see big improvement in file size for a lot of maps, just because it puts everything on one line
Step One: Go to this website
Step Two: Delete the stock lua code
local x = 10and replace it with this code
local y = 25
local z = x + y
print("Sum of x+y =",z)
local MAP = [[ ] ]
function make_table(STRING)
local pattern,captures,i, ignore,keep = "%g+",{},1, 0,{}
for c in string.gmatch(STRING, pattern) do
captures[i] ,i = c,i+1
end
for i,v in ipairs(captures) do
if v == "/*" then
ignore=ignore+1
end
if ignore == 0 then
table.insert(keep, v)
end
if v == "*/" then
ignore=ignore-1
end
end
return table.concat(keep," ")
end
print(make_table(MAP))
Step Three: Open your Random Map Script and copy it
Step Four: Paste your Random Map Script INBETWEEN THE [[...]]
It should look a little something like this
local MAP =
[[
Step Five:
Run it. It should take a few seconds at most.
Step Six: Copy the output to an empty text file
Step Seven: Save your file.
Step Eight: Test your map to make sure this trick works
Did this need its own post: no.
USA
katsup or mustard
[This message has been edited by local boi (edited 07-15-2018 @ 08:11 AM).]