Encyclopaedia / Bestiary Framework
Forum rules
Do not post questions here!
This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Do not post questions here!
This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
-
- Regular
- Posts: 111
- Joined: Fri Oct 11, 2013 12:46 am
- Contact:
Encyclopaedia / Bestiary Framework
Online documentation: https://renpy-encyclopaedia.readthedocs.io/
Demo game: https://jsfehler.itch.io/renpy-encyclopaedia
Source code: https://github.com/jsfehler/renpy-encyclopaedia
Latest release: https://github.com/jsfehler/renpy-encyc ... a/releases
Features:
- Sort entries by Number, Alphabetically, Reverse Alphabetically, by Subject, or by Unread status.
- Filter entries by Subject.
- Sub-page system for nesting entries. Allows an entry to be unlocked progressively.
- Locking/unlocking allows you to decide when entries should be accessible.
- Locked entries can be displayed with customizable placeholders or outright hidden.
- Entry Unlocks can be tied to individual save games or universal (using Ren'py persistent data).
- Default visual template is provided, but can be completely customized or replaced using Ren'py Screen Language.
Demo game: https://jsfehler.itch.io/renpy-encyclopaedia
Source code: https://github.com/jsfehler/renpy-encyclopaedia
Latest release: https://github.com/jsfehler/renpy-encyc ... a/releases
Features:
- Sort entries by Number, Alphabetically, Reverse Alphabetically, by Subject, or by Unread status.
- Filter entries by Subject.
- Sub-page system for nesting entries. Allows an entry to be unlocked progressively.
- Locking/unlocking allows you to decide when entries should be accessible.
- Locked entries can be displayed with customizable placeholders or outright hidden.
- Entry Unlocks can be tied to individual save games or universal (using Ren'py persistent data).
- Default visual template is provided, but can be completely customized or replaced using Ren'py Screen Language.
Last edited by Human Bolt Diary on Mon Jun 12, 2023 12:03 pm, edited 5 times in total.
Re: Encyclopaedia / Bestiary Framework (Functional Prototype
Thanks for working on this! It's something I was putting off until much later in development. I'm sure this will help tremendously, and I'll be following your work closely.
-
- Regular
- Posts: 111
- Joined: Fri Oct 11, 2013 12:46 am
- Contact:
Re: Encyclopaedia / Bestiary Framework
Thanks, I hope you find it useful.Coyotl wrote:Thanks for working on this! It's something I was putting off until much later in development. I'm sure this will help tremendously, and I'll be following your work closely.
The latest version is "feature complete" since I can't think of much more to add, but if there's any options not included that you're interested in I can look into adding it.
-
- Regular
- Posts: 111
- Joined: Fri Oct 11, 2013 12:46 am
- Contact:
Re: Encyclopaedia / Bestiary Framework
I've updated the files to a new version. The code's been rewritten a bit but should retain full compatibility with the older versions. It's mostly just cleaning up based on my increased Python knowledge. The biggest change is that the flags for the "New!" status can be generated dynamically.
The older version used a pretty gross way to make those flags:
Exploiting persistent data is still the way it works, but having to declare each flag is going to be painful if an Encyclopaedia has dozens or hundreds of entries. Now, that's all been stuck under the hood. All you need to do is state how many entries there will be:
The older version used a pretty gross way to make those flags:
Code: Select all
try:
persistent.enc00_new = persistent.new_dict["new_00"]
persistent.enc01_new = persistent.new_dict["new_01"]
persistent.enc02_new = persistent.new_dict["new_02"]
persistent.enc03_new = persistent.new_dict["new_03"]
persistent.enc04_new = persistent.new_dict["new_04"]
persistent.enc05_new = persistent.new_dict["new_05"]
persistent.enc06_new = persistent.new_dict["new_06"]
persistent.enc07_new = persistent.new_dict["new_07"]
except TypeError:
pass
#The keys must all have a prefix+number. "new_0" and "number" in this case.
persistent.new_dict = {
"new_00" : persistent.enc00_new,
"new_01" : persistent.enc01_new,
"new_02" : persistent.enc02_new,
"new_03" : persistent.enc03_new,
"new_04" : persistent.enc04_new,
"new_05" : persistent.enc05_new,
"new_06" : persistent.enc06_new,
"new_07" : persistent.enc07_new
}
Code: Select all
encyclopaedia.setPersistentStatus(entries_total=7, master_key="new", name="new")
- yon
- Regular
- Posts: 174
- Joined: Tue Sep 09, 2014 5:09 pm
- Projects: YDSP
- Soundcloud: tetra-yon
- itch: v-ual
- Location: United States
- Contact:
Re: Encyclopaedia / Bestiary Framework
I just checked out the new .rpy file, and wow. You really reworked this whole thing. I'll probably need a little while to re-familiarize myself with it, but I've got a good feeling about this update.
- yon
- Regular
- Posts: 174
- Joined: Tue Sep 09, 2014 5:09 pm
- Projects: YDSP
- Soundcloud: tetra-yon
- itch: v-ual
- Location: United States
- Contact:
Re: Encyclopaedia / Bestiary Framework
Could you post a zip file with the whole thing, actually? I remember there being one before, for 1.3 and 1.4, but I don't seen anything like that now. Am I missing something?
I tried to make a copy of one of the previous projects and overwrite the old files with the new attachments, but it doesn't seem to work if I try that.
I tried to make a copy of one of the previous projects and overwrite the old files with the new attachments, but it doesn't seem to work if I try that.
- Meinos Kaen
- Regular
- Posts: 107
- Joined: Wed Jan 04, 2012 1:01 pm
- Completed: JPDE - Sonata of Fire
- Projects: JPDE, Ars Oratoria, ONHA
- Skype: therealmeinoskaen
- Location: Somewhere in Italy...
- Contact:
Re: Encyclopaedia / Bestiary Framework
Oh my god, thank you thank you thank you for this. Not only does it work wonderfully and can add more dept to games rich of lore, but it also solved another unrelated problem for me.
Re: Encyclopaedia / Bestiary Framework
That's great piece of code thanks for it. Please keep it updated I also have one question can you update already read entries? fe.
entry one = You met this guy at park.
later in game you get update
entry one (updated) = This guy name is John I met him at park first.
entry one = You met this guy at park.
later in game you get update
entry one (updated) = This guy name is John I met him at park first.
- Laiska
- Veteran
- Posts: 323
- Joined: Sat Jan 11, 2014 1:14 am
- Completed: Queen At Arms, Cerulean, The Shadows That Run Alongside Our Car, Vicarwissen
- Projects: Caramel Mokaccino
- Tumblr: minesweeperaddict
- Deviantart: koyoba
- Contact:
Re: Encyclopaedia / Bestiary Framework
I'm curious about this as well - anyone?Luxliev wrote:That's great piece of code thanks for it. Please keep it updated I also have one question can you update already read entries? fe.
entry one = You met this guy at park.
later in game you get update
entry one (updated) = This guy name is John I met him at park first.
Also the demo script doesn't run properly because it doesn't include the images =P
~*Portfolio*~
Completed: Vicarwissen | The Shadows That Run Alongside Our Car | Queen At Arms | Cerulean
Completed: Vicarwissen | The Shadows That Run Alongside Our Car | Queen At Arms | Cerulean
-
- Regular
- Posts: 111
- Joined: Fri Oct 11, 2013 12:46 am
- Contact:
Re: Encyclopaedia / Bestiary Framework
Off the top of my head, if you create the entry data in an init block, it'll get set each time the game starts. If you create the entry data outside, it should save if you update it. So you could do something like:
However, creating the entry data outside an init block may cause bugs if you want to be able to open the encyclopaedia from the main menu. Now that I think about it, I haven't tested what happens if you try to open an Encyclopaedia that has zero entries. If it crashes, I could probably fix it over a weekend.
Code: Select all
a_entry = "Blah blah blah"
a "Hamburgers? Love 'em."
python:
a_entry = "Blah blah blah. Loves hamburgers."
However, creating the entry data outside an init block may cause bugs if you want to be able to open the encyclopaedia from the main menu. Now that I think about it, I haven't tested what happens if you try to open an Encyclopaedia that has zero entries. If it crashes, I could probably fix it over a weekend.
Laiska wrote:I'm curious about this as well - anyone?Luxliev wrote:That's great piece of code thanks for it. Please keep it updated I also have one question can you update already read entries? fe.
entry one = You met this guy at park.
later in game you get update
entry one (updated) = This guy name is John I met him at park first.
Also the demo script doesn't run properly because it doesn't include the images =P
Re: Encyclopaedia / Bestiary Framework
Hello there!
I have a question about using this awesome encyclopaedia - how can I customize it? I'm pretty newbie in coding and I just can't get how I should to change the text style, I mean, size, color, etc. I tried to use init python to create a style of encyclopaedia_list, but there were no changes. Sorry, I'm so stupid ><
I really, really need help.
I have a question about using this awesome encyclopaedia - how can I customize it? I'm pretty newbie in coding and I just can't get how I should to change the text style, I mean, size, color, etc. I tried to use init python to create a style of encyclopaedia_list, but there were no changes. Sorry, I'm so stupid ><
I really, really need help.
- Otoke_Neko
- Regular
- Posts: 29
- Joined: Mon May 09, 2016 8:08 pm
- Completed: Touching Grass with Ain, STLP, Steamed Fish
- Tumblr: OTOJANG!, Otoke Neko
- Deviantart: OtomeNekos
- itch: otojang
- Discord: otokeneko
- Contact:
Re: Encyclopaedia / Bestiary Framework
Try doing this: "{color=hexcode} text {/color}LabaroDD wrote:Hello there!
I have a question about using this awesome encyclopaedia - how can I customize it? I'm pretty newbie in coding and I just can't get how I should to change the text style, I mean, size, color, etc. I tried to use init python to create a style of encyclopaedia_list, but there were no changes. Sorry, I'm so stupid ><
I really, really need help.
Of course, I didn't use the encyclopedia in this topic, but it'll probably still work.
-
- Newbie
- Posts: 1
- Joined: Fri Sep 02, 2016 3:16 pm
- Contact:
Re: Encyclopaedia / Bestiary Framework
This is exactly what I was looking for - thank you!
Is there a way to make dialogue function as a button to pull up the encyclopaedia? Like, to make it so that if a character says "Hi, my name is John," you can press John to open his entry. Been fussing with it for a while, but I know nothing and have gotten nowhere
Is there a way to make dialogue function as a button to pull up the encyclopaedia? Like, to make it so that if a character says "Hi, my name is John," you can press John to open his entry. Been fussing with it for a while, but I know nothing and have gotten nowhere
- noeinan
- Eileen-Class Veteran
- Posts: 1153
- Joined: Sun Apr 04, 2010 10:10 pm
- Projects: Ren'Py QuickStart, Crimson Rue
- Organization: Statistically Unlikely Games
- Deviantart: noeinan
- Github: noeinan
- Location: Washington State, USA
- Contact:
Re: Encyclopaedia / Bestiary Framework
I do not know much about this, but I would guess maybe making a post in the main questions section of the forum, and ask like... "how to turn a word in dialogue into a button"tictactofu wrote:This is exactly what I was looking for - thank you!
Is there a way to make dialogue function as a button to pull up the encyclopaedia? Like, to make it so that if a character says "Hi, my name is John," you can press John to open his entry. Been fussing with it for a while, but I know nothing and have gotten nowhere
On a separate note, I really appreciate this code and have been keeping a copy in my resources file in case I ever needed it. Recently, I started making a game where I have need of an encyclopedia, but I wanted to make it so that sub-entries could have a slightly different picture.
I am having a really hard time finding in the code why the image doesn't change when you click to the next sub-entry page. I added an image to where I've defined the sub-entry:
Code: Select all
#When creating sub-entries, the main entry is considered page 1, always start at 2
en1_2 = EncEntry(2,"Crown Flower",lorem2,"Herb Identification", locked=False, image=en1_2_image)
Code: Select all
if encyclopaedia.getEntryData()[1].hasImage: #If the entry or sub-entry has an image, add it to the screen
Code: Select all
class ChangeEntryAction(EncyclopaediaEntryAction):
"""
Scroll through the current entry being viewed.
Used by Encyclopaedia's PreviousEntry and NextEntry functions
"""
def __init__(self, encyclopaedia, direction, block,*args,**kwargs):
self.enc = encyclopaedia
self.block = block #If the button is active or not
self.dir = direction #Determines if it's going to the previous or next entry
def __call__(self):
if self.block == False:
self.enc.setEntryData(self.enc.current_position+self.dir)
if self.enc.showLockedEntry == False:
self.enc.unlocked_entries[self.enc.current_position+self.dir][1].status = True
given_text = self.enc.unlocked_entries[self.enc.current_position + self.dir][1].getText()
else:
self.enc.all_entries[self.enc.current_position+self.dir][1].status = True
given_text = self.enc.all_entries[self.enc.current_position + self.dir][1].getText()
self.enc.entry_text = self.string_to_list(given_text)
self.enc.current_position += self.dir
self.enc.sub_current_position = 1 #When changing an entry, the sub-entry page number is set back to 1
renpy.restart_interaction()
def get_sensitive(self):
if self.block:
return False
return True
class ChangePageAction(ChangeEntryAction):
"""Change the current sub-entry being viewed."""
def __init__(self, encyclopaedia, direction, direction2, block,*args,**kwargs):
super(ChangePageAction,self).__init__(encyclopaedia, direction, block,*args,**kwargs)
self.dir1 = direction
self.dir2 = direction2
def __call__(self):
if self.block == False:
given_text = self.enc.getUnlockedEntry(self.enc.current_position).getSubEntry(self.enc.sub_current_position + self.dir1)
self.enc.entry_text = self.string_to_list(given_text)
self.enc.sub_current_position += self.dir2
renpy.restart_interaction()
Re: Encyclopaedia / Bestiary Framework
Here is the way to disable sorting?
UPD
Ah, I found it myself! ^^"
UPD
Ah, I found it myself! ^^"
Last edited by LabaroDD on Sun Jan 29, 2017 9:24 pm, edited 1 time in total.
Who is online
Users browsing this forum: Ahrefs [Bot]