[abandoned mod] Gutenberg [gutenberg]

User avatar
duane
Member
Posts: 1715
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

[abandoned mod] Gutenberg [gutenberg]

by duane » Post

Note: I'm not working on this anymore.

This just lets you create books with actual books in them that you can read in game. Why would you want to do that? No idea. I just thought it was cool.

You should be able to download any Project Gutenberg text (as a .txt file), save it to your mods/gutenberg/books/ directory, and it will be available in the game. [You must be sure to give it a file name containing only letters, numbers, underscores, and periods, or the mod will not recognize it.] There is no special formatting, and images are not supported.

Note: The mod will create a cache file for each page of each book every time you start the game. This takes so little time on my ten-year-old laptop that I don't notice, but it could be an issue for someone. If you don't like your world directory cluttered, you may create a subdirectory in it called 'book_cache'. Cache files will be placed there instead.

Image

The source is available on github.

Code: LGPL2, textures: n/a

Mod dependencies: default

Download: https://github.com/duane-r/gutenberg/archive/master.zip

Recipes:

Combine the following to produce a random gutenberg book:
Paper, [empty], [empty]
[empty], Paper, [empty]
[empty], [empty], Paper
Attachments
gutenburg.jpg
gutenburg.jpg (127.78 KiB) Viewed 1212 times
Last edited by duane on Thu May 31, 2018 22:05, edited 6 times in total.
Believe in people and you don't need to believe anything else.

User avatar
duane
Member
Posts: 1715
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

Problems

by duane » Post

None so far.
Believe in people and you don't need to believe anything else.

User avatar
D00Med
Member
Posts: 949
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med
Location: Australia...somewhere

Re: [Mod] Gutenberg [gutenberg]

by D00Med » Post

That's a really cool idea!
Look! I have a signature :]
My subgame: viewtopic.php?f=15&t=14051#p207242

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod] Gutenberg [gutenberg]

by azekill_DIABLO » Post

what is the difference with ingame books?
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
Desour
Member
Posts: 1469
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: [Mod] Gutenberg [gutenberg]

by Desour » Post

well, Gutenberg invented the printing press, books got written before, too.
so i suggest to rename the mod or create a way to duplicate the books, like a printing press node
Edit: i saw, you cant rewrite the books, its ok, nice idea, but noone will use it to read a real-life book with that lag, i now understand the name, because this website is called Gutenberg project
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

User avatar
TheReaperKing
Member
Posts: 531
Joined: Sun Nov 22, 2015 21:36
Contact:

Re: [Mod] Gutenberg [gutenberg]

by TheReaperKing » Post

So I imagine this would read any epub format books not just from that site, and is epub the only file type it reads? I was thinking this would be great because the kids could write their own books and I'd convert it to epub and we could put them in :) Or even for a game make like a journal or something. It looks great!
Become A Real Life Superhero - http://SuperheroHill.com
Project Lead of the Doom 3 Mod Last Man Standing - http://Doom3Coop.com
Project Lead of Platinum Arts Sandbox Free 3D Game Maker - http://SandboxGameMaker.com
Youtube Channel - https://www.youtube.com/user/PlatinumArtsKids

twoelk
Member
Posts: 1482
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

Re: [Mod] Gutenberg [gutenberg]

by twoelk » Post

cool!

if I get the source right you can only load *.txt files and there is no formating beyond plain ascii of a txt file?
I had hoped for at least a subset of markdown (*.md)
I don,t know if a mod should be able to access content outside of the world folder but having the files in the "minetest-0.4.14\doc" folder as default content might be usefull - or at least fun.

I have been filling a minetest wiki with content for my roman map, maybe serving information with this mod is better or at least easier. I can imagine this usefull for teachers, though some more in-text navigation tools might be usefull for larger texts. Maybe you can find a way to generate a chapter list and only load one chapter at a time.

I will certainly test this thingy, I got several gigaloads of Gutenberg downloads I can throw at this ;-P

Aftermoth
Member
Posts: 22
Joined: Wed Apr 06, 2016 01:26

Re: [Mod] Gutenberg [gutenberg]

by Aftermoth » Post

You have just earned the cookie of your choice for spreading the word of Project Gutenberg to a new audience.

(You will have to get it yourself, though. This post only certifies your entitlement to said cookie without reservations.)

User avatar
duane
Member
Posts: 1715
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

Re: [Mod] Gutenberg [gutenberg]

