Is there a reason why this can't be generated in real time as opposed to saving a gif? Does the gif really need to be saved? Is that for the user to keep or something like that?meteopath wrote: ↑Mon Jul 18, 2022 7:07 am I think an unoptimized GIF encoder would work for me here because the optimizer I was using (gifsicle) never took more than 10 percent off the user-generated GIFs made by gifMaker.py. This is a screen shot my game at the point where the user chooses to make a gif and selects the text to go into the gif:
<snip>
The user-generated gif is the little typewriter (here, at 4x speed) in the pop-up window above (or below at the very bottom. I think I messed up the formatting of this comment).
And is there a reason why you haven't integrated it into your program and are instead invoking it as an external executable, requiring Löve to be available in the path in the target machines in addition to Python? That game is going to be a hell to distribute. Running external executables is almost always a bad idea.
Really? See if this works for you:meteopath wrote: ↑Mon Jul 18, 2022 7:07 am bookParse.py is important. It is essential, while the gifMaker is just a nice-to-have. I wrote bookParse.py in Python because I needed the help of a Python library (c-w/gutenberg on gitHub), specifically the function load_etext called on bookParse.py, line 309, here:
<snip>
This function takes a book_id-number as argument and downloads a plain text version of that book from a Project Gutenberg library at http://gutenberg.readingroo.ms. The indexing scheme of the readingroo.ms website is explained in the c-w library. So I think theoretically I could replicate the load_etext function. The problem is it's just beyond me right now. I spent a little time a month or two ago trying to figure out lua socket, and I never got any of the test cases to work.
Code: Select all
local http = require('socket.http')
local mirror = "http://gutenberg.readingroo.ms"
local function download(url)
local ret, status = http.request(url)
return status == 200 and ret
end
local function get_gutenberg_text(id)
local sid = tostring(id)
local s0id = id < 10 and "0" .. sid or sid
local url = s0id:sub(1, 1)
for i = 2, #s0id - 1 do
url = url .. "/" .. s0id:sub(i, i)
end
url = mirror .. "/" .. url .. "/" .. sid .. '/' .. sid
local text = download(url .. "-0.txt") -- utf-8
if text then
return text
end
-- We don't know how to convert encodings, so prefer the plain text
return download(url .. ".txt")
end