by duane » Post

Thanks for the comments everyone. I have rewritten the code to cache each page of each book in the world directory. Now only the requested page (eighteen lines) is read with each page turn. None of the text is permanently cached in memory.
azekill_DIABLO wrote:what is the difference with ingame books?
You have to write the in-game books yourself.

DS-minetest wrote:its ok, nice idea, but noone will use it to read a real-life book with that lag
Pages are now cached individually, so both the memory use and lag are minimal, unless your connection can't handle eighteen lines of text.

TheReaperKing wrote:So I imagine this would read any epub format books not just from that site, and is epub the only file type it reads?
It only reads text files.
Believe in people and you don't need to believe anything else.

User avatar
TheReaperKing
Member
Posts: 531
Joined: Sun Nov 22, 2015 21:36
Contact:

Re: [Mod] Gutenberg [gutenberg]

by TheReaperKing » Post

Once again, another awesome creation from Duane :)
Become A Real Life Superhero - http://SuperheroHill.com
Project Lead of the Doom 3 Mod Last Man Standing - http://Doom3Coop.com
Project Lead of Platinum Arts Sandbox Free 3D Game Maker - http://SandboxGameMaker.com
Youtube Channel - https://www.youtube.com/user/PlatinumArtsKids

User avatar
Don
Member
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: [Mod] Gutenberg [gutenberg]

by Don » Post

+1
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod] Gutenberg [gutenberg]

by azekill_DIABLO » Post

+1
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
FreeLikeGNU
Member
Posts: 280
Joined: Tue Oct 28, 2014 02:50
GitHub: FreeLikeGNU
IRC: freelikegnu
In-game: FreeLikeGNU

Re: [Mod] Gutenberg [gutenberg]

by FreeLikeGNU » Post

A great book choice to demo! In case you might not know, this book was the basis for the movie John Carter, which is terribly underrated and I personally recommend it as well. You may also not know that I caught myself trying to click on the page advance button in Duane's screenshot because I like the story so much.

User avatar
duane
Member
Posts: 1715
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

Re: [Mod] Gutenberg [gutenberg]

by duane » Post

FreeLikeGNU wrote:A great book choice to demo! In case you might not know, this book was the basis for the movie John Carter, which is terribly underrated and I personally recommend it as well. You may also not know that I caught myself trying to click on the page advance button in Duane's screenshot because I like the story so much.
+10

This was the first novel I ever read, long, long ago, and the reason I was never caught without a novel amongst my school books in all the years that followed.
Believe in people and you don't need to believe anything else.

twoelk
Member
Posts: 1482
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

Re: [Mod] Gutenberg [gutenberg]

by twoelk » Post

This is fun ;-P

one minor problems so far when importing original files from the Gutenberg project seems to be that some files have a dash or minus character in the name which crashes minetest at start if the gutenberg mod is activated.

Similarly the mod not only checks for information about titel and author but expects these and thus does not load the world if it does not find something like

Code: Select all

Title: Minetest Readme file

Author: The Minetest Development Team

in the file.

The attached file contains the menu_lua_api.txt, lua_api.txt, README.txt and world_format.txt of the stable Minetest 0.4.14 release with the needed author and title lines in case somebody would like to have them at hand in-game. Just unzip them to the books folder of the gutenberg mod.
Attachments
MinetestDocuments.zip
(70.48 KiB) Downloaded 237 times
Last edited by twoelk on Thu Jul 14, 2016 12:23, edited 1 time in total.

User avatar
duane
Member
Posts: 1715
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

Re: [Mod] Gutenberg [gutenberg]

by duane » Post

twoelk wrote:one minor problems so far when importing original files from the Gutenberg project seems to be that some files have a dash or minus character in the name which crashes minetest at start if the gutenberg mod is activated.

Similarly the mod not only checks for information about titel and author but expects these and thus does not load the world if it does not find something like

Code: Select all

Title: Minetest Readme file

Author: The Minetest Development Team

in the file.
Ok, I've added a check for legal file names and a note to name the downloaded files carefully. It will now default to the file name for a title and 'Unknown' for the author, if it can't parse them.
Believe in people and you don't need to believe anything else.

User avatar
TheReaperKing
Member
Posts: 531
Joined: Sun Nov 22, 2015 21:36
Contact:

Re: [Mod] Gutenberg [gutenberg]

by TheReaperKing » Post

Not sure how easy it'd be, but what if it could handle images too? Maybe it'd be a separate mod but I was thinking it'd be cool for treasure maps and such and maybe the book cover.
Become A Real Life Superhero - http://SuperheroHill.com
Project Lead of the Doom 3 Mod Last Man Standing - http://Doom3Coop.com
Project Lead of Platinum Arts Sandbox Free 3D Game Maker - http://SandboxGameMaker.com
Youtube Channel - https://www.youtube.com/user/PlatinumArtsKids

User avatar
Milan*
Member
Posts: 255
Joined: Thu May 28, 2015 06:45
GitHub: tchncs
IRC: Passant
In-game: Milan Passant
Location: Germany
Contact:

Re: [Mod] Gutenberg [gutenberg]

by Milan* » Post

woooo \o/ nice!

hajo
Member
Posts: 606
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

Re: [Mod] Gutenberg [gutenberg]

by hajo » Post

duane wrote:create books .. that you can read in game. ..
download any Project Gutenberg text (as a .txt file),
save it to your mods/gutenberg/books/ directory,
and it will be available in the game. ..
There is no special formatting, and images are not supported.

Recipe .. to produce a random gutenberg book:
Paper, [empty], [empty]
[empty], Paper, [empty]
[empty], [empty], Paper
A 'random' book from the textfiles stored in .\mods\gutenberg\books.
If there is only the book that comes with the mod-download,
every book you craft will be the same, "princess_of_mars".

Is there a way to re-roll books ?

Image
It would be nice to have some more buttons,
eg. to skip +/-10 pages, or jump to the start of the next/prev chapter.

Nevertheless, this is impressive.

User avatar
TheReaperKing
Member
Posts: 531
Joined: Sun Nov 22, 2015 21:36
Contact:

Re: [Mod] Gutenberg [gutenberg]

by TheReaperKing » Post

I'm interested in having my students write the .txt files and add their books to the game especially to create city/town libraries. Is there a way to make it non random?
Become A Real Life Superhero - http://SuperheroHill.com
Project Lead of the Doom 3 Mod Last Man Standing - http://Doom3Coop.com
Project Lead of Platinum Arts Sandbox Free 3D Game Maker - http://SandboxGameMaker.com
Youtube Channel - https://www.youtube.com/user/PlatinumArtsKids

User avatar
duane
Member
Posts: 1715
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

Re: [Mod] Gutenberg [gutenberg]

by duane » Post

TheReaperKing wrote:I'm interested in having my students write the .txt files and add their books to the game especially to create city/town libraries. Is there a way to make it non random?
I suppose that would be possible, if you could create a formspec that gave you a menu of titles to choose from, but I've no idea how to do that. I've been copying my formspecs from other projects.
Believe in people and you don't need to believe anything else.

User avatar
Cross_over
Member
Posts: 11
Joined: Fri Nov 10, 2017 18:28
In-game: Cross_over

Re: [Mod] Gutenberg [gutenberg]

by Cross_over » Post

I have downloaded another txt book from PG to test but i only get the princess of mars, what im doing wrong?

User avatar
duane
Member
Posts: 1715
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

Re: [Mod] Gutenberg [gutenberg]

by duane » Post

Cross_over wrote:I have downloaded another txt book from PG to test but i only get the princess of mars, what im doing wrong?
Just put the text file (no other type) in the books directory of the mod.
Believe in people and you don't need to believe anything else.

User avatar
Hamlet
Member
Posts: 766
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [abandoned mod] Gutenberg [gutenberg]

by Hamlet » Post

I've been trying this mod, it is great and it is a pity that has been abandoned.

Just a question: how many files can be opened by LUA?
I'm asking because another mod is conflicting, making the game crash and dumping in the debug.txt "Too many files opened".
My repositories: Codeberg.org | My ContentDB's page

User avatar
duane
Member
Posts: 1715
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r
Location: Oklahoma City
Contact:

Re: [abandoned mod] Gutenberg [gutenberg]

by duane » Post

Hamlet wrote:I've been trying this mod, it is great and it is a pity that has been abandoned.

Just a question: how many files can be opened by LUA?
I'm asking because another mod is conflicting, making the game crash and dumping in the debug.txt "Too many files opened".
I pushed a change to explicitly close the files opened during caching. It shouldn't make any difference, since they should be closed when they fall out of scope, but who knows? If that doesn't fix it, I've no idea what's going wrong.
Believe in people and you don't need to believe anything else.

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